The Apache in question is running on a Ubuntu-EC2 instance. It basically handles about a million requests per hour. Essentially a client will POST
a JSON and that's it - so an interaction of a client with the server only consists of this single request.
My naive assumption would be to turn KeepAlive
to off
then. Though I read that keeping a connection alive is also of benefit if the received requests across clients are very similar.
Should I switch KeepAlive
on
or off
?
(And as w're already at it - I would also appreciate a suggestion/clarification on MaxKeepAliveRequests
and KeepAliveTimeout
)
Keep it off, I would say. If you enable KeepAlive, you'll see lots more Apache processes hanging around than without it.
Also make sure you decrease the
TimeOut
value from the default 300 seconds to a much lower value, to 10 seconds or so.A quantifiable approach to this question is by logging requests and for each the "number of keepalive requests handled on this connection" (
%k
) 1.The higher the share of requests featuring a
0
(as it is in my case) the more likely it is that switchingKeepAlive
off
will be beneficial.