I recently moved my site from a shared hosting to a VPS.

When it was in the shared hosting, actually nothing went wrong, but now, the VPS server became unresponsive 4 times in 2 weeks (and I need to reboot it).

I thought VPS would be more stable and could handle more traffic, how come my previous shared hosting seems better in my case?

When the VPS becomes unresponsive, I mean I can ping it, but I cannot ssh into it, and the worse part is that the web pages cannot be loaded. Nothing wrong shows in /var/log/message. I don't know the real cause for this problem, but I guess it's the amount of traffic?

My VPS is configured with 2 CPU with 4GB RAM in CentOS. According to the host, the VPS machine is Dell & Supermicro E5-2600 (6 cores CPUx2) with 128G RAM & SAS 15k RPM+RAID6 HD. And my site has 4000-6000 page views per day in average. I don't know why the shared hosting can handle it well but the VPS can't.

How to decide if current VPS problem is due to the traffic? Is something wrong with the VPS provider? Or the hardware is not good enough to handle such "medium" traffic? How to determine the hardware/configuration of a VPS to handle the traffic I am having (and to handle the future traffic I am expecting, which might have a jump because of my coming service release).

Any thoughts or experience sharing are appreciated. Thanks.

closed as primarily opinion-based by Ƭᴇcʜιᴇ007, Mokubai, Dave M, nc4pk, Simon Sheehan Oct 17 '13 at 0:30

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Hi Joe, what did your VPS provider say when you raised this with them? – Paul Oct 16 '13 at 4:27
  • Hi Paul, the provider said VPS is to be managed totally by me. They can't do anything about it. – Joe Huang Oct 16 '13 at 4:49
  • Hi Joe, you are responsible for managing the VPS itself, but not the host server or network. If the server is otherwise behaving, but network traffic does not get through, it could just as well be a network or host issue. Do they provide console access - ie a way to get to the server console without ssh? – Paul Oct 16 '13 at 5:04
  • Hi Paul. I asked them how to debug the server down, they said I can use VPN to log in and see what happens. I was wondering if I can't ssh when the server is not responsive, does VPN work? I didn't have a chance to try the VPN because I wanted to reboot as soon as I found the server is down. I guess the VPN is another hardware so it's independent from the server's process and network? – Joe Huang Oct 16 '13 at 8:41

The problem is very unlikely to be bandwidth related. Its much more likely to be a resource problem (for example heavy database queries) or a hardware problem (for example disk bottlenecking). It could also be a combination of "the VPS neighbourhood" and the VM platform. For example, KVM provides better virtualization then Virtuoso (look at Virtualization vs paravirtualization). If your provider is providing a VPS using paravirtualization the problem is more likely to be somewhere else.

The way to resolve the problem is to "stress test" the various components of the connection, starting with the hard disk. Also run things like vmstat to get a feel for whats bottlenecking.

Its also possible the problem is a memory issue. If everything is working fine and then suddenly things go unuseably slow, this is likely the cause. You can mitigate this to some extent by reducing "swappiness", and by tuning your databases. Also reducing the size of your swap file.

  • Thanks for your reply. I think the provider uses KVM (seen from the VPS console). When the problem happened, things were not just getting slow. The server became weird. For example, I saw the server was unresponsive at 6am and from some evidence (I get periodical emails from the server), it was down since 12:30am. During this period, they were supposed to be the quietest hours, but the server didn't recover at 6am. It still could be pinged, but no webpages could be loaded. I couldn't ssh into it either. – Joe Huang Oct 16 '13 at 8:47
  • @JoeHuang Perhaps it is running out of ram. Some VPS providers don't set up swap in their images, and if it runs out of memory, the out-of-memory manager will start ending processes, somewhat randomly. ssh could have been killed, along with the web server, which would explain why you could still ping. Get into the vpn kvm and dmesg – Paul Oct 16 '13 at 13:22
  • @davidgo Is there a way to know if last incident is due to running out of ram? There is no timestamps in dmesg, I do see the last few lines showing "Out of memory: Kill process 1720 (mysqld) score 204 or sacrifice child"... how to know at what time it happened? – Joe Huang Oct 17 '13 at 1:30
  • @Joe Huang You probably don't know, but the symptoms you described, and the message exactly match what you would expect if your system runs out of memory. It also looks like the problem might have been mysql (maybe), so you may want to try tuning or constraining the amount of memory bit can access. Also - but I'd advise against it generally , you might want to setup a SMALL SWAP File so some infrequently used prongs (like Gettys) can swap to disk, but its a double edge sword-and should be used sparingly and with VM.swappiness. – davidgo Oct 17 '13 at 7:44
  • @davidgo sure, thanks for your suggestions. At the mean time, I am also wondering why the VPS cannot handle the traffic but my previous shared hosting could. The shared hosting actually has better hardware configuration? Maybe I should just move it back to the shared hosting! :) – Joe Huang Oct 17 '13 at 8:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.