[imp] Help Req. : Sizing a Horde\IMP system for 12,000 users

Andrew Morgan morgan at orst.edu
Tue Dec 10 00:47:43 PST 2002



On Mon, 9 Dec 2002, Christopher Crowley wrote:

> > >clue how many are logged in at a given time.  (Side topic: does
> > >anyone know an easy way to track the number of currently logged in
> > >users?)
>
> I would like to know this, too. I have tried counting the number of
> active (non-stale) files in the /tmp/session directory where session
> files are stored.  If you are using MySQL to manage sessions, you
> could do a DB query.

Well, I got interested enough to figure this out for myself.  It appears
that the string "s:3:"imp";b:1;" in the session data is sufficient to
determine if someone has an active session.  The main problem with just
looking at the number of rows in the session table (or number of files in
the session directory, if you are using file-based sessions) is that when
you logout of IMP, it destroys your old session but creates a new session
(we redirect to IMP's login.php page at logout).

The "stale" sessions from the login page look like:

prefs_cache|a:1:{s:7:"_filled";a:0:{}}horde_language|s:5:"en_US";

But an active session has the string "s:3:"imp";b:1;", among other things,
in it.

So a MySQL query of:

SELECT count(*) FROM `php_sessions` WHERE DATA like '%s:3:"imp";b:1;%'

returns the number of active sessions.


Right now, I've got 926 total sessions and 551 active sessions.  I'll have
to look when the servers are busy again to get a peak count.

	Andy



More information about the imp mailing list