NYCPHP Meetup

NYPHP.org

[nycphp-talk] Hmm, how to count 'online' users?

inforequest sm11szw02 at sneakemail.com
Wed Aug 11 21:15:21 EDT 2004


Of course you have to accept the latency.... at any given time it shows 
# people active as of a few minutes ago, because of uncleared yet 
no-longer-active sessions. Can be a problem if the community likes to 
see who is on and attempt to chat.....


-=john



Joseph Crawford Jr. jcrawford-at-codebowl.com |nyphp 04/2004| wrote:

>Better yet just count the files that are in your session save directory ;)
>
>i saw a tutorial i believe on weberdev.com for this use.
>oh and with PHP 5 you can use static properties so you could do it that way
>but it wouldnt decrement unless the person logged out, i think going with
>the session way is best.
>
>Joe Crawford Jr.
>
>
>----- Original Message ----- 
>From: "Mitch Pirtle" <mitchy at spacemonkeylabs.com>
>To: "NYPHP Talk" <talk at lists.nyphp.org>
>Sent: Wednesday, August 11, 2004 7:53 PM
>Subject: [nycphp-talk] Hmm, how to count 'online' users?
>
>
>  
>
>>Hey gang,
>>
>>I am building a site where you can see how many members are logged in
>>for each group.  After looking around, I see that this is being done by
>>forums, some CMS, and may even be integrated with PEAR's AUTH.  The site
>>uses ADOdb, and I am considering using ADOdb's session storage as it
>>also can run user defined functions when sessions expire.
>>
>>So I am also certain that there are several ways to tackle this
>>problem.  Knowing that performance and scalability is an absolute must,
>>what is the best approach?
>>
>>#1) In the accounts table, also have a column of 'logged_in', as a
>>boolean; and then count the 'true's for each group.
>>#2) Create a linked table, 'group_counts'; and store each account_id in
>>there while the session is still active
>>#3) ???
>>
>>This group is hot enough that I am certain some of you have come up with
>>very solid approaches to this problem - and I wanna hear them!
>>
>>-- Mitch
>>
>>_______________________________________________
>>New York PHP Talk
>>Supporting AMP Technology (Apache/MySQL/PHP)
>>http://lists.nyphp.org/mailman/listinfo/talk
>>http://www.newyorkphp.org
>>    
>>



More information about the talk mailing list