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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux