How do you determine the RAM needed in a VPS plan?


(Giulio) #1

How do you determine the amount of RAM that you need when you setup a hosting for a new website? Do you have any method to estimate it?
Let’s take two cases:
1- Membership website that will probably have no more than 10 people logged in at any moment and a cPanel installed.
2- ecommerce website with about 100 products and cPanel

The CMS is of course WordPress


(Leland Fiegel) #2

I’ve run multiple WordPress sites on a 512 MB RAM VPS at Digital Ocean for $5 / month.

However, cPanel complicates things. On their system requirements page they recommend a minimum of 1 GB, although the requirement is 512 MB RAM.

So in this case, I’d start with 1 GB each and see how it runs. I’d also recommend caching for non-members on the membership site, and caching for everyone on the ecommerce website (until they make it to checkout).

If you manage to take cPanel out of the equation and outsource stuff like transactional mail to a service like Mandrill (i.e. no email server installed on the server itself) you can probably get by with 512 MB RAM to start.


(Colm Troy) #3

I wouldn’t recommend anything less than 2GB with cpanel. While they have a 1GB min requirement, if you’re eCommerce site is running WooCommerce you’re not going to get much mileage with any of the main caching plugins given you’ll have a non cacheable cart/checkout process (and most likely a cart fragment on each page) so trust me you’ll need the extra RAM - particularly if it’s a cPanel managed server. If you can afford 4GB I would recommend that for a faster eCommerce experience. Better still, consider not using cPanel at all for the eCommerce site at least and roll your own nginx/PHP-FPM based machine on Digital Ocean or Linode or if you don’t want to do your own sysadmin/devops go with a managed WordPress service - check out a reasonably recent performance showdown here http://reviewsignal.com/blog/2014/11/03/wordpress-hosting-performance-benchmarks-november-2014/ (I’m not affiliated with reviewsignal but they do awesome and meticulous WordPress hosting performance reviews)

The membership site will probably be fine on cPanel but really do think about treating the eCommerce site as a completely different kind of beast - particularly if you expect any kind of decent traffic coming to it - the extra cost will pay for itself quite quickly with orders :smile:


#4

Services like Digital Ocean are great, bc. you pay as you go. So you can play with it, you pay nothing in front, no any contract.
I use it via managed service Cloudways and I m satisfied, flexible. I don’t have to care much about source … I have monitoring and if see that web eat a lot, just change higher server with few clicks.

I think there is more managed solutions which are so flexible, so it is not necessary to think so much in advance, bc. you can change source easily… I don’t mean that kind of managed WordPress hostings who put so many limitation to plugins, cache, database …

Hoe leland mentioned Digital Ocean is really amazing from my perspective, anyways with my knowledge about servers its better to use some kind of managed service. (security, performance, stability, troubleshooting)

Anyway about RAM, I run even two websites on 512mb, but its bc. these sides are not my priorities, but if I start some new project I do it on 1gb and then move up if its necessary.
Also bc. installed stack and other software its probably better to run more sites on one bigger server than every site on one small server.


(Darren) #5

Traffic is another factor - specifically concurrent traffic which is the number of visitors (logged in members, non members & bots). I don’t have any relevant stats on this, but how many visitors do you expect to have?
Regardless of amount of RAM you go with - I believe CPanel is a waste of time if you’re using a VPS, it abstracts the lower workings of your server which is useful initially… But this apparent benifet is also a weakess! As you don’t need to spend as much time learning Linux administration, which you still need to learn despite using cpanel.


(Brian Ross) #6

Determining RAM is just the beginning. Tweaking all the config files to use that RAM is where the real fun begins. :frowning:


(Giulio) #7

Hi @darren thank you for your answer, it is very interesting. I don’t have any figure for #2 because I added that to have a better overall picture of the problem.

For #1, that is a real website, and it’s in fact having tons of problems. It used to be on a shared hosting without any problems but the owner wanted a better hosting to support future growth. Now the website is on a VPS with 2GB RAM and it’s crashing even with 5-6 people logged in. The hosting support put the blame on the RAM memory which is not enough according to them. I don’t believe them but I don’t know how to estimate the amount of memory that I need. A single session consumes about 100MB but if I do the math a website with just 100 concurrent visitors would need an insane amount of memory. Something is wrong in my reasoning but I don’t have enough experience on this topic to nail down the problem.

