luvit/luvit — Issue #149: header returned in separate tcp packet
Author: JakSprats
Created: 2012-03-08 15:42:26+00:00
State: open

Hi Tim,

Here is a tcpdump of the luvit script: https://github.com/JakSprats/Alchemy-Database/blob/master/redis_unstable/src/luvit/alchemy_server.lua

I called

taskset -c 1 ab -n 10 -k "http://localhost:8080/SET/X/1111111111111111111111111111"
taskset -c 1 ab -n 10 -k "http://localhost:8080/GET/X"

The GET's look like this:

12:35:02.420540 IP localhost.http-alt > localhost.42237: tcp 117
E.....@.@.?E............%..d%..)...........
...b...bHTTP/1.1 200 OK
Content-Length: 29
Content-Type: text/plain
Server: Luvit
Date: Thu, 08 Mar 2012 15:35:02 GMT

12:35:02.420548 IP localhost.42237 > localhost.http-alt: tcp 0
E..4z.@.@...............%..)%..............
...b...b
12:35:02.420562 IP localhost.http-alt > localhost.42237: tcp 29
E..Q..@.@.?.............%...%..).....E.....
...b...b1111111111111111111111111111

If I make the same call to AlchemyDB w/ its REST API: I get the following tcp dump

12:36:25.870525 IP localhost.6379 > localhost.38801: tcp 98
E.....@.@.D.............t...s..~...........
........HTTP/1.0 200 OK
Content-length: 35
Connection: Keep-Alive

$28
1111111111111111111111111111

----------------------------------------------------------------------------------
Returning the extra packet can significantly degrade thruput

Ok, I am gonna go back to banging on luvit, having tons of fun :)

- Russ (aka: jaksprats)