Re: Counting Online users, but not using a Session Table in MySQL

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

 



On Fri, Jan 28, 2011 at 11:03 AM, Marc Guay <marc.guay@xxxxxxxxx> wrote:

> If COUNTing is the heavy part, why not create a 'users_logged_in'
> field somewhere and increment it when someone logs in and decrement it
> when someone logs out?  Then your query is just a straight SELECT.


If this is like most web sites, users don't usually log out--they just stop
requesting pages. With no logout event to decrement the count you need some
other way to stop counting a particular user such as 30 minutes after they
logged in. This is easily handled in a query on the users table, but it
causes performance issues.

David

[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