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

all. I recently installed WordPress on a server of mine and ever since then my server has been acting very sporadic and becoming extremely slow-- sometimes even hitting a load average of 20!!

At first I thought maybe it was because of WordPress (since this began to happen almost immediately after I installed it), but I don't think WordPress could cause that kind of damage. The other thing is that I haven't even launched the site yet that's using WordPress, so it's not like there are even tons of people currently hitting it.

My server is a Rackspace server and its specs are quad core, and 256MB ram. It's running Apache, and currently besides this WordPress site, it is only running one other site which only gets about 250 hits a day. Whenever the load average starts getting really high, I run the "top" command and then sort by memory, and the top processes always seem to be httpd.

Additionally, the admin part of wordpress always seems to be SUPER slow, no matter how the server is doing overall.

I would really appreciate any help. I'm not exactly a server guy and this is driving me crazy! Thanks.

Here is the output of top when having a high load:

13894 apache 20 0 281m 27m 3152 S 0.0 11.4 0:02.06 httpd
13893 apache 20 0 287m 27m 3848 D 1.0 11.0 0:03.05 httpd
13980 apache 20 0 281m 26m 3128 D 2.0 11.0 0:01.94 httpd
13916 apache 20 0 285m 26m 3180 S 0.0 10.8 0:02.20 httpd
13897 apache 20 0 281m 25m 3008 S 0.0 10.3 0:02.53 httpd
13998 apache 20 0 281m 18m 3052 S 0.0 7.7 0:01.82 httpd
13987 apache 20 0 277m 17m 3196 D 1.0 7.0 0:01.75 httpd
13892 apache 20 0 284m 9372 3816 D 0.7 3.7 0:02.22 httpd
14006 apache 20 0 277m 9316 3176 D 1.7 3.7 0:00.78 httpd
13898 apache 20 0 282m 6348 3104 D 0.7 2.5 0:01.98 httpd
12971 mysql 20 0 487m 6164 2568 S 0.0 2.5 0:09.30 mysqld
13997 apache 20 0 283m 4688 3764 S 0.0 1.9 0:00.80 httpd
727 root 10 -10 12688 4452 3168 S 0.0 1.8 22:58.67 iscsid
14001 apache 20 0 283m 4200 3092 S 0.0 1.7 0:01.20 httpd
13896 apache 20 0 284m 3808 3388 S 0.0 1.5 0:02.59 httpd
13891 apache 20 0 282m 3548 2756 S 0.0 1.4 0:02.10 httpd
13996 apache 20 0 282m 3400 2844 S 0.0 1.4 0:01.94 httpd
13895 apache 20 0 282m 3352 2784 S 0.0 1.3 0:02.95 httpd

share|improve this question
    
Don't forget to accept the answer if it works for you! –  Jeff Ferland Oct 19 '11 at 13:31
    
Right! Sorry about that :) –  srchulo Oct 19 '11 at 20:02

1 Answer 1

up vote 3 down vote accepted

256 MB of RAM and Apache is the hog... I bet that you're causing a lot of swap activity as requests are handled by different instances of the daemon. I recommend using atop for an interactive view of memory, cpu, and disk / swap activity.

It's possible that MySQL doesn't have enough memory to work with as well -- if MySQL is configured to use a lot of memory but doesn't have it available then it may be using the oldest memory sections first which are swapped to disk.

share|improve this answer
    
hmm...it seems I do not have the atop command on my box. If it is the case that I am causing a lot of swap activity, how can I go about preventing this? –  srchulo Oct 19 '11 at 1:49
    
@srchulo Your options basically boil down to smaller memory footprint or larger server. You could run fewer Apache instances or configure MySQL for a low amount of memory usage. Other commonly installed software that will monitor IO usage includes iostat. Despite that, atop is part of most distributions, though rarely installed by default. If you've got root, I highly suggest adding it. –  Jeff Ferland Oct 19 '11 at 1:53
    
For running fewer Apache instances, would I configure that in httpd.conf? –  srchulo Oct 19 '11 at 3:00
    
I've added the output of top when the load was high, if that helps... –  srchulo Oct 19 '11 at 3:07
    
@srchulo I counted 215+MB of real memory used by Apache. Knock your MaxSpareServers and related options down in httpd.conf. Unless you're serving notable amounts of traffic, I bet you can get by with 3. –  Jeff Ferland Oct 19 '11 at 3:30

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.