I have a fairly large SQL table, which one of our PHP apps does various queries against. We are having a 31-second timeout occurring which then produces an error message for the end-user & the page w/ the data never displays. The apache error log for the specific virtualmin website states:
[warn] mod_fcgid: read data timeout in 31 seconds
I’ve researched the issue a little bit & some people suggested modifying the following apache conf parameters:
IPCConnectTimeout
IPCCommTimeout
I found that on my debian 5 Virtualmin GPL system, I have the following config file:
/etc/apache2/mods-enabled/fcgid.conf
It looked like this:
AddHandler fcgid-script .fcgi
IPCConnectTimeout 40
I changed it to:
AddHandler fcgid-script .fcgi
IPCConnectTimeout 60
IPCCommTimeout 300
I restarted apache, but the errors persist. I also changed the following PHP-related timeout settings:
max_execution_time
max_input_time
default_socket_timeout
mysql.connect_timeout
I set each of these to either 60 or 120 seconds.
I changed these parameters in pretty much every single php.ini file I could find that I thought could possibly come into play (every PHP conf file under /etc/php5, the one in /home//etc/php5, etc).
Restarted apache. Still the error is the same:
mod_fcgid: read data timeout in 31 seconds
Watching the clock confirms that this error is being produced right at 31 seconds.
I know some people have suggested that this may be a PHP issue and NOT a fcgi issue. But it seems to me that if that were the case, we’d be seeing a PHP error message, and not fcgi message?? Or at least an error message that seemed more descriptive of it being a PHP timeout parameter being exceeded?
Some people suggested changing the virtualmin website’s PHP execution mode to CGI. I did so, but doing so created strange results. I wound up with no error message, but also it seemed that the script just never stopped executing.
So I’m looking for help with this issue.
Just to give more insight into what our PHP app does, the function we’re trying to use is actually just to dump one of our mysql tables via PHP. What we’re finding is that our PHP succeeds if we we limit the query with a WHERE statement to only return a subset of the records. But removing the WHERE clause results in the script hitting 100% CPU usage for 1 core & staying that way until the 31-second fcgi timeout error occurs.
When we query the subset, we also see the 1 CPU core pegged out, but only for 10-15 seconds, after which the expected results are returned.
The primary solution I’d hope to see is simply to increase this timeout value to 60 or 120 seconds.
Anybody know how I can accomplish this?
Thanks a lot!
Doug