On Thu, 6 Feb 2003, Magnus Manske wrote:
Jimmy Wales wrote:
If throwing hardware at the problem is likely to
help, I'll do it.
I'm trying to picture that in my mind ;-)
Seriously: Something that *might* help not only with that problem, but
would likely reduce server load (and thus, crashes in the first place)
would be to run apache and mysql on different servers. IIRC, this is
suggested by both apache and mysql online manuals.
If this is practicable, I fully support it.
Question is wether to
put mysql on the slower or the faster machine (assuming they're not
identical).
Put mysql on the fast one -- it's the database that's our big bad.
Some (third) machine could just mirror the apache
server machine and
jump in if the need arises (=apache machine crashes); it could even have
read-write access. Also, no need for up-to-the-minute backups etc.
We'd only get a problem if the mysql machine dies :-(
The apache machine is less likely to be a problem. My preference would be
something like:
* apache-only: Running apache, php script, image storage, TeX and other
incidentals
* mysql-only: MySQL with the database. That's about it. Maybe in the
future someday it could be postgresql-only. ;)
* backup: another machine running mysql as a slave to the main db
server, and maybe other stuff. Perhaps even apache for a read-
only web-accessible mirror. Takes a few gigs of space, but most
of the time it should be relatively low-traffic.
This backup machine would slurp in updates to the database, but would
still be runnable if no more updates come. New uploads could be copied
over occasionally. I'm uncertain what kind of granularity we can get with
MySQL's replication; can we leave out the user table (in whole or in part)
for instance? Not a big deal if it's just to another of Jimbo's machines,
but I'd be leery of shipping e-mail addresses and password hashes over the
internet to a third-party mirror site.
If we have a backup db and the main one failed (by crashing, by hard drive
failure, by act of god, or simply by getting overfull doing something and
screaming "TOO MANY CONNECTIONS!"), the main apache box could switch over
to use it and clamp into read-only mode. (This is much easier than
failover for the web server, which needs funky IP dealings or possibly a
very ugly DNS hack which is probably a bad idea.)
Notes; I'm not sure how much bandwidth would be required just for database
traffic, or for updates. I'll check into that tonight. If it's within an
internal network, it shouldn't be a problem.
I don't know if Jimbo can spare two machines, though. (Anyone care to make
a donation? Not a tax write-off as the foundation isn't set up yet,
but if you're addicted to Wikipedia and your time is valuable to you...)
-- brion vibber (brion @
pobox.com)