Alexei Tenitski
Alexei Tenitski

Reputation: 9370

Idle socket connection to Apache server timeout period

I open a socket connection to Apache server however I don't send any requests waiting for a specific time to do it. How long can i expect Apache to keep this idle socket connection alive?

Situation is that Apache server has limited resources and connections require to be allocated in advance before they all gone.

After request is sent server advertise its timeout policy:

KeepAlive: timeout=15,max=50

If consequent request is sent in longer then 15 seconds it gets 'server closed connection' error. So it does enforce the policy.

However, it seems that if no requests are sent after connection was opened Apache will not close it even for as long as 10 minutes.

Can someone shed some light on behavior of Apache in such situation.

Upvotes: 3

Views: 28073

Answers (1)

palacsint
palacsint

Reputation: 28885

According to Apache Core Features, TimeOut Directive the default timeout is 300 seconds but it's configurable.

For keep-alive connections (after the first request) the default timeout is 5 sec (see Apache Core Features, KeepAliveTimeout Directive). In Apache 2.0 the default value was 15 seconds. It's also configurable.

Furthermore, there is a mod_reqtimeout Apache Module which provides some fine-tuning settings.

I don't think that any of the mentioned values are available for http clients via http headers or any other forms. (Except the keep-alive value of course.)

Upvotes: 6

Related Questions