On Wed, 2003-03-05 at 16:15, Rasmus Lerdorf wrote:
> > Hello all, I have 2 questions that have come up because I have several
> > long reports that can take 1-2 minutes to run.  These are run from any
> > web client thru our linux -> apache -> php -> mysql system.
> > 
> > 1)server keeps working after client disconnects
> > If a php script is running and it may take 1-3 minutes, and I hit escape
> > or close my web browser window, the script keeps running.  I can see it
> > in top, consuming lots of cpu and sometimes ram.  Why doesn't apache and
> > the php4.so notice the closed tcp connection and abort the script?  Is
> > there a way to make this happen?
> 
> Yes, this happens by default, but we can only catch it if we try to write 
> something to the socket and get an error back.  If you are processing and 
> not outputting anything, there is no way for us to tell.  If you are able 
> to write out some sort of progress indicator during your processing then 
> it would work.
> 
I am actually looping in the php code:
while(!done)
{
 mysql query
 send some data to the client to see
}

So this output should trigger the detection that the socket closed?

I will try some flushes and make sure it is not caching it till the end
later. (but I see the data appear in my browser over the whole 1-3
minutes, so I think it is sending right away)

> > 2)session_start() blocks 
> 
> This sounds odd.  session_start() should not be blocking.  What sort of 
> backend datastore are you using for your sessions?
> 
I just saw someone else post about the same thing!
I am just letting it stick directories in /tmp for each session.

Thanks!
Any more ideas?
Mike

-- 
Michael Kedl <[EMAIL PROTECTED]>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to