Recommended VPS Complete list of best VPS hosting providers.

ServerMom’s New Server Setup v2

It’s been more than a year since me last server setup which I used combination of LiteSpeed-powered shared hosting, 1 web server on Ramnode VPS, 1 MySQL server and 1 Varnish server (load balancing) – see my old server setup here. Recently I decided to change my old server setup with the new one. What’s my reason behind the change?

Firstly because my shared hosting account at Crocweb has expired and it is too pricy to extend. Secondly, I’ve been so lucky because that the founder of Atlantic.net contacted me with special offer allowing me to host my blog in their cloud infrastructure. Thirdly, I just want to try different server setup.

So here is my new server setup which I currently use to run Servermom.org:

  1. Atlantic.net 4GB Cloud VPS to host all web files and MySQL database.
  2. Atlantic.net 512MB RAM Cloud VPS to run Varnish Cache server.
  3. Ramnode 512MB RAM OVZ VPS to Backup all web files
  4. Ramnode 256MB RAM OVZ VPS as MySQL Slave

Server Specifications:

  1. 4GB RAM + 2 vCPU + 100GB SSD + 5TB bandwidth on KVM cloud (New York City)
  2. 512MB RAM + 1 vCPU + 20GB SSD + 2TB bandwidth on KVM Cloud (New York City)
  3. 512MB RAM + 2 Cores CPU + 50GB SSD + 2TB bandwidth on OpenVZ (Atlanta)
  4. 256MB RAM + 1 Core CPU + 25Gb SSD + 1TB bandwidth om OpenVZ (Atlanta)

Technology used:

  1. CentOS 6.6 64-bit running full Vesta CP stack (LAMP plus Nginx frontend proxy minus DNS server / named)
  2. CentOS 6.6 32-bit running Varnish Cache server v3.0.7 (release date 23 March, 2015)
  3. CentOS 6.6 32-bit running Apache and PHP5. File syncing with rSync.
  4. CentOS 6.6 32-bit running MySQL server

Short of explanation:

Initially I just want to use single server which is the 4GB RAM cloud VPS from Atlantic.net but then I got downtime about 3 minutes. That was expected down time though. Atlantic.net contacted days before it happens and it’s not caused by the server itself but their upstream service providers were performing maintenance on their circuits.

While every effort will be made to minimize any interruption in service, customers may experience a 2-5 minute network service interruption during BGP re-convergence

So I decided to replicate my server to RamNode when in case the downtime is more than expected I can still minimize the downtime by switching my A record to RamNode. So then came the downtime which was not more than 3 minutes.

Few days after that (it’s yesterday exactly), NixStats told me that CPU load on my main server (the one with 4GB RAM and 2 vCPU) is rising high.

cpu-usage-alert

Here’s the statistic of that time:

cpu-usage

load-average

ram-usage

2015-06-25_124517

As what we can see above, while the CPU usage is going high (because httpd process) and so the Network I/O. The weird thing is the number of real visitors were not increasing. So I believed it was someone being so jobless to play around with my server. I didn’t have time to check whether it’s a DOS, DDOS, SYN Floods, or HTTP Floods attack. What I did remember that is in such situation (light attack) Varnish will come in handy. So I installed Varnish and put it running in very front of my Vesta CP server.

Shortly my server configuration as below:

Visitors -> Cloudflare (DNS) -> Varnish -> Nginx -> Apache + PHP + MySQL.

The result, CPU Load on my Vesta CP server is now normal (from 5.0 4.8 4.5 to 0.8 1.0 0.9)

You can view all my servers’ performance at:
http://uptime.servermom.org/

Conclusion: I think Varnish is really effective to reduce high CPU load. This time I simply use it as frontend caching not load balancing.

Some interesting articles being my consideration in using Varnish:

  1. The penultimate guide to stopping a DDoS attack (Unixy blog)
  2. How to block rate-limited traffic with Varnish (Dan Singerman blog)
  3. Withstanding DDOS attacks with Varnish (Varnish blog)
  4. Good steps to survive from denial-of-service / DOS attack (Stack Exchange)
  5. Me and Varnish against DOS attack (homeofficekernel @ blogspot)

How to setup all of those? I already wrote all the tutorial needed:

  1. How to install Vesta CP on CentOS
  2. How to setup MySQL Master-Slave Replication
  3. How to setup rSync and configuration
  4. How to Install Varnish Cache server

Any comment? Do not hesitate to drop comment regarding my current server setup. Or if you found any glitch, bug or problem while accessing this blog, I really appreciate if you can tell me. Thanks.

9 Comments

Add a Comment

Your email address will not be published. Required fields are marked *

Get more stuff like this
in your inbox

Subscribe and get interesting stuff plus faster updates to your email.