Which size of droplet should i use for my web-site?

January 23, 2014 2.1k views
Hello there, I have a question for you, actually i need help. I have a web-site, which had 61.360 unique visitors and 1.307.283 page views in December 2013. For this web-site i have been using second plan of droplet on DigitalOcean which is 1 GB ram/1 cpu. But in january my hits increased %10 rate, so my web-site slowed down little bit. Here is my question, can i solve that problem some server-side coding or do i have to increase/resize my droplet's size. Sorry for bad english, thanks for understanding.
5 Answers
I would try first inspect your Droplet's CPU and memory usage. Try using htop - an interactive process viewer for Linux.

So you can find out if you're running out of memory (causing swap) or too much CPU processing (and what is using that resources).

I run top command from shell. Here's the i got;

[root@s ~]# top
top - 12:45:50 up 1 day, 5:31, 1 user, load average: 5.34, 5.40, 5.58
Mem: 1020388k total, 880792k used, 139596k free, 61336k buffers
Swap: 0k total, 0k used, 0k free, 413648k cached

20437 mysql 20 0 1048m 189m 7232 S 73.2 19.1 704:47.40 mysqld
6701 apache 20 0 510m 20m 9236 S 1.3 2.0 0:00.26 httpd
1139 admin 20 0 509m 21m 10m S 1.0 2.1 0:02.30 httpd
4008 apache 20 0 508m 20m 10m S 1.0 2.0 0:01.31 httpd
Looks like there's quite a bit of load on the CPU. Try upgrading to a plan with more CPUs—does that help?
Looks like most of CPU usage is from MySQL. From this point you can consider analyzing which queries are taking too much time to run. Also, you can migrate just MySQL to another, larger server (you will get more CPU cores for the price).
Have another answer? Share your knowledge.