php.exe processes do not terminate

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
abyssisthebest
-


Joined: 30 Jun 2005
Posts: 319
Location: Boston, UK

PostPosted: Thu Mar 23, 2006 11:15 pm    Post subject: php.exe processes do not terminate Reply with quote

Hi,

Since i have upgraded to 2.3.0.5 the php.exe processes do not end after the script has finished loding.

Has anybody got any ideas?

Edit: This only happens when using FastCGI
_________________
My online Portfolio
Back to top View user's profile Send private message Send e-mail MSN Messenger
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Thu Mar 23, 2006 11:51 pm    Post subject: Reply with quote

Are you suggesting this isn't the desired behaviour?
That's what FastCGI does. If you don't want it/them there then don't use it.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Thu Mar 23, 2006 11:56 pm    Post subject: Reply with quote

Its the whole point of fastCGI. The process stays loaded so it can be quickly assigned another task when needed.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Mar 24, 2006 12:25 am    Post subject: Reply with quote

Let's say your FastCGI Processes Timeout is at 240 seconds (4 mins). When
a user requests the PHP application on the web server, the php.exe won't be
able to exit untill the FastCGI Processes Timeout expires.

Note: Each time the PHP page is requested, the FastCGI Processes timeout
will restart back to the beginning. So if you set this to a higher value, which
I set mine for 300 seconds (5 mins), it probably won't exit.

Edit: I changed it to 5 mins, the reason is because setting it to a higher
value is not a really good idea.

Note: The new native ASP.NET support uses this FastCGI timeout the
exact same way. You can test it for yourself and see. So it's good for
your ASP.NET pages, to keep the timeout at a high value.

Hopefully this answer's your question.

Sincerely, TRUSTpunk


Last edited by TRUSTAbyss on Fri Mar 24, 2006 6:31 pm; edited 2 times in total
Back to top View user's profile Send private message Visit poster's website
abyssisthebest
-


Joined: 30 Jun 2005
Posts: 319
Location: Boston, UK

PostPosted: Fri Mar 24, 2006 8:43 am    Post subject: Reply with quote

oh, its just that i had 4o php.exe processes running
_________________
My online Portfolio
Back to top View user's profile Send private message Send e-mail MSN Messenger
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Mar 24, 2006 11:19 am    Post subject: Re: php.exe processes do not terminate Reply with quote

abyssisthebest wrote:
Hi,

Since i have upgraded to 2.3.0.5 the php.exe processes do not end after the script has finished loding.

Has anybody got any ideas?

Edit: This only happens when using FastCGI

We confirm that this is how FastCGI works. For your first PHP page, Abyss Web Server will launch PHP. It sends the request to it, and waits for the results. When PHP generates the page it sends it back to Abyss, and remains active. Let's say that after 5 seconds, another PHP page is to be displayed, Abyss knows that there is already 1 PHP process active, it will send the request to it immediately.

Note that each PHP process can handle a single request at a time. So if 2 or more PHP pages are to be generated in the same time, Abyss Web Server will launch enough PHP processes to handle all of them. PHP processes that are not used for a certain period of time (FastCGI timeout) are stopped. This way of doing things is ideal to accomodate traffic spikes: Abyss will handle the temporary load by creating more FastCGI processes. As the traffic slows, FastCGI processes are stopped one by one.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
abyssisthebest
-


Joined: 30 Jun 2005
Posts: 319
Location: Boston, UK

PostPosted: Fri Mar 24, 2006 4:13 pm    Post subject: Reply with quote

thanks,

It was jsut worrying me that there were 50 or so PHP.exe processes running.
_________________
My online Portfolio
Back to top View user's profile Send private message Send e-mail MSN Messenger
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Fri Mar 24, 2006 4:21 pm    Post subject: Reply with quote

abyssisthebest wrote:
thanks,

It was jsut worrying me that there were 50 or so PHP.exe processes running.

Having 50 php processes running suggests that your FastCGI timeout is set to a very high value. There is no point to set it to more than a few minutes (120-300 seconds). If the timeout value is high, and if you get a traffic spike, php processes will be created to sustain the temporary high load but will remain there for a long time (because the timeout is very long).

TrustPunk's suggestion to set the value to 86400 seconds (1 day) is also a bad practice.
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
abyssisthebest
-


Joined: 30 Jun 2005
Posts: 319
Location: Boston, UK

PostPosted: Fri Mar 24, 2006 4:37 pm    Post subject: Reply with quote

I have changed the value and exited all of the php processes, ill keep an eye on them and let you knwo how i get on
_________________
My online Portfolio
Back to top View user's profile Send private message Send e-mail MSN Messenger
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Fri Mar 24, 2006 4:44 pm    Post subject: Reply with quote

The default 240 seconds should be fine. Ive run fastCGI since I got the new release and not had any problems. They most PHP processes Ive seen running is 3.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Fri Mar 24, 2006 6:19 pm    Post subject: Reply with quote

I agree longer can be better but when you think about it if you suddenly get 100 hits in a 30 second period you will have quite a few processes load up and stay there, and possibly taking up memory that could otherwise be used elsewhere.

Ive kept mine to the default at the moment but I might increase it slightly and experiment with it. 240 seconds (4 mins) seems fine to me.

EDIT: TRUSTpunk deleted his post before I posted.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Mar 24, 2006 6:25 pm    Post subject: Reply with quote

Quote:

EDIT: TRUSTpunk deleted his post before I posted.


The Inquisitor,

I had to edit it but accidently deleted it. Since a day can cause problems
with the FastCGI Processes timeout, try 300 secs (5 mins). This should
be a much better option than 86400 secs (a day). :-)

It's up to you what timeout suits your needs. I'm starting to use 5 mins
instead of a day, because of what "admin" said about it.
Back to top View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Fri Mar 24, 2006 6:33 pm    Post subject: Reply with quote

If you site doesnt get many hits then a higher timeout may be useful too. Sometimes AbyssUnderground doesnt get a hit for over 30 minutes, although this is rare.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
loloyd
-


Joined: 03 Mar 2006
Posts: 435
Location: Philippines

PostPosted: Sat May 27, 2006 8:21 am    Post subject: Reply with quote

Thank you for this thread. All the while I thought I had something malicious going on inside my machine. I thought - "WTF!? Why are there a few php-cgi.exe instances that don't terminate after a minute? What's going on? Had I been subject to an SQL injection attack via a PHP script?"

I promptly renamed my php-cgi.exe to php-cgi_disabled.exe and checked. Hmm... nothing amiss found. Incidentally, my site posted 503 Service unavailable. And wow, was Abyss hard to fool. It won't accept my config changes if it doesn't find php-cgi.exe as I have previously renamed it hehehe.

My paranoia has subsided now thanks to this thread. :oops: Then I set my FastCGI process timeout to 120 seconds.
-----
"I have this nagging fear that everyone is out to make me paranoid."
_________________

http://home.loloyd.com/ is online if the logo graphic at left is showing.
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group