Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a VPS with 512MB of ram 40GB storage 1CPU, I run a small domain parking service on it.

It is on CentOS, MySQL, Apache, etc.

Now my hosting provider claims that my server is putting too much load on their storage system and they had to reset my instance, and asks me to optimize the server because it is slowing down other clients on the storage.

The total domain's files (www folder) is under 100MB !

I am looking around and I cannot see what can cause this "storage abuse", they said it is the virtual memory that is written on their storage, few hundreds MB.

  1. Isn't this use normal as shown in the webmin screen ?
  2. Does it indicate any problem in the attached "top" command? (e.g the 772MB virtual memory of mysqld).

The only overload that I am aware of is a php script that runs once an hour to process all domain statistics, takes 3 minutes to complete and seems to put the CPU to work :)

Edit: I added a second screen of top command showing the missing data above the processes list.

memory usage shown in Webmin

top command output

top command output 2

share|improve this question

closed as off topic by MDMarra, Frands Hansen, Ward, mdpc, Jenny D Apr 12 '13 at 6:48

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

3  
Switch to a new hosting provider. Your current provider doesn't know what they are talking about. –  Matt Apr 11 '13 at 20:51
1  
Have you considered using a combination of nice and ionice to prevent your VPS being stressed for three minutes every hour? The output you've shown from the top command is missing the load average stats from the top right, which would be useful. Also, your provider reset your VPS? I'd be changing provider. –  Bryan Apr 11 '13 at 20:52
3  
Hosting providers shouldn't be resetting any ones instance willy nilly. That's just ludicrous. –  Matt Apr 11 '13 at 20:54
    
Bryan, I updated the screens, included a second one. I am not familiar with nice/ionice, I will look. Matt, they did apologize for resetting my instance but they do ask me to optimize the server :/ Oh, or buy a more expensive service from them :) –  adrianTNT Apr 11 '13 at 20:56
    
Ask the ISP to provide you with a graph/report showing the 'storage' problem. Then have them tell you what they think is a acceptable level. When people complain about storage, they are talking about I/O usually, not RAM, or size of the space used. –  Zoredache Apr 11 '13 at 21:03

3 Answers 3

This is just a guess, but it's too long for a comment, so here goes.

With virtual private servers, you get a "slice" of a real server. Rather than spending, say, $500 each on 24 small servers with 512MB ram etc, it's cheaper to buy (and operate) one $3500 server with 12GB RAM and two six-core hyperthreaded cpus.

Here's the trick: that server might sell more than 24 slices. This is fine, to a point: they don't expect everyone to use all their resources all the time. If you have enough of these, you can profile your clients and silently move customers to configurations where you're pretty sure they won't step on each other's toes — at least under normal circumstances. Again, this is normal practice and there's nothing wrong with it, as long as it's done carefully. There is a potential for abnormal workload to cause problems, but that's part of what makes this a cost-effective option; if you want a service where this isn't possible, you pay more for a service such as leased physical server in colo space.

Now for my guess. What happens when they oversubscribe a server too far? Someone gets left holding the short end of the stick, and only has virtual resources. Their "RAM" is actually entirely disk-backed, and must be swapped back and forth. Normally this is spread among all the machines, but in the right situations one of them can be left out in the cold. That's you. From their point of view your machine is doing weird things. It looks to them in their monitoring tools like you're the villain, when really you're the victim. A good provider would recognize this, but a good provider would also tell you before they reset your instance.

share|improve this answer
3  
And to sum this up: They suck, get another provider asap. –  Tonny Apr 11 '13 at 21:56
    
I just wanted to add here that NO VPS PROVIDER should be asking you to reduce the amount of resources you are using. That is BS. This means they are advertising (and allocating) a certain set of resources per VPS, but then actually enforcing a completely different set of resources. That is false advertising, and it's unfortunately common in the generally awful VPS hosting industry. If you ever hear your hosting provider say this, get rid of them IMMEDIATELY. Unfortunately this provider is yet another awful, slimeball VPS provider in an industry flush with awful, slimeball VPS providers. –  L0j1k Oct 1 at 21:59

Take a look at the virt field in the output of your top command.Your VPS has 512MB of memory, yet apache is demanding far mare memory, which probably explains why you've got 4GB of virtual memory. With all those apache threads, virtual memory is going to be swapping constantly, which is causing the high IO.

Why is apache consuming so much memory? Check the apache logs first of all, and see if you can spot anything unusual going on. If you find anything, report back, including samples and maybe we can provide more specific help.

Could it be your PHP scripts to build stats aren't properly terminating, however I assume you've got your PHP maximum execution time set to something sensible to prevent your scripts going runaway?

Restart apache, and monitor memory usage, how long does it take before it start consuming lots and lots of swap space? Judging by your uptime of around 7 hours, not very long.

I don't know the details of your PHP site, but I'd imagine a simple domain parking site shouldn't be using too many resources. I've a VPS that we use in our company, it runs an internally developed app with a MySQL backend, which is fairly heavily utilised by around 30 staff each day, and it doesn't consume nearly as much memory as what your's is.

Judging by the load average, your CPU is being fairly heavily used, but that is likely just because of the swapping going on. Sort out the problem with Apache consuming so much memory and I'm sure things will start to look a lot better.

Also, change your host, they shouldn't be resetting your instance without warning. That's inexcusable.

share|improve this answer

Your httpd processes are using up more RAM than you physically have available, thus something has to get swapped. (It's also interesting that in the screenshot showing this, you cut off the top, and that you restarted Apache before taking the second screenshot. What are you hiding?) You need to reduce the system's memory usage dramatically, most likely by reducing the number of simultaneous httpd processes, or get more RAM.

That said, the host should be rate limiting this sort of thing already, which is not too difficult; perhaps they just don't know how? When you decide to get more RAM (you will), get a new host as well.

share|improve this answer
    
Don't be paranoid, might be true that I used too much memory but it doesn't mean I am hiding something, geez. I am not that familiar with top, I didn't realize I posted a partial screen at first, Bryan mentioned it so I posted a second screen, services were restarted because I was constantly making tests and changes. Anyway, I tested with iotop and was able to find some things, I will post an answer once it's more clear for me. –  adrianTNT Apr 12 '13 at 10:26

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