httpd error

Hey,

have a couple of servers on VMin all with the exact specs.

/var/log/virtualmmin/domain-name/error.log

[Fri Jan 21 23:09:17 2011] [warn] mod_fcgid: read data timeout in 31 seconds
[Fri Jan 21 23:09:17 2011] [error] [client IP] Premature end of script headers: cron.php
[Sat Jan 22 12:51:13 2011] [warn] mod_fcgid: read data timeout in 31 seconds
[Sat Jan 22 12:51:13 2011] [error] [client 1IP] Premature end of script headers: index.php,

after this point the virtual server seems to not receive requests on port 80. website is timing out.

but the other virtual servers are fine.

php.ini
maxmemory for scripts=128MB

I will provide as much info as I can… googleing around didnt seem to help alot…

Howdy,

The error you’re getting suggests that the script didn’t exit before the connection timed out.

That in itself doesn’t suggest a severe error, or explain why further connections aren’t accepted. That’s a bit unusual :slight_smile:

You may want to take a look at the access and error logs for that domain to see if further attempts to connect to that domain after the timeout occurs are showing up in the logs or not.

Also, if you have any sort of resource limits for that user setup in /etc/security/limits.conf (for example, some folks setup a maximum number of processes a user may have open at a given time), it’s possible that limit is being reached if the processes are taking a long time to exit.

As a test – you might consider switching that domain from FCGID to CGI mode, to see if that helps.

You can do that in Server Configuration -> Website Options, and edit the option “PHP script execution mode”.

-Eric

Hi,

as the log states, you seem to be facing a timeout.

The point you are facing is an fcgi timeout-so you would have to increase the maximum runtime of the scripts under this server-which ist usually 30secs. You could increase this value (Per Domain in Server Configuration -> Website Options ->Maximum PHP Script run time) or just execute your cron script via Cron, which I would recommend as PHP-Cli Scripts have no maximum run time.

The online help states:

When PHP scripts are run using FCGId mode, this field sets the maximum time each script call can run for. You may need to increase it when hosting scripts that have particularly high run times, and are being killed by your web server before completion.

Hope this helps you!

Hi, seems as if you were faster… just a few words:
I noticed that on low powered machines it takes some time for fcgi-instances to spawn after one was shot.

/etc/security/limits.conf has everything commented out…

will the switch from fcgid to cgi not make the website access performance slower? its a high hit site so downtime is not negotiable. :slight_smile:

also ususally i just restart httpd and the issue is resolved.

ok now I increased the maximum time a script may run to 60sec. thats now in the php.ini file

thank you so much for the replies guys…

If your site spawns fcgi-processes, your changes in the php.ini won’t affect the actual run time allowed by the fcgid.

You will have to choose the right option, where i told you above. Otherwise you will face the same problem again and again.

Especially on high performace sites I would stick to fcgi.

Another point I mentioned above:
A cron script should run from the command line, not from within the user visiting the page.

You could increase that value, but if you have a “high hit” site, I am not sure whether your visitors are happy with 60 seconds response times … If you get this problem frequently you probably need to do some tuning:

http://httpd.apache.org/docs/2.0/misc/perf-tuning.html

Or even get a better server :slight_smile: