Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to know the number of connections that failed by timeout

Status
Not open for further replies.

Lisandro1987

Programmer
May 16, 2012
2
AR
My Apache server is limited of RAM, so I had to downloaded the number of 'MaxClients'. That is why I need to know the number of connections that fail by timeout, and if possible I need the date of each. Thanks so much!

PD: Sorry for my bad English...
 
Does your appache error log provide any indication?
 
May be you are not understanding me. The server is working, but when there are more than 'MaxClients' the server stop some connections. So I want to know how many connection stop the server to see if I need buy more RAM... Do you understand me?
 
Yes, I understand what you are saying. I am just not sure how you can measure the information you are after, unless there is a message in a log file to the effect that it dropped or rejected the connection. I have never had to deal with that problem, so I am not sure exactly what to look for, but there may be a message about failing to spawn an httpd process because having reached max limit.

Have you looked at any of the Apache tuning documents. It looks like the standard forumula is (Total Memory - Operating System Memory - MySQL memory) / Size Per Apache process or MaxClients = Total RAM dedicated to the web server / Max child process size, with each standard client being about 2-3Mb or 15Mb if you use a scripting language such as PHP. Unfortunately, looking at the documents on tuning, chances are that there is no method or message that will give you a "you have dropped X connections. Instead, I think you will need to get an idea of how many you accept on average and size your system accordingly.

Other approaches you may take, though more indirect would be to look at top and iotop and get a more accurate view of what the usage is.
 
Hi, You have not said what OS (platform) you are running or what version of Apache or even the changes to the values of all your Apache parameters?

It's difficult to comment without the full detail of your configuration and OS.

However, I suspect that you will not see any logging (unless you enable debug but then you defeat your object of tuning for performance) for dropped or queued client connections. You may be able to do some auditing of established and waiting connections at TCP level with netstat or some other basic tools but again that is unlikely to be what you are looking for. You will be better (with memory being so cheap these days) to add more memory and review your tuning parameters (I'm assuming at this point your OS is some flavour of Unix).

The following information may help you understand further ....

FromAGoogleSearch said:
MaxClients

This directive maps to the Maximum Requests field on the Performance Directives screen.

Note that this parameter is not available in mod_winnt (Microsoft Windows). Winnt uses a single process, multi-threaded model and is controlled by ThreadLimit directive.

Specifies a limit on the total number of servers running, that is, a limit on the number of clients who can simultaneously connect. If the number of client connections reaches this limit, then subsequent requests are queued in the TCP/IP system up to the limit specified with the ListenBackLog directive (after the queue of pending connections is full, new requests generate connection errors until a thread becomes available).

You can configure the MaxClients directive in the httpd.conf file up to a maximum of 8K (the default value is 150). If your system is not resource-saturated and you have a user population of more than 150 concurrent HTTP/Thread connections, you can improve your performance by increasing MaxClients to increase server concurrency. Increase MaxClients until your system becomes fully utilized (85% is a good threshold).

Conversely, when system resources are saturated, increasing MaxClients does not improve performance. In this case, the MaxClients value could be reduced as a throttle on the number of concurrent requests on the server.

If the server handles persistent connections, then it may require sufficient concurrent httpd or thread server processes to handle both active and idle connections. When you specify MaxClients to act as a throttle for system concurrency, you must consider that persistent idle httpd connections also consume httpd/thread processes. Specifically, the number of connections includes the currently active persistent and non-persistent connections and the idle persistent connections. A persistent, KeepAlive, http connection consumes an httpd child process, or thread, for the duration of the connection, even if no requests are currently being processed for the connection.

If you have sufficient capacity, KeepAlive should be enabled; using persistent connections improves performance and prevents wasting CPU resources reestablishing HTTP connections. Normally, you should not change KeepAlive parameters.

The maximum allowed value for MaxClients is 8192 (8K).

Default Value: 150

See here for more ....


IHTH

Laurie.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top