473,506 Members | 13,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

register_shutdown_function causing script to run very slowly

Hi All,

I use register_shutdown_function to register a function that then gets run
when the script finishes executing. It worked great before, but sometime
last week on my development server all my sites started going very slowly.
It is still running fine on the production server (thankfully).

Nothing was changed. In fact, I was out of town that week, and the dev
server was powered off.

I did a little investigation, trying to locate the source of the slowdown,
and eventually I narrowed it down to the line:

register_shutdown_function('siteShutdown');

Commenting out that line made things run perfectly again (generates within
20-80 ms, depending on the page size). Uncomment it, and the page takes 3-4
seconds to generate. It does not generate piecemeal, either; it is blank
for several seconds, then in blink, the entire page arrives.

Has anyone got any ideas? What could cause this, and how could it suddenly
start happening, without me making any changes?

Sincerely,
-Josh
Jul 17 '05 #1
2 1885
On Wed, 02 Jun 2004 12:22:06 GMT, "Joshua Beall"
<jb****@donotspam.remove.me.heraldic.us> wrote:
Hi All,

I use register_shutdown_function to register a function that then gets run
when the script finishes executing. It worked great before, but sometime
last week on my development server all my sites started going very slowly.
It is still running fine on the production server (thankfully).

Nothing was changed. In fact, I was out of town that week, and the dev
server was powered off.

I did a little investigation, trying to locate the source of the slowdown,
and eventually I narrowed it down to the line:

register_shutdown_function('siteShutdown');

Commenting out that line made things run perfectly again (generates within
20-80 ms, depending on the page size). Uncomment it, and the page takes 3-4
seconds to generate. It does not generate piecemeal, either; it is blank
for several seconds, then in blink, the entire page arrives.

Has anyone got any ideas? What could cause this, and how could it suddenly
start happening, without me making any changes?

Sincerely,
-Josh


based on the experiences i've had with register_shutdown_function, it
seems that, while it makes the function you specify the last function
executed, it doesn't make it execute after the connection has been
closed. the work around to this that i used involved sending a whole
new http request, with fsocketopen and fputs, but never reading the
data. the script i would send the request to would check to see if
the originating ip address of the request was the same as the server's
ip address, among other things. not a particurarly pretty solution,
but whatever, heh.
Jul 17 '05 #2
Joshua Beall wrote:

register_shutdown_function('siteShutdown');

Commenting out that line made things run perfectly again (generates within
20-80 ms, depending on the page size). Uncomment it, and the page takes
3-4
seconds to generate. It does not generate piecemeal, either; it is blank
for several seconds, then in blink, the entire page arrives.


I use this function regularly without any problems - suggest U look at what
you are doing within function siteShutdown()

C.
Jul 17 '05 #3

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

Similar topics

1
2100
by: | last post by:
Hi all ! I am using register_shutdown_function. It behaves something strange. register_shutdown_function("f1"); register_shutdown_function("f2"); they fire in sequence f1
3
1762
by: Derek Battams | last post by:
I want to ensure that I'm releasing a lock on a file after _all_ objects have been destroyed. What I'm trying to do is use register_shutdown_function to call a function that releases the lock on...
1
2406
by: yawnmoth | last post by:
Say I have the following PHP script: <? register_shutdown_function('test'); ob_start(); echo "part2"; function test() { $output = ob_get_contents();
2
3596
by: alex bazan | last post by:
I came across this function as i got a problem with very long-running scripts which use transactions... in the php manual i do not see clearly stated if the function defined will be executed if...
1
1704
by: bw | last post by:
I have a basic custom collection that throws a new exception if the item(key) is not found in the collection. This is used as part of a calling function. It all works correctly, the problem...
6
1937
by: rishabhshrivastava | last post by:
Hello All, I am using ASP.NET 2.0 and I am experiencing a problem using vbscript that is this script on client side is preventing the postback of my controls. I have a dropdownlist which is...
3
14249
by: mthomsit | last post by:
Hi, I have a script which after a time shows the following error in IE: "A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become...
15
3227
by: Lawrence Krubner | last post by:
Does anything about this script look expensive, in terms of resources or execution time? This script dies after processing about 20 or 25 numbers, yet it leaves no errors in the error logs. This is...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.