[imp] Re: [horde] Who is online?

Lord Apollyon implist at paypc.com
Sun Sep 7 22:04:44 PDT 2003


> We found that by removing things like "who's online"
> tracking information out of programs like phpnuke we get a good amount of
> CPU back under normal usages (300k hit's/day).

Let me guess, he's using mySQL.  mySQL is the Open Source Posterchild of the
Day, but it's not a very fast database when you start to really lean on it.
 One area of "lean" it's not good at handling is extensive UPDATE/INSERTs on
read-active tables.  Notice how many language constructs they've created to
try to minimise the inevitable - UPDATE DELAYED, PRIORITY, etc.

I suspect the problems are overindexing on write-intensive tables, and
mixing read-intensive columns with write-intensive columns within the same
table.  It's tempting for database managers to jack up the indexing, but
this is a disaster for write-heavy tables.  It's very costly to update a
table with numerous index tags.

I suspect if you append-only logged to a special table that's not in the
core read-hit area of the DB, and then you used daily "cleanup" operations
to expunge the really stale entries, and used indexing only on those columns
where it's really needed, not to mention, reducing the physical size of what
you're stashing there (stash UUIDs instead of full-text usernames for
example?), you might not see such a bad performance hit.

> So, in essence my short answer is don't do it but if you have to don't
> write it to a db and try not to write it to disk (shared memory being
> preferred over the rest).

If you're going to use "shared memory" may I strongly suggest *NOT* using
shmem/MM-library shared memory, but rather "tmpfs" filesystem backing-store
"shared memory".  Most OS's support it, and it's swappable to disk - rather
than the always-locked-into-core shmem() stuff.

It seems to have much fewer problems under high loads than using the MM
library does, and because it's a "real fs" - all of the usual locking
primitives work properly with it, er, as well as any locking primitives work
on your flavour of Unix.

=Apollyon=



More information about the imp mailing list