Skip to Content

Moving EGLUG to a VPS - again

linuxawy's picture


> Hi,
>
> The site eglug.org is down for a few hours now with 500 error. in the error
> log i found:
>
> [TIME_STAMP] [error] [client xxx.xxx.xxx.xxx] Premature end of script
> headers: index.php
>
> Please check this error as the website was not modified for a long time now,
> I guess it is some server issue.
>

I am sorry to hear of this trouble but I think I have found the cause.
Unfortunately, your "eglug" user's php5.cgi processes are being killed by
our procwatch daemon, and this is the source of the errors you are
receiving.

Procwatch is a daemon that runs constantly on shared servers to monitor
the usage of RAM/CPU and execution time so that no single user can use an
inappropriately high percentage of the shared resources and impact the
overall health of the server or the server's ability to serve all users'
pages.

When it finds a process that is using too great an amount of resources,
it kills that process. If it does this to a running script, the resultant
error the server shows is "premature end of script headers" - the script
can't complete.

This is happening regularly with your site. Below please see excerpts
from our procwatch log:

2009-10-07 17:14:59 procwatch2 INFO: Process(pid=4047, name='php5.cgi',
uid=eglug(2982972), tty=None, cpu=2.5, rss=32408.0, vsize=154024.0): kill
for total RAM (32408.00 self, 211224.00 total exceeds limit)

2009-10-07 17:14:59 procwatch2 INFO: Process(pid=3531, name='php5.cgi',
uid=eglug(2982972), tty=None, cpu=3.7, rss=30184.0, vsize=151848.0): kill
for total RAM (30184.00 self, 178816.00 total exceeds limit)

2009-10-07 18:34:25 procwatch2 INFO: Process(pid=20595, name='php.cgi',
uid=eglug(2982972), tty=None, cpu=2.7, rss=34976.0, vsize=151920.0): kill
for total RAM (34976.00 self, 234072.00 total exceeds limit)

2009-10-07 18:34:25 procwatch2 INFO: Process(pid=20598, name='php.cgi',
uid=eglug(2982972), tty=None, cpu=2.8, rss=34952.0, vsize=151920.0): kill
for total RAM (34952.00 self, 199096.00 total exceeds limit)

2009-10-07 18:34:25 procwatch2 INFO: Process(pid=20594, name='php.cgi',
uid=eglug(2982972), tty=None, cpu=2.6, rss=34948.0, vsize=151924.0): kill
for total RAM (34948.00 self, 164144.00 total exceeds limit)

In short, what this is saying is that the combined PHP scripts run by the
user that runs that site ("eglug") is simply using too much memory for a
shared server. Note this could be a single site, or more than one site -
with PHP it is hard to tell as each PHP process is only identified as
php5.cgi. This can be telling us that a single request added to other
running requests, or a single large request alone, is exceeding
acceptable memory limits.

There are only two ways to resolve this:

1) Decrease the overall memory required for your scripts to process,
create, and serve your site.

2) Move the site to a VPS, or dedicated server where you
can reserve sufficient RAM for your own processes to use without
impacting other users on the server.

The first approach can prove difficult depending upon your scripts, your
content, and your expertise, but if you can do that your site can
continue to run on a shared server without errors. The second alternative
is simpler, but involves additional cost for the PS services, and
sufficient RAM to avoid these errors.

I am sorry if this news is discouraging, but I felt it was important that
you have the full benefit of knowing what is occurring here so you can
make the appropriate decision to meet your needs for this site.

If you have any other questions, or if I can help you further, just let
me know!


Dr. Radut | forum