I hacked up a session data handler to optionally keep login session
data in memcached rather than the local filesystem. Combined with a
change to the cookie settings, the English Wikipedia login sessions can
now be shared between
en.wikipedia.org on larousse and
en2.wikipedia.org on pliny, without having to separately log in on each
server.
This makes it not too painful to use a rewrite rule for simple load
balancing, bouncing some portion of the page space to en and some
portion to en2. Yay!
There may still be some issues dealing with uploaded files, but
disabling uploads on en2, ensuring that Special:Upload is redirected to
en, and that all /upload/* files get loaded off en, should keep things
pretty consistent for the meantime.
Potential problems:
* Memcached is designed to be 'lossy'; if it fills up it throws away
the least recently used data to make room for new data. This shouldn't
be a problem for session handling, hopefully; they're set to expire
after an hour of non-usage anyway.
* Expiration times haven't been thoroughly tested yet.
* There's currently no failsafe; if memcached dies, the session data
falls into a black hole and no one can log in. (Except perhaps if they
click 'remember my password'.) It should be possible to check that it
couldn't contact the server and fall back to local storage, or the
database, or something.
-- brion vibber (brion @
pobox.com)