logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: 9 instances of php-cgi.exe??? Is this normal
Author
unmgroup



Joined: 22 Jul 2006
Posts: 19

PostPosted: Mon 21 Aug '06 6:11    Post subject: 9 instances of php-cgi.exe??? Is this normal Reply with quote

I have a fairly popular site. about 60,000 hits daily... and 200 users on at any given time. My site is database driven, php-nuke based site... it runs on a dedicated sever. Dual Opteron 250's , and 3 gigs of ram. It's the only site being ran. I'm wondering why there is 9 instances of php-cgi.exe running at the time time. The server is taking 15 seconds to generate pages. What could be the problem?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 21 Aug '06 9:27    Post subject: Reply with quote

You should use PHP as module! When ppl enter a page Apache need to start the cgi everytime. The modul need only one time to be loaded.
IF you have to use PHP as cgi use php.exe instead of php-cgi.exe because it is more optimised for windows and runs faster?
You use PHP 5? Which version of Apache do you run? Which os?
Back to top
unmgroup



Joined: 22 Jul 2006
Posts: 19

PostPosted: Mon 21 Aug '06 14:36    Post subject: Reply with quote

James Blond wrote:
You should use PHP as module! When ppl enter a page Apache need to start the cgi everytime. The modul need only one time to be loaded.
IF you have to use PHP as cgi use php.exe instead of php-cgi.exe because it is more optimised for windows and runs faster?
You use PHP 5? Which version of Apache do you run? Which os?



I'm using apache 2.2.3, with the version 5.14 of php. I have tried using the apache module provided by this site, but every 15-20 minutes the server crashes and restarts with this showing in the logs:

FATAL: erealloc(): Unable to allocate 1572864 bytes

I'm using Windows Server 2003. Dual Opteron 250 processors, and 3 gigs of ram on a dedicated box. There is only one site running that gets about 60,000 hits daily. I have tried everything but I always get that error message when trying to run php as a module. Also, php.exe does not work, I have no choice but to use php-cgi.exe. Can someone help?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Mon 21 Aug '06 15:03    Post subject: Reply with quote

Looks like your PHP script(s) are doing something that screwes up PHP.

You can try going back to php 4.4.4 or try the latest snapshot 5.2 at http://snaps.php.net/ . When it does not help, I advise to file a bug report at php.net.

Steffen
Back to top
Brian



Joined: 21 Oct 2005
Posts: 209
Location: Puyallup, WA USA

PostPosted: Tue 22 Aug '06 1:49    Post subject: Reply with quote

I'd be curious to know if you are using a PHP accelorator.

I quit using APC and found the stability improved. My web server delivers about 120,000 pages per day, and about 3GB of outbound traffic. I call executibles via EXEC and VIRTUAL, when done from ISAPI I have sometimes stability issues where the server hangs, does not crash.

Other times the Apache process dies and the watcher process restarts it almost instantly. For me it is generally a call to an application that itself goes south. But when I was trying APC I had too many problems as I have such an incredibly dynamic site. Literally about 75% of the pages I deliver are 100% dynamic from intensive disk reads as well as MySQL requests. The remaining 25% is basically just HTML.

I use MySQL heavily with just about 3000 MySQL queries per hour on average. I don't see that many Apache issues, it is almost always Apache and PHP calling something, not just PHP and not just Apache.

I had a lot more trouble when caching. When I run CGI calls, almost never a problem, but when there is, 100% so far with the app / exec called, not PHP and not Apache.

--
Brian
Back to top
Xing
Moderator


Joined: 26 Oct 2005
Posts: 49

PostPosted: Wed 23 Aug '06 17:43    Post subject: Reply with quote

Look at the waring in the php-manual:

Why shouldn't I use Apache2 with a threaded MPM in a production environment? See: www.php.net/manual/en/faq.installation.php#faq.installation.apache2

Try to use FastCGI or fcgid. It's more stable and therefore you can avoid some nightmares (especially in a production environment).


X
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Fri 25 Aug '06 14:58    Post subject: Reply with quote

Yes Xing. For production it is strongly advised to use FastCGI.

When you use Apache as module it runs in the Apache memory Space, this hogs mostly the total Apache memory *and* with issues in php it is taking down Apache with it, like unmgroup descibes above. When you run fastCGI then the total memory consumption is *far* less, FastCGI terminates his not anymore needed "servers". Only drawback is that you cannot set phpValues in your apache config.

The speed of FastCGI is on par with running as module and much much faster when you run as pure CGI.


Bottomline: use fastCGI in a production environment, for the sake of STABILITY.

Steffen
Back to top


Reply to topic   Topic: 9 instances of php-cgi.exe??? Is this normal View previous topic :: View next topic
Post new topic   Forum Index -> Apache