Hello Erno,

As to your first part I might have some additional information to clarify
the messages you have seen in your logs.

> I am having troubles with the following combination:
> Apache 2.2.6 + mod_fcgid 2.2 + php-fcgi 5.2.4 + eAccelerator(latest)
eAccelerator is really bad for php 5.2+. It generates false opcodes as
far as I can tell (for example protected variables in php are not
accessible from within the class itself, etc). You should consider
switching to APC or Xcache.

> I got Internal server error time to time, some examples taken from
> error_log:
>
> [Sat Oct 20 08:26:12 2007] [warn] (104)Connection reset by peer:
> mod_fcgid: read data from fastcgi server error. [Sat Oct 20 08:26:12
> 2007] [error] [client xxx] Premature end of
> script headers: foobar1.php, referer: http://foobar/foobar1.php
A few weeks ago I traced this bug down to the initialization code of the
PHP fastcgi interpreter. In fact this bug itself is caused by eAccelerator
trying to get a shared memory segment but fails to do so.

PHP (till 5.1) wanted to print an error message, but accessed 
non-initialized
structures and crashed with signal 11. Since 5.2 there is a refactored
method for printing the error message that does not crash. Apache is
expecting "Content-type: .." as reply but gets the error instead, hence the
"Premature end of script headers..." error message.

> I was really out of ideas and then it just came up, that i read in
> lighttpd's documentation, that if you were using opcode cacher you
> have to limit number of fcgi processes to 1 and increase php's
> internal process manager to a higher value by setting
> PHP_FCGI_CHILDREN environment variable. So i set PHP_FCGI_CHILDREN to
> 10 in the shell script and MaxProcessCount to 1 in httpd.conf.
>
> Configuration seems to be stable and no internal server errors
> anymore (so far anyway).
How does the server handle under heavy load? Since the original problem
is caused by heavy load, have you stress-tested the Apache with "ab"?

> And now my question is:
>
> mod_fcgid reports the following events, which is normal:
> [Sat Oct 20 14:49:10 2007] [notice] mod_fcgid:
> /web/web/host/foobar.hu/pages/foobar4.php total process count 1 >= 1,
> skip the spawn request
>
> I am not familiar with the fastcgi protocol at all, so I am wondering
> whether in this case mod_fcgid forwards the requests to the php
> process manager or is waiting for processing of prev requests to be
> finished?...

I was wondering, in the configuration above you mentioned:

(httpd)
MaxRequestsPerProcess 500

(php wrapper script)
PHP_FCGI_MAX_REQUESTS=2000
export PHP_FCGI_MAX_REQUESTS

are these lines still accurate in your current configuration? If so,
you should change these values to be the same.

Regards,
Daniel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Mod-fcgid-users mailing list
Mod-fcgid-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users

Reply via email to