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 from tocici (via BuildYourVPS). It's got 4 GB of RAM (2 GB of it "burst" RAM).

This server has some severe performance issues, however. First, a quick explanation of what this server runs:

  • Debian 5
  • Apache (generally up to date)
  • fcgi for PHP
  • mysqld
  • Some other trivial stuff that it runs
    • memcached, but...

The webserver mainly serves up MediaWiki. Caching is turned entirely off in MW's configuration; enabling memcached is actually slower somehow, even though memcached reports decent to great hit rates when enabled (60%, then rises to 90% over time).

The biggest chokehold that seems to be strangling my server's performance is just disk i/o. It's so bad that even a simple ls can take forever:

xkeeper@localhost:~/logs/wiki.rustedlogic.net$ time ls /root
.  ..  .aptitude  [...]
real    0m0.766s

xkeeper@localhost:~/logs/wiki.rustedlogic.net$ time ls /usr/
.  ..  bin  games  include  lib  local  sbin  share  src  X11R6
real    0m1.460s
user    0m0.000s
sys     0m0.004s

At some times it can get really bad, like this. It's gone further, but...

xkeeper@localhost:~$ time ls /etc/log 
ls: cannot access /etc/log: No such file or directory 

real 0m3.887s

The iowait can be so awful at times that even restarting mysqld will actually fail because it times out. (Attempting to /etc/init.d/mysqld restart again will work, though, usually much faster).

I'm at a loss for what to do next.

Here is a chart from Monit showing the CPU usage at this particular time (the drop at the right being when I restarted Apache and MySQL): monit cpu usage

The server isn't exactly choking on RAM, either. Trying to search for a way to increase caching (outside of increasing MySQL's key cache and other things) has proved mostly fruitless; even with outright doubling the cache sizes in MySQL it doesn't seem to have made much of an impact yet. monit RAM chart output

If you think it will help, you can also view the full stats page with rolling charts.

Running iostat:

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.00    0.00    0.00   99.18    0.00    0.82
          13.82    0.00    0.88  941878736.18    0.00  142.11
           0.69    0.00    0.69    6.21    0.00   92.41
share|improve this question
1  
you get what you pay for.... If this is a VPS how do you know that there are not another 400 customers all trying to use the resources that you are using. Get yourself a dedicated box and you'll see the difference. It will probably cost the same. (on the long run) –  The Unix Janitor Feb 4 '12 at 0:22
    
That's the plan in the future, but unfortunately the future is not now. I have to stop the flood before I can replace the pipes! –  Xkeeper Feb 4 '12 at 4:20
    
Your provider has probably oversold the capacity. Try a different provider and if possible ask him for system statistics. –  Sameer Feb 6 '12 at 15:00
    
I added a bit of iostat output to the question at the end. Inodes seem to be at ~12% use as well, so that doesn't seem to be a problem. –  Xkeeper Feb 7 '12 at 23:42
    
could you tell me why iowait is showing 99%.... –  The Unix Janitor Feb 8 '12 at 23:48
add comment

1 Answer

You're mostly out of options with regards to making the VPS perform better since you're sharing the system with many others (sounds like the days of mainframes are returning \o/ ).

I would say get a dedicated server, or at the very least make sure to choose a VPS provider who doesn't over utilize its servers.

share|improve this answer
    
Getting a dedicated server is definitely something in the pipeline, just a bit far off at the moment. –  Xkeeper Feb 7 '12 at 23:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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