On Jan 4, 2007, at 5:13 PM, Sean P Quinlan wrote:
The way the new version is designed, a 'client' object will cache
the user objects (relatively small, name, email, phone etc) for
users previously authenticated, using a session token as a key.
Reading the document above, it seemed I would be able to create a
client object at startup, which could cache 'currently'
authenticated users (cleanup on the configured timeout), saving a
lot of database accesses. As yet I have not been able to test the
usefulness of this approach however as I can't seem to get off the
ground, getting tangled with errors in configuration.
you might want to re-think this approach entirely.
your user object cache will be per-apache child. that means if you
startup with a cache, and have 5 children, they all clone from that
cache. but when you start updating / editing the information, the
memory gets unshared. new users will be authenticating against your
db for each child they use too.
in other words, you're working your ass off for something that will
get you - at best - a marginal improvement.
what you need is some sort of shared system that can support multiple
apache children (and possibly servers. you might actually want a
cluster at some point)
some ideas:
a- screw db access concerns. use mysql to handle that sort of
access. i use postgres, and often do stuff like sessions, etc in
mysql -- its really fast on selects and where stability doesn't count.
b- cache your users in a daemon. stash your authenticated user data
in something like memcached, then just query that. its faster than
even mysql select, and super easy to implement.
// Jonathan Vanasco
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
| FindMeOn.com - The cure for Multiple Web Personality Disorder
| Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
| RoadSound.com - Tools For Bands, Stuff For Fans
| Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -