Re: Re: Clone of the concurrent users limit of Zend Encoder 4.0 ?

From: Date: Sat, 11 Feb 2006 21:16:43 +0000
Subject: Re: Re: Clone of the concurrent users limit of Zend Encoder 4.0 ?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-230259@lists.php.net to get a copy of this message
On Sat, Feb 11, 2006 at 12:48:50PM +0800, HoWang Wang wrote: > HoWang Wang wrote: > > Hi all, > > > > The Zend Encoder 4.0 (beta) have a new function in the license manager > > which can limit the number of concurrent users. I have wriiten something > > to work like it. But I found a problem. My script can limit the number > > of concurrent running script only. When the script ends, there is some > > data remain in the buffer (of Apache, I think) and the client connection > > is still active! How can I solve this? Please help, Thanks. > > > > Regards > > Is it really impossible? Can I do it with Connection Handling? It is really unclear on exactly what you are doing and i have no clue what data is remaining in what buffer you think might be the problem. > <?php > set_time_limit(0); > ignore_user_abort(true); > // add 1 to the number of concurrent users > // the rest of code > while (!connection_aborted()) { > // keep on locking > } else { > // release lock > } > ?> You really dont want to do this. By doing that while loop, you will do a couple of bad things: - eating up a lot of CPU usage, of course a sleep in the loop would probably prevent cpu abuse but still not the ideal way to do it. - You will most likely run out of available slots that http has available. Curt. -- cat .signature: No such file or directory

« previous php.general (#230259) next »