Re: apache bench -k switch

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

 



On December 23, 2011 12:03 , S Ahmed <sahmed1020@xxxxxxxxx> wrote:
When I add the -k switch during my benchmarks, my requests per second increases substantially.

Can someone explain to me what -k does?

From the ab man page:

-k Enable the HTTP KeepAlive feature, i.e., perform multiple
              requests within one HTTP session. Default is no KeepAlive.


Is it simply re-using the sockets opened?

It sends multiple HTTP requests over a single connection to the web server. This involves not only keeping the socket open, but also signaling to the server that the client supports keepalive. The server may choose not to allow keepalive even if the client supports it. The server may choose to limit the number of requests on a single connection, or the maximum time it will wait for a subsequent request.

See the Apache HTTP Server documentation for the following directives: KeepAlive, KeepAliveTimeout, MaxKeepAliveRequests.

A more detailed description is available at https://en.wikipedia.org/wiki/HTTP_persistent_connection


Is it more or less realistic (mimics real world traffic) to have the -k switch?

It depends on whether the browsers that are generating your real world traffic are using keepalive or not. Also, if it's important to mimic real world traffic, then you would want a more sophisticated benchmarking tool than ab so that you can not only mimic keepalives, but also control the number of requests per connection, the time between requests, request pipelining, and how long a connection is held open by the client after the last request on it.

--
  Mark Montague
  mark@xxxxxxxxxxx


---------------------------------------------------------------------
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