473,225 Members | 1,318 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

endless loop script crashing apache

I'm using PHP 4.2.2 and Apache 2.0.4.0. A script running on a virtual
host had an endless loop in it that brought Apache to its knees. I have

max_execution_time=90
and memory_limit=32M

to handle larger file uploads and Gallery stuff (thumbnail processing)
but the script goes way past 90 seconds. Safe mode is off but the
script doesn't override it by using set_time_limit(). I have to restart
Apache to fix the problem. Apache Timeout is set to 300 seconds but
still goes way beyond that.

Any idea why the script might not be timing out?

Thanks...

Aug 15 '05 #1
2 2562
On 15 Aug 2005 11:45:56 -0700, co*********@gmail.com wrote:
I'm using PHP 4.2.2 and Apache 2.0.4.0. A script running on a virtual
host had an endless loop in it that brought Apache to its knees. I have

max_execution_time=90
and memory_limit=32M

to handle larger file uploads and Gallery stuff (thumbnail processing)
but the script goes way past 90 seconds. Safe mode is off but the
script doesn't override it by using set_time_limit(). I have to restart
Apache to fix the problem. Apache Timeout is set to 300 seconds but
still goes way beyond that.

Any idea why the script might not be timing out?


http://uk.php.net/set-time-limit

" Note: The set_time_limit() function and the configuration directive
max_execution_time only affect the execution time of the script itself. Any
time spent on activity that happens outside the execution of the script such as
system calls using system(), stream operations, database queries, etc. is not
included when determining the maximum time that the script has been running."

Are you sure it "brought Apache to its knees"? Was it instead the machine it
that slowed down? What are you processing thumbnails with - GD (extension) or
an external process such as ImageMagick? If external you could use "nice" to
drop the priority of the process down.

It still shouldn't bring the rest of the system down on a Unix operating
system; the scheduler is there to make sure everything gets a resonable chance
to run even when the system is busy.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Aug 15 '05 #2
Thanks for the reply... one of the scripts in question was poorly
written and endlessly looping through files on a non-existent file
resource handle. So I guess the file system would fall under the caveat
you quoted.

But still as you said it shouldn't bring the rest of the system down.
How is one to safeguard the server? I've checked out nice before but
didn't see any clear examples on how to properly use it.

Aug 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: Skybuck Flying | last post by:
I was just trying to figure out how some C code worked... I needed to make a loop to test all possible values for a 16 bit word. Surprise Surprise... C sucks at it... once again :D lol... C is...
24
by: Tweaxor | last post by:
This has been puzzling me all this week. This is actually a homework assignment from last semesmter. But the teacher wouldn't tell us why certain things didn't work, but it didn't just work. My...
73
by: Claudio Grondi | last post by:
In the process of learning about some deeper details of Python I am curious if it is possible to write a 'prefix' code assigning to a and b something special, so, that Python gets trapped in an...
1
by: mydejamail | last post by:
My PHP setup is not updating the error_log, I have checked all the error logging related settings and they have all been set. The script is also crashing inexplicably. Whenever I call a specific...
2
by: yangsuli | last post by:
It works perfectly well before but today my browser cannot get this php script i tried to run it in the localhost and it reported a seg fault :( i donot konw what to do.....:( restarting the...
6
by: uche | last post by:
This function that I have implemented gives me an infinite loop. I am trying to produce a hexdum program, however, this function is not functioning correctly.....Please help. void...
19
by: Richard | last post by:
Hi All, I copied a script example from http://www.irt.org/script/640.htm into a local .html file. I opened that file first in HTML-kit, which hung (in an infinite loop, I think) when I...
1
by: johnlanglois | last post by:
I have a page that uses php to process a form and send the results to the page that is misbehaving. The php fills in the form fields on the new page. I use javascript that executes onload and...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.