我有一个 WordPress 网站托管在具有 1Gb 内存的 VPS Centos5_x64_cpanel 系统上。
最近,我遇到了很多与网站性能有关的问题,托管公司发来的电子邮件指出服务器超载。
今天我收到了这封电子邮件:
We have reboot the VPS ##.##.###.### , as it overload again
Normal: empty
HighMem: empty
50559 pagecache pages
Swap cache: add 20318560, delete 20312638, find 3426118/4492729, race 2780+11340
Free swap = 0kB
Total swap = 2097144kB
我每天都会收到好几次这样的邮件:
The chkservd sub-process with pid 11939 ran for 4949 seconds. This sub-process was terminated when it exceeded the time allowed between checks, which is 600 seconds. To determine why, you can check /var/log/chkservd.log and /usr/local/cpanel/logs/tailwatchd_log.
You likely received this notification as a symptom of a larger problem. If your server is experiencing a high load, we recommend investigating the cause. If you continue to receive this notification, it is likely that your system is unable to handle demand or a misconfiguration is delaying restarts.
If you are sure that no misconfigurations exist, you should consider gradually increasing the following options in WHM's "Tweak Settings" feature: "The number of times ChkServd will allow a previous check to complete before terminating the check" and/or "The number of seconds between ChkServd service checks".
Server: ###.#########.##
Primary IP: ##.##.###.###
Service: chkservd
Notification Type: hang
Memory Information:
Used: 820MB
Available: 208MB
Installed: 1024MB
Load Information: 76.53 75.24 80.24
Uptime: 0 days, 8 hours, 14 seconds
IOStat Information:
avg-cpu: %user %nice %system %iowait %steal %idle
1.97 0.01 0.80 13.19 0.01 84.02
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda1 18.57 360.59 132.67 10712202 3941360
sda2 422.54 995.39 2497.02 29570128 74179496
ChkServd Version: 15.1
该网站没有什么特别的,只安装了一些插件。
我怀疑可能是插件导致内存使用量过大。我对 WHM 还不太熟悉,所以有没有什么方法或日志文件可以让我查看哪些东西占用了所有内存。如果可以,我应该在哪里查看,是否有任何测试可以运行来检查它是否是插件以及是哪个插件。
谢谢
答案1
我只能想到对此进行尝试测试,因为我认为没有任何工具可以告诉您哪个特定插件正在使用内存。
为此,您可以在服务器上运行 top 命令,然后开始逐个禁用插件。
只要你点击特定的插件,你就会注意到内存被释放了。这是我现在能想到的唯一检查插件内存问题的方法。