Slow website load and high memory usage

apache-2.2high-loadmemorymemory usageperformance

my site has been slowed down last couple of days … some image doesn't show up … i got

408 Request Time-out: Server timeout waiting for the HTTP request from the client 

couple of times which never happened before .

i did a little performance checking , basically top command in ssh

this is the result

http://up.akstube.com/images/vdtebe9sr10si1eyycd.jpg

as you can see memory usage is very high … or i think it is .

i've rebooted the server … it wend down but after while it goes up again ….
(this is about an hour after reboot )

http://up.akstube.com/images/49xjeylxy0st7vwn4ojl.png

after half an hour =>

    top - 16:14:22 up  1:56,  2 users,  load average: 0.62, 0.90, 1.15
    Tasks: 303 total,   1 running, 302 sleeping,   0 stopped,   0 zombie
    Cpu(s):  8.0%us,  0.2%sy,  0.0%ni, 91.4%id,  0.0%wa,  0.0%hi,  0.3%si,  0.0%st
    Mem:  32840004k total, 21037648k used, 11802356k free,   430832k buffers
    Swap:  1050616k total,        0k used,  1050616k free, 16527108k cached

right now

[root@ns4008353 ~]# top
top - 16:33:25 up  2:15,  2 users,  load average: 0.88, 0.94, 0.98
Tasks: 303 total,   3 running, 300 sleeping,   0 stopped,   0 zombie
Cpu(s):  6.8%us,  0.2%sy,  0.0%ni, 92.8%id,  0.0%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:  32840004k total, 22388160k used, 10451844k free,   434964k buffers
Swap:  1050616k total,        0k used,  1050616k free, 17324104k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 7532 mysql     20   0 3750m 492m 5556 S 18.0  1.5  49:53.58 mysqld
12903 apache    20   0  232m  40m 4864 S 16.3  0.1   0:56.74 httpd
 7748 apache    20   0  235m  43m 5256 S 11.6  0.1   1:33.36 httpd
 8010 apache    20   0  262m  70m 4856 R  6.7  0.2   1:32.05 httpd
 7747 apache    20   0  235m  43m 5220 S  1.3  0.1   1:06.37 httpd
 7749 apache    20   0  222m  30m 5164 S  1.3  0.1   1:58.53 httpd
 7996 apache    20   0  250m  59m 5476 S  1.3  0.2   1:37.37 httpd
   10 root      20   0     0    0    0 S  0.3  0.0   0:09.72 rcu_sched
 7714 apache    20   0  265m  73m 4972 S  0.3  0.2   1:34.53 httpd
 7905 named     20   0  669m  24m 3020 S  0.3  0.1   0:02.01 named
 7999 apache    20   0  232m  40m 4968 S  0.3  0.1   1:17.67 httpd
20865 root      20   0     0    0    0 S  0.3  0.0   0:01.05 kworker/2:2
21491 root      20   0 15212 1308  852 S  0.3  0.0   0:01.38 top
23810 root      20   0 15212 1340  852 R  0.3  0.0   0:00.07 top
    1 root      20   0 19404 1568 1268 S  0.0  0.0   0:00.58 init
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd

free m

[root@ns4008353 ~]# free -m
             total       used       free     shared    buffers     cached
Mem:         32070      21897      10173          0        424      16955
-/+ buffers/cache:       4516      27553
Swap:         1025          0       1025

do you think this the reason of slow response ? is there any comment to get more info about what is using the memory ?


i have a dedicate server :

Processor Name  Intel(R) Xeon(R) CPU E3-1245 V2 @ 3.40GHz
Vendor ID   GenuineIntel
Processor Speed (MHz)   1600.000
Total Memory    32840004 kB
Free Memory 10416752 kB
Total Swap Memory   1050616 kB
Free Swap Memory    1050616 kB
System Uptime   0 Days, 2 Hours and 22 Minutes
Apache 2.2.24   Running
DirectAdmin 1.43.0  Running
Exim 4.76   Running
MySQL 5.5.31    Running
Named 9.8.2rc1  Running
ProFTPd 1.3.4d  Running
sshd    Running
dovecot 2.2.4   Running

Php 5.3.26 Installed

after looking in my log files i've seen lots of this error

[Sat Sep 28 00:15:41 2013] [error] [client 66.249.73.162] Request exceeded the limit of 10 internal redirects due to probable co
nfiguration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace

Best Answer

it's usually .htaccess file that re-injecting a changed request URI , check that out and also you can reset your config files