VPS.net / Node Hosting

I recently moved this and many other websites (www.siouxfallscorvetteclub.com, www.raisesdtaxes.com etc) from the Media Temple Grid to a self pruned server at VPS.net. First and foremost: I hate administering my own box. I’m not a linux guru, so I’ve been spending way too much time reading and testing etc. I went with apache because, well, I didn’t want to dink with how re-writes worked (or didn’t work) with nginx. It’s faster and uses less resources, I get it… but… cmon! Apache is just too easy, it all works, re-writes pretty URL’s etc. So I’m running apache/ MySQL on Centos. VPS.net has been nice, they provide you some default images to get you up and going and it’s up to you to tailor your server to your needs. One major hurdle is apache tuning though: the image they hand out is scaled for a VERY big box, like, 6+nodes. My little 2 node box ran out of memory and everything got all choked up pretty quickly.  I learned two things quickly:

Always, always cache wordpress on high traffic sites.

And

Read and understand your apache config before you turn it loose.

My apache config was basically spawning so many workers that it ate up all my ram and anytime an SQL query had to be ran MySQL was like “oh shit…”.

So I present to you what works for me on a 2 node box. This will basically not allow apache to eat every last bit of ram. My sites maintained speed and stability while nailing them with loaded traffic. CPU usage was of course high (I spiked to a 8-15 node burst, depending on the traffic) but it didn’t over-run the ram available to me and dog down.


<IfModule prefork.c>
StartServers       2
MinSpareServers    1
MaxSpareServers   10
ServerLimit       24
MaxClients        24
MaxRequestsPerChild  1000
</IfModule>

<IfModule worker.c>
StartServers         2
MaxClients         100
MinSpareThreads     20
MaxSpareThreads     50
ThreadsPerChild     30
MaxRequestsPerChild 2000
</IfModule>

Because I’m no apache guru I’m always taking suggestions… Tell me why this is dumb and show me how to improve it!

Also: a brief display of speed change, this is with the same software loading the same items with the same cache:

# URL Average Median StdDev
1 web3.chrisuthe.com/ 1.20 1.20 0.10
2 web2.chrisuthe.com 0.40 0.39 0.03
3 web1.chrisuthe.com 0.37 0.38 0.02

25 hits @ .2 seconds between loads, web3 is the MT GS web2 was an nginx server and web1 is the current webserver (it’s been further tweaked but I’m not running identical software/sites anymore so I haven’t re-benchmarked out of fairness).