What I have devised, and after some load testing appears to be working
is a mixed-bag method of solving this.
In effect, sessions are stored in the DB. When a returning user comes
to hte site, the session data is read from the DB and pushed into the
memcache. The memcache key is also stored in an 'active-sessions' DB
table. All proceeding session interaction with the user is then done
via memcache. When the user stops interacting with us, their session
data is returned to the database and removed from the memcache. This
return is done by polling the active session table and comparing
against data in the memcache, and can be run at a time when usage is
low.

You may want to look at gearman. It could handle the session writing in the background for you so that your page times would not be delayed.

Brian.

Reply via email to