avp387
By:
avp387

512 MB Droplet good enough for a 3000 pageviews / day WordPress blog?

May 10, 2014 4.7k views
Hello all, Recent DO customer here. My WordPress blog now runs on Ubuntu 14.04 LEMP stack with Varnish, APC, and W3 Total Cache. I am receiving about 3000 pageviews day. My RAM is about 90% full (I am using a 1 G swap). CPU is generally less than 10%. Only once did it go to 65%. My question is when and how do I know if my site has outgrown the 512 MB droplet and needs an upgraded server? Thanks for your help.
8 Answers
Hello!
You've 43M+17M+208M=268M (cache shows 270 M, the "same" as 268M) more than 50% available of your RAM :-)
You must think that Linux manages the memory in a different way, trying to use most of it including cache, like in your case.
I think you don't need to upgrade.
Best.
Hello!

Can you paste here the output from:

free -m

?

Best.
Here is the output:


total used free shared buffers cached
Mem: 490M 446M 43M 48M 17M 208M
-/+ buffers/cache: 220M 270M
Swap: 999M 63M 936M
Thanks for your input pablo.
When your server response times get too slow for your taste or when the server just stops responding because processes are being killed due to lack of memory, it's time to upgrade.
Just as sort of a gut feel, I can't imagine that 3000 page views a day would be too much for 512 MB. Even if those views are all concentrated into 12 hours a day, that's still only 250 per hour - a little over 4 per minute. That shouldn't be too taxing, even for something as processor intensive as a dynamic web site, especially if you're caching.
You might want to think about looking at your web server and PHP configurations - how many spare servers & processes you're spawning and how long they're kept alive, just to make sure that you're not spawning processes you don't really need. For my relatively low-traffic sites, I found the Apache, nginx and PHP (I'm using PHP-FPM with nginx) defaults were set a little bit high for what I needed. I freed up a fair bit of memory by tuning them down a little bit.
Thanks Larry. I am quite interested in this:

"You might want to think about looking at your web server and PHP configurations - how many spare servers & processes you're spawning and how long they're kept alive, just to make sure that you're not spawning processes you don't really need. For my relatively low-traffic sites, I found the Apache, nginx and PHP (I'm using PHP-FPM with nginx) defaults were set a little bit high for what I needed. I freed up a fair bit of memory by tuning them down a little bit."

Can you please suggest any guides on this? I have no clue where to start. Thanks again.

The best guides I can offer are the documentation sites and the configuration files, which are generally self-documented fairly well. Look through the settings and see if they make sense.
As an example, I think the default Apache setting for minimum spare servers is something like 5. So you've always got a minimum of 5 web server processes sitting there doing nothing but occupying memory at any given time. If you have a busy web site, that might make sense. But if you're only getting four visitors an hour, it probably doesn't, because it only takes a few seconds to spawn another server. I set my minimum spare servers to 2.
A tool to help you is the Apache benchmarking tool (http://httpd.apache.org/docs/2.2/programs/ab.html) which will give you a pretty good idea of how your server will respond to your configuration changes. In addition to the performance data that you get from ab, you can run 'top' in a terminal window while you run ab and see the load on the processor and watch how much memory gets swapped, and see if you're happy with that.
I am far from any kind of a learned expert on this stuff. Everything I know, I learned from reading the documentation, reading the config files, an occasional Google search (stackoverflow.com has a lot of answers on a lot of topics), and a lot of experimentation.

Yeah it's enough, your disk cache is hardly used around 63 megabytes, and 208 megabytes is cached and that's why 43 megabytes is remaining in RAM. Linux caches the frequently uses processes in order to speed up the their works, yet 43 megabytes remaining means, it's fine for the time being, but I would consider to upgrade to 1GB droplet when the number of users hit 5000/day, so technically 10,000/day is enough for a 1GB droplet depending on what the droplet is used for. of course this may not pertain to all the people as, the droplet may be used for various purposes. If it's just static contents, then it can handle even millions of users without any problem. So these numbers are only for your current setup, but when you keep adding more contents, when you install new plugins/packages, when you get more visitors the server may need more power to handle all the data.

Have another answer? Share your knowledge.