ApacheBench (ab) Keep-Alive feature behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux