Does load balancing makes sense?

August 5, 2015 1.3k views
Server Optimization Load Balancing LEMP

I want to optimize setup for website performance(speed). My stack is: varnish,nginx,hhvm,mariadb

I currently have only 3k unique visitors per day so it's running very well on $5 droplet.

Would performance be any better/faster with setups from here:

I am thinking setup #2 or #4

Or am I already serving site the fastest way possible and these things only make sense when there is a lot more traffic :) ?


  • Setups #2 or #4 will require more maintenance so I would suggest resizing to a $10 Droplet for now.

  • The need for clustering at the web server layer, and database has definite performance, throughput increase benefits. Your overall capacity will go up. Since this is not your primary concern, the biggest reason you should do this (provided your budget allows for it), is to make sure there are no single points of failure.

    For instance, would it hurt a lot if your database crashed and you lost all the data?

    I run a minimum of this setup, and it costs me < $200 to do it per month. And its worth it.

    2 x Varnish Load Balancers ----> 2 x Nginx + PHP ---> 1x Haproxy ------> 3 x MariaDB+Galera Master-Master configuration.

    size of each instance is 2 cpu + 2GB = $20

    Total cost = $160

    Only single point of failure is at the haproxy. You could cluster there too if you choose.

    These days we are going towards more event driven architectures , but thats a different topic/thread.

  • @dubbtools How is traffic balanced between Varnish? Do you use two A records for the domain DNS?

Be the first one to answer this question.