Server problem(apache?)
Hello,I have this strange problem with my server, average bandwith is around 25Mpbs but sometimes it drops in 1 instance to 5Mbps and the site go very slow. And then after some hours without changing anything it goes back to normal, the sites load fast again.
Its a P4 2.8Ghz with 1024MB ram. Its running a big site with 50K+ uniques visitors/day, its a php/mysql site(small queries).
I also mailed the datacenter they say my server is connected via 1Gbps line to coreswitch so the network could not be the problem(they say)
Normally I have 350 processen en server load is around 1, cpu 7%.Example site on the server http://domainshuffle.com/ (maybe fast again when you view it.)
I tried restarting apache,mysql,whole server, cleaning tmp, looking for cron, did not changed anything.
I think its a problem with apache because when I want to view server-status it sometimes will not show(see output below).
I would really appreciate it if someone could help me.
Thx in advance
I will show some output when site are slow (at this moment).
Code:
top:
top - 20:45:24 up 5 days, 35 min, 2 users, load average: 0.36, 0.31, 0.33
Tasks: 167 total, 1 running, 137 sleeping, 0 stopped, 29 zombie
Cpu(s): 3.0% us, 4.2% sy, 0.0% ni, 88.5% id, 2.8% wa, 0.0% hi, 1.5% si
Mem: 1034492k total, 996636k used, 37856k free, 21292k buffers
Swap: 2096472k total, 61028k used, 2035444k free, 819480k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
18060 root 25 0 22868 13m 9792 S 2.3 1.3 2:45.60 httpd
8952 root 16 0 8648 2216 1792 S 0.3 0.2 0:01.22 sshd
15724 root 16 0 3736 992 748 R 0.3 0.1 0:00.01 top
15816 apache 25 0 0 0 0 Z 0.3 0.0 0:00.01 httpd <defunct>
15817 apache 23 0 23028 13m 9956 S 0.3 1.3 0:00.01 httpd
15823 apache 25 0 0 0 0 Z 0.3 0.0 0:00.01 httpd <defunct>
1 root 16 0 2644 452 420 S 0.0 0.0 0:00.80 init
2 root RT 0 0 0 0 S 0.0 0.0 0:00.35 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.88 ksoftirqd/0
4 root RT 0 0 0 0 S 0.0 0.0 0:00.36 migration/1
5 root 34 19 0 0 0 S 0.0 0.0 0:01.15 ksoftirqd/1
6 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 events/0
7 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 events/1
8 root 6 -10 0 0 0 S 0.0 0.0 0:00.00 khelper
9 root 15 -10 0 0 0 S 0.0 0.0 0:00.00 kacpid
29 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 kblockd/0
free -m
total used free shared buffers cached
Mem: 1010 986 24 0 20 814
-/+ buffers/cache: 151 859
Swap: 2047 59 1987
Sometimes when I want to view server-status I get this:
Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.
lynx: Can't access startfile http://localhost/server-status
And sometimes:
Server uptime: 5 minutes 47 seconds
Total accesses: 14 - Total Traffic: 411 kB
CPU Usage: u.34 s.04 cu0 cs0 - .11% CPU load
.0403 requests/sec - 1212 B/second - 29.4 kB/request
hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 3080 MB in 2.00 seconds = 1538.70 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device
Timing buffered disk reads: 148 MB in 3.00 seconds = 49.32 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device
httpd.conf: (I have run along time with this config dont think this it the problem)
Timeout 100
KeepAlive On
MaxKeepAliveRequests 150
KeepAliveTimeout 1
MinSpareServers 10
MaxSpareServers 22
StartServers 8
MaxClients 550
MaxRequestsPerChild 400

