我有一个带有 4gb 内存的 VSP(centos6.1 64bit)。
它总是运行良好,但最近几天,服务器变慢了。打开一个小的 css 文件需要 22 秒(2kb)。在家庭/办公室/手机中使用(IE、chrome、safari、firefox)进行了测试。参见 firebug 网络
DNS Lookup 4 ms
Connecting 21.18 s
Sending 1 ms
Waiting 115 ms
Receiving 9 ms
连接成本21.18 seconds
我已经检查了所有日志文件,没有错误。top command,仍然有可用内存。
top - 00:23:15 up 8 days, 3:57, 1 user, load average: 3.60, 3.42, 3.83
Tasks: 221 total, 4 running, 217 sleeping, 0 stopped, 0 zombie
Cpu(s): 19.3%us, 3.2%sy, 0.0%ni, 76.1%id, 1.4%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 4194304k total, 3247724k used, 946580k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 0k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32357 mysql 15 0 3710m 835m 6268 S 34.5 20.4 39:14.40 mysqld
9780 apache 15 0 442m 59m 12m S 33.2 1.4 0:05.69 httpd
9842 apache 15 0 403m 26m 10m S 16.9 0.7 0:01.23 httpd
9847 apache 15 0 412m 45m 22m R 15.3 1.1 0:01.00 httpd
9834 apache 15 0 426m 46m 11m R 13.0 1.1 0:02.22 httpd
9891 apache 15 0 407m 43m 19m S 8.0 1.1 0:00.33 httpd
9845 apache 15 0 414m 51m 24m S 6.0 1.3 0:01.53 httpd
9827 apache 15 0 402m 28m 11m S 3.3 0.7 0:02.69 httpd
9768 apache 16 0 414m 51m 24m S 3.0 1.3 0:06.51 httpd
9889 root 15 0 211m 12m 8160 S 2.7 0.3 0:00.32 php
9702 apache 15 0 415m 55m 26m S 1.7 1.4 0:10.67 httpd
9844 apache 15 0 413m 47m 21m S 1.7 1.2 0:01.21 httpd
9697 apache 15 0 414m 51m 24m S 1.3 1.3 0:11.05 httpd
9778 apache 15 0 414m 53m 25m S 1.3 1.3 0:05.38 httpd
9772 apache 15 0 414m 51m 23m R 0.7 1.3 0:05.04 httpd
9823 apache 15 0 415m 50m 23m S 0.7 1.2 0:03.97 httpd
9837 apache 15 0 402m 27m 11m S 0.3 0.7 0:01.04 httpd
那么,如何检查问题出在哪里并修复它?这些天我没有更改配置文件。谢谢。
答案1
答案2
您可能需要研究一些调整mysqld
,一个好的开始是使用以下脚本: