NYCPHP Meetup

NYPHP.org

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

Mitch Pirtle mitchy at spacemonkeylabs.com
Wed Aug 11 19:53:53 EDT 2004


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




More information about the talk mailing list