Performance

什麼在 WordPress VPS 主機上佔用了我所有的記憶體

  • December 14, 2012

我有一個 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 相當陌生,所以有沒有辦法或日誌文件可以檢查以查看正在使用所有記憶體的內容。如果是這樣,我會在哪裡查看,是否可以執行任何測試來檢查它是否是外掛以及它是哪個外掛。

謝謝

我只能為此想到一個 Hit and Trial 測試,因為我認為沒有任何工具可以告訴您哪個特定外掛正在使用記憶體。

為此,您可以在伺服器上執行 top 命令,並開始一一禁用您的外掛。

一旦您點擊特定外掛,您就會注意到 RAM 正在釋放。這是我現在能想到的檢查外掛記憶體問題的唯一方法。

引用自:https://serverfault.com/questions/458019