You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Michael <mi...@asstr.org> on 2002/08/16 23:45:29 UTC

cgid and apache 2.0.40 on a high-load system

	I'm using apache 2.0.40 on a linux 2.2 (debian) system. I have a
CGI that reformats a great deal of the pages on the site before
they're sent out (yes, I know it should be rewritten as a filter
but I just upgraded to 2.0 about 3 days ago).

	Occasionally (mabye 4 or 5 times/day) I'll get an error like the
following in the logs, accompanied by a 500 error. I'm using the
worker MPM and thus cgid, also.

	Note that this *may* be related to excessive keepalive requests,
as the server pulling from my site is a "reverse cache" that
acts as a secondary webserver so it uses its max 500 keepalives
before ever closing a connection with my server.

	The server is also under a moderate amount of load, handling
~1 million requests/day, about 1/3rd of which use this CGI.

	A check on dmesg and in /proc shows that I'm not running out of
file handles on a system-wide basis; I'm not sure if I might be running
out on a per-process basis, but I doubt that since I never had that
problem when running apache 1.3.

	Any clues on why this problem is occuring or how to fix it would be greatly appareciated ;)

- Michael

[Fri Aug 16 16:07:54 2002] [error] [client 64.56.197.9] (9)Bad file descriptor:
write to cgi daemon process, referer: http://www.asstr.org/~tyger/title-index.ht
ml
[Fri Aug 16 16:07:54 2002] [error] [client 64.56.197.9] (9)Bad file descriptor:
write to cgi daemon process, referer: http://www.asstr.org/~tyger/title-index.ht
ml
[Fri Aug 16 16:07:54 2002] [error] [client 64.56.197.9] (9)Bad file descriptor:
write to cgi daemon process, referer: http://www.asstr.org/~tyger/title-index.ht
ml
[Fri Aug 16 16:07:54 2002] [error] [client 64.56.197.9] Premature end of script
headers: format, referer: http://www.asstr.org/~tyger/title-index.html


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: cgid and apache 2.0.40 on a high-load system

Posted by Joshua Slive <jo...@slive.ca>.
Michael wrote:
> 	I'm using apache 2.0.40 on a linux 2.2 (debian) system. I have a
> CGI that reformats a great deal of the pages on the site before
> they're sent out (yes, I know it should be rewritten as a filter
> but I just upgraded to 2.0 about 3 days ago).


> 	A check on dmesg and in /proc shows that I'm not running out of
> file handles on a system-wide basis; I'm not sure if I might be running
> out on a per-process basis, but I doubt that since I never had that
> problem when running apache 1.3.
> 
> 	Any clues on why this problem is occuring or how to fix it would be greatly appareciated ;)
> 
> - Michael
> 
> [Fri Aug 16 16:07:54 2002] [error] [client 64.56.197.9] (9)Bad file descriptor:
> write to cgi daemon process, referer: http://www.asstr.org/~tyger/title-index.ht
> ml

Are you using a threaded MPM or are you using prefork?  With a threaded 
MPM, apache generally selects mod_cgid in place of mod_cgi.  mod_cgid 
launches a separate daemon process that handles the launching of cgi 
scripts.  It could be this daemon that is running out of descriptors.

If that is what is happening, you can try increasing the per-process 
file descriptor limits.  You could also try forcing the use of mod_cgi 
in place of mod_cgid.  But be careful if you do that.  Some OSes do 
nasty things when you fork from a multi-threaded process (they recreate 
all the threads in the child process and then kill them off again).

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org