0

I recently moved to linode from a managed/autoscaled host.

MY site is extremely slow - unresponsive most of the time. I was on the 512 mb, 20gig storage, 200 gig transfer plan but upgraded thinking it might need more. Now I have a 712mb, 300 gig storage, 300 gig transfer.

My site is 1.5 GB in mysql and gets around 3k page views per day. I installed iotop and the picture below is what I got. I've seen mysql is eating up a lot.

Do you have any recommendations as to what I can do to keep my site up?

I am very new to server mgmt.

Thanks very much.enter image description here

1
  • 90% of the time it's an issue with too many httpd processes running. Check your Apache MPM settings (ServerLimit, MaxClients) and reduce the number. Also check # of PHP processes being used (if using FCGI).
    – rightstuff
    Apr 30, 2012 at 18:45

2 Answers 2

2

From the looks of your outputs the slowness issue may be due to high swap usage. Generally, you never want your server to ever have to use any (or much) swap space as it is vastly slower than RAM. If MySQL/Apache or whatever else you are running on the server is incorrectly configured it can very easily eat up more memory than it should be causing the swap to be used.

As a quick check you can use top and view process by memory usage (hit M) which should quickly show you which application(s) are using up the most memory. For MySQL you can use the MySQLTuner script to quickly tell you whether your configuration is using too much memory or not. For Apache you can probably reduce MaxClients really low (under 10) until you figure out memory usage in more detail.

Another possibility in addition to swap usage is that your MySQL queries use all or most of your 1.5GB of data. Since you only have ~500MB this causes the queries to hit the disk very hard which is exactly what your stats appear to show. The simplest solution would be to get more memory so that you can keep your entire working set in memory (this may be less than 1.5GB). Other possibilities include making sure the MySQL query cache is setup and working (assuming your queries are cacheable) or optimizing your application and queries to minimize using the entire database.

1

You mentioned that you now have 712MB of RAM for your server, but the output of free suggests that you only have 512MB. In any case, the "swap" number is considerably more than zero, which means you would benefit from more RAM.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .