httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Gration <rich...@zync.co.uk>
Subject Re: [users@httpd] "Too many connections" error fix?
Date Thu, 02 Oct 2003 10:13:17 GMT
Hi there,

I don't have any specific answers, but I can suggest some things to try, 
based on my experience with Postgres.

I don't know if this applies to MySQL, but I had to recompile Postgres 
to increase the default compiled in limits to the number connections it 
would allow. Any configuration arguments about the number of connections 
have no effect above the compiled in limit. Just a thought, it might not 
be the same for MySQL.

Check that the operating system isn't running out of files and inodes. 
These settings can be read and changed using 
/proc/sys/fs/{file,inode}-max like this:

cat /proc/sys/fs/file-max

to show you the maximum number of open files at any one time. Similarly 
for inode-max. You can change them with something like:

echo 16384 > /proc/sys/fs/file-max
echo 65536 > /proc/sys/fs/inode-max

As a rule of thumb, inode-max should be 4 * file-max. This only applies 
to the 2.2.x kernels. For 2.4.x kernels, file-max is the same, but 
inodes are allocated dynamically, so /proc/sys/fs/inode-max is not 
present. The settings above are the actual values I used to eliminate 
"too many open files" errors on a dual 1GHz, 1Gb RAM, 70Gb SCSI machine.

You may need to change the number of allowed open files for httpd by 
placing a ulimit command in the httpd startup script (usually 
/etc/init.d/httpd on redhat). "man ulimit" to find out how to set open 
files, it's straightforward.

You might find these URLs useful
http://httpd.apache.org/docs/misc/perf-tuning.html
http://php.weblogs.com/tuning_apache_unix

This is mod_perl tuning, but this section has very good information on 
how to choose MaxClients based on the amount of memory in your machine:
http://perl.apache.org/docs/1.0/guide/performance.html#Choosing_MaxClients

HTH
Rick


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


Mime
View raw message