What setup do you recommend for future scaling

November 25, 2019 123 views
Server Optimization

Right now I’m a running single droplet :
4 vCPUs
8GB / 20GB Disk

It still feels like it’s struggling so I want to scale horizontally but also keep costs roughly around 60 a month.

But which setup is a good starter setup I can build on?

Here are my 2 noob options:

Option 1

droplet(lamp)
V

droplet(mysql
droplet(redis cache)

Option 2

Load balancer
V
droplet(lamp)
droplet(lamp)
V
droplet(mysql and redis)

My biggest problem with single droplet was MySQL swapping.
The server has a set amount of users it won’t grow much, like around 3000 max.

Does anyone have a similar setup ??

edited by bobbyiliev
1 Answer

Hi @bestschoolsmx

The setup really depends on your application.

If you have a lot of images you serve on your website, and the application is quite heavy as a whole, I mean like 10 MB of front page when loading, then I’ll recommend using one Apache/Nginx droplet with HaProxy for serving static files alongside maybe Redis and one tiny MySQL droplet.

If you however have an application which makes a lot of DB queries on every click, like big inner join queries from multiple tables, then I’ll recommend getting a bigger MySQL droplet to handle those as opposed to just one Apache/Nginx droplet.

It really depends on your application, you would know which is the heaviest part of it. Act upon that information and create the droplets based on your needs.

Hope, I’ve helped a bit on the issue!

Regards,
KDSys

Have another answer? Share your knowledge.