A few people have asked me what kind of infrastructure it takes to run Galleries and the rest of E-Hentai. My usual answer to this question is "it's too complex to explain" or "it would probably bore you, and it kinda is, and it probably will.
Buut, in order to satisfy those curious souls, I decided to put together a somewhat simplified overview of the system as it is right now. It wasn't exactly like this a month ago, and it probably won't be exactly like this a month from now, since stuff changes literally all the time, but at least you'll get
some indication of what we have running.
Since a picture says more than a thousand words - I made a chart!
[
g.ehgt.org]
*clicky*This is largely a logical view - some servers have more than one task. Not shown are the various offline backup systems that are there in case of total system failure, as well as some administrative stuff.
Soo, basically. Your request for a page enters through one of the four the reverse proxies that provide load balancing and automatic failover, and gets passed to one of the four primary web servers. They process your request, usually by drawing on a shared memory cache and the three database replicas. If you request an image, they look up an available H@H client, and if none is available at the moment, punt your request over to one of the six image servers.
The image servers are arranged in three sets of two servers each, where each set is located at different hosts. Every pair of servers in a set hold a full copy of the entire Galleries repository, arranged in a way so that if any one server goes down, its requests are divided between every other server in all other sets. So losing one server in Set 1 would divide its load in equal 25% shares to each server in Set 2 and Set 3.
Thumbnails are similarly arranged, but since they could be regenerated in case more than one set was lost, there are only two of them - one with two servers and one with four. These use simple DNS round-robin for load balancing and failover.
I could probably write fifty pages on the minute details of how this hangs together, but I'll skip that for now.
As for the actual server hardware that runs it - this is most of it, anyway. All the servers except four or five have some flavor of Intel Xeon CPU, but I can't be arsed to look up the specific model for each. A couple of servers don't directly participate in hosting the site, so they aren't listed.
1x: 16GB RAM, 4x 73GB 10k RPM SAS (HW RAID-10), 10 TB @ 100 Mbit
1x: 16GB RAM, 2x 73GB 15k RPM SAS (HW RAID-1), 4 TB @ 100 Mbit
2x: 4GB RAM, 4x 2TB disk, unmetered 100 Mbit
2x: 4GB RAM, 1x 1.5 TB disk (OS), 3x 3TB disk (SW RAID-5), unmetered 100Mbit
2x: 4GB RAM, 2x 500GB disk, unmetered 100 Mbit
2x: 16GB RAM, 12x 1TB disk (2x HW RAID-1 OS, two 5x HW RAID-5), unmetered 100 Mbit
1x: 4GB RAM, 2x 1TB disk (HW RAID-1, 10x 2TB disk (two 5x HW RAID-5), unmetered 100 Mbit
1x: 4GB RAM, 1x 1TB disk, 5x 2TB disk (SW RAID-5), 30 TB @ 1 Gbit
1x: 2GB RAM, 1x 250GB disk, 2 TB @ 100 Mbit
2x: 8GB RAM, 2x 32GB Intel X-25E SSD (RAID-1), 2x 160GB Intel X-25M SSD, unmetered 100 Mbit
1x: 16GB RAM, 1x 80GB Intel X-25M SSD, 5TB @ 100 Mbit
4x: 16GB RAM, 1x 300GB Intel 320 Series SSD, unmetered 100 Mbit
All those goodies, put together, cost about $56k USD per year to lease and host. And no, it's very unlikely that you could do it cheaper.
Finally, I grabbed a screenshot of my status overview page, which I use to get a quick look at the system - just in case you are curious. A few identifiers and stuff are redacted, to protect the innocent.
[
g.ehgt.org]
*clicky*The two "downed" servers are actually the two image servers I pulled offline earlier today. The dots and X'es on the top left are the heartbeat monitors for the image servers. Then, there are live bandwidth graphs for all the servers that come with it - the gaps aren't actual downtime, just times where the bandwidth measurements are unavailable. When you are familiar with the system, you can tell a whole lot about whether something is wrong or not just by looking at that.
I guess that's all for this time.
TL;DR: We have a bunch of servers. That's pretty much it.