By default it's set to 150. I bumped it up somewhat recently. I was just wondering if there's a golden rule when it comes to setting a Max Request Workers number. Is there a formula of some sort there?
I was going to reply yesterday, then did not. But as nobody else has... Your MaxRequestWorkers should be based on need and available resources (RAM). A more important setting, I think, is the KeepAliveTimeout. If you have KeepAlive enabled, it should have a short timeout, not more than 2 or 3 seconds I say. I have seen cases where people have the KeepAlive set at 15 seconds or whatever and the Apache process is tied to that IP for 15 seconds, requiring more processes to be started to serve other visitors and it exhausts RAM and causes crashes. http://2bits.com/articles/tuning-the-apache-maxclients-parameter.html http://httpd.apache.org/docs/2.4/mod/mpm_common.html#maxrequestworkers http://httpd.apache.org/docs/2.4/mod/core.html#keepalivetimeout
KeepAliveTimeout is off in my case. Throughout the day I get an error message (once or twice a day) "can't connect to the DB due to too many requests" for one of my sites. The interesting thing is sometimes I get that error message on one computer but not on the others (I use 3 computers for work). So I was wondering what the cause might be. Naturally I thought of the Max Request Workers setting. But maybe it's something entirely different?
KeepAlive can be helpful. http://httpd.apache.org/docs/2.2/mod/core.html#keepalive Your error message sounds like a database issue, not a web server issue. You are using MySQL or MariaDB? https://dev.mysql.com/doc/refman/5.1/en/too-many-connections.html
Yes, it's a MySQL database. I just read in some manual for Apache that it's important to keep Server Limit and Max Request Workers at about the same amount. By default they are set at 256 and 150 respectfully. It appears that changing them to the same number (like 300 and 300) may help resolve the issue of "too many connections". Will try that to see if it does help. PS Really appreciate all the helpful links you posted there.