httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brokensword <brokensw...@te.net.ua>
Subject [users@httpd] ApacheBench (ab) Keep-Alive feature behavior
Date Wed, 15 Sep 2010 19:41:17 GMT

Hi.

I'm testing performance of some hand-made (on sockets) web-server.
Everything looks fine, except "keep-alive http" test case. As I understand -
in "keep-alive http" mode I shouldn't close() socket after each operation.
So cycle should look like following:
accept()
read()
write()
read()
write()
...
until I receive "Connection: close" or some error etc.

After launching ab with -k flag, ab always hangs after first write(). I see
my server's "Hello world" output in ab logs, but ab hangs forever until
timeout fires and I never receive anything from second read().

If I change logic to
accept()
read()
write()
close()
accept()
read()
write()
close()
...
everything works fine with ab -k.

But I'm losing sense of this keep-alive HTTP protocol feature then :(

Who can explain?

If you need a code - you can find it there:
http://zenebo.com/lighttz.c.tar.gz

just comment there closing of socket in write callback (close(cli->fd)) and
ev_io_stop(EV_A_ w) in read and write callbacks. Also change Connection:
close in http response to Connection: Keep-Alive.

-- 
View this message in context: http://old.nabble.com/ApacheBench-%28ab%29-Keep-Alive-feature-behavior-tp29721213p29721213.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message