I suggested the owner to move to a managed WP plan with another company


(Giulio) #8

@est73 do you have any resource to point me to where I can learn that?


(Brian Ross) #9

No, still trying to piece that info together that right now for a project I’m working on. :smile:


(Darren) #10

There must be something severely wrong with your configuration if only a few users are crashing you site.
Is this with cpanel?

What server are you running? I.e. Apache. Even default configuration would easily manage better!

Have you any server logs available or analytics?

Im traveling at the moment but I’ll check intermittently.


(Giulio) #11

The website’s migration from the old hosting was entirely managed by the new provider’s staff, and I didn’t touch anything. I must also say that I have an access level to the server that is the same of a shared hosting, so even with all the worst intentions I couldn’t screw up the configuration. That is a reputable UK company, so I trusted their expertise even if it was the client that found them and decided to go with them. When it took one whole week to fix a couple of permission problems that prevented me from updating plugins from inside WP and connect through ftp I started having a few doubts about their expertise. Now, I think that they are totally incompetent.

There is cPanel and Apache. One week ago they claimed that they tweaked their server to use less resources and added Nginx caching to keep some load off Apache. However, this didn’t help at all. Since I don’t have root access I can’t even do anything here.
The client is moving to Siteground next week end so hopefully everything will be fine but I was curious to understand what can be the cause of all these problems

The error log shows only one non significant error two days ago. Which is even more strange, given how many times it has crashed.


(Darren) #12

Ah the envitable client picking services! Well at least the issue should be solved once you move host.

Caching wouldn’t help a site crashing with so visitors, there’s definitely an issue there they don’t understand.

Its more than likely not a problem that would produce an error in logs. I’ll chance a guess though!

As a sidenote, I’ve started building a load testing application as part or my final year prowcr in university, and while its not for WordPress I may end up adapting it to handle websites - specifically WordPress. This is something that would answer exactly what you’re asking!


(Giulio) #13

That is interesting @darren, keep me updated about your project, I think that it would be useful to a lot of people.

It was important for me to get a better understanding of the problem even if everything will be fixed by moving to a new hosting. I realize that without having root access to the server it is next to impossible. Thank you for your help and the time spent reading my crazy reports :smile:


(Benjamin Intal) #14

Here’s what I did in my scenario.

I had an existing site that constantly went down, it was in a shared hosting server. The site holds all our demonstration websites for around 12 WordPress plugins, so there’s a lot of traffic and the load is sometimes heavy. I’m with DreamHost and when I did was I transferred over the site into a VPS hosting provided by them. Luckily they have a free trial. What’s good about the trial is that during this one week trial, they’ll set your RAM to a high setting, 2Gb I think for a week. After that they’ll adjust it down depending on your usage stats. Mine went down to 450Mb RAM which isn’t so bad.

I then got a Pingdom Tools account that monitors the site every minute for response times. At 450Mb, I encountered down times 1-5 minutes long during peak hours. So I gradually increased the RAM until I didn’t have down times anymore. I think I ended up with 750Mb RAM.

Transferring the databases also into a VPS helped further bring down the load. They also had that same free week trial scheme so they also adjusted the memory depending on the traffic’s needs.

So I guess my suggestion would be to use Pingdom Tools for monitoring the site. If you get downtimes, increase the ram. It’s a little trial and errorish, but it worked for me :smile:


(Giulio) #15

Thanks @bfintal that is definitely a great suggestion. I don’t think that there’s any possibility on the new managed WP hosting to adjust the RAM, it should be optimized automatically or it wouldn’t be called ‘managed’.

I’ve saved your post in my Evernote for future reference, I’m sure I will use it


(Benjamin Intal) #16

@daprela No problem! I forgot to mention, I lowered the VPS server ram since the load seemed to go down once I got the database into a VPS also.

One last thing, the code running has a ton to do with it also. I did a ton of optimizations for my plugins to make it smoother.

In the end, I guess my real suggestion is to use Pingdom for feedback. Here’s a screenshot of my uptime report. As you can see, I had a TON of downtimes before. The response time is still not superb, so I guess I still have some optimizations to perform :smile:


(Giulio) #17

The improvement is really impressive. The response time could probably be better but it takes time to understand what really makes the difference. It is a matter of trial and error