could be a stupid question..

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

could be a stupid question..

Post by malcolmboston »

lately ive been noticing that my computer has been grinding to a halt at times and after inspecting my system processes, it showed there was more than 10 instances of php4.exe running

The problem with this is, when i do net stop apache, they all clear, and then seemingly at random intervals i will check back and there will be more instances of it running without me even viewing the site, therefore PHP should not of started a process.

I have given my localhost IP to one client but i doubt very much he is connecting that often, also, why would it create 15+ instances of php4.exe???

could it be an error in my coding, with a system memory leak? is this even possible with PHP? (i highly doubt it)

as a side note, at first i thought it was the zend studio internal debugger causing it all but this has become less and less likely to be the case.

Any ideas?
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

bump
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post by Syranide »

if there are many processes running, restart, see if there are any (shouldn't be), surf around on it, see if they've come back. I'd guess there is some script not terminating (infinite or very long timeout).

as far as I know PHP is only running while it is processing a script, other than that it is not executed, so it really should be something happening (bot or something scanning your site could trigger this too).
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

hmmmm, not sure on the bots idea, not sure how they'd of got hold of my site seeings as its a direct IP connection (http://34.54352.4542 etc) and if i had 15 bots crawling my site id be a very happy man!

also there are no cron jobs so nothing should be starting up by itself
User avatar
artexercise
Forum Commoner
Posts: 33
Joined: Thu Nov 20, 2003 9:38 am
Location: Raleigh, NC

Post by artexercise »

Syranide wrote:if there are many processes running, restart, see if there are any (shouldn't be), surf around on it, see if they've come back. I'd guess there is some script not terminating (infinite or very long timeout).

as far as I know PHP is only running while it is processing a script, other than that it is not executed, so it really should be something happening (bot or something scanning your site could trigger this too).
Syranide is right. If some page is getting caught in an infinite loop then the process will stay open and active. I have about 50+ people that can get my local server here and every now and then this happens. Very rarely is IS my coding, but the principle culprit I had found was a connection problem across servers.

I had several instances in which I used another server as an email server and I also had to connect to a printer server. In both cases if the server was down this caused the system to pause long enough to make the end user hit the refresh button several times. After several people did this, the php server would come crashing to a halt and I'd have up to 30 instances of php running.

Since then I'm reduced script running time and removed the printer server from the loop. So if your end user is getting frustrated at a slow page load and hitting refresh often, then it could be another cause.
Post Reply