由于每日访问者的增长,VPS上的WordPress不断崩溃

我在CentOS 6 64bit VPS 4GB内存上运行小型本地新闻博客。 最近,网站每天的访客数量从5K增长到10K-15K。

网站开始与504 Gateway Timeout崩溃。

错误日志显示request failed: error reading the headers错误时出错。

这是顶级节目

 Tasks: 65 total, 1 running, 64 sleeping, 0 stopped, 0 zombie Cpu(s): 0.1%us, 0.4%sy, 0.0%ni, 99.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 4194304k total, 217440k used, 3976864k free, 0k buffers Swap: 4194304k total, 0k used, 4194304k free, 119688k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 850 root 20 0 461m 9984 7272 S 1.7 0.2 0:04.51 ispmgr 822 apache 20 0 97384 4560 1932 S 0.3 0.1 0:00.89 nginx 1 root 20 0 19236 1452 1216 S 0.0 0.0 0:00.02 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd/767 3 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper/767 129 root 16 -4 10644 568 296 S 0.0 0.0 0:00.00 udevd 495 root 20 0 181m 1464 1048 S 0.0 0.0 0:00.00 rsyslogd 508 named 20 0 315m 12m 2556 S 0.0 0.3 0:00.02 named 524 opendkim 20 0 87792 2256 1100 S 0.0 0.1 0:00.00 opendkim 537 root 20 0 66612 1228 512 S 0.0 0.0 0:00.00 sshd 544 root 20 0 22184 936 704 S 0.0 0.0 0:00.00 xinetd 578 root 20 0 11308 1476 1220 S 0.0 0.0 0:00.02 mysqld_safe 701 mysql 20 0 424m 19m 5968 S 0.0 0.5 0:00.23 mysqld 743 postgres 20 0 108m 6112 5028 S 0.0 0.1 0:00.69 postmaster 745 postgres 20 0 82444 1488 404 S 0.0 0.0 0:00.00 postmaster 747 postgres 20 0 108m 1888 804 S 0.0 0.0 0:00.05 postmaster 748 postgres 20 0 108m 1672 588 S 0.0 0.0 0:00.04 postmaster 749 postgres 20 0 108m 1936 752 S 0.0 0.0 0:00.00 postmaster 750 postgres 20 0 82584 1680 544 S 0.0 0.0 0:00.01 postmaster 759 root 20 0 19268 780 524 S 0.0 0.0 0:00.00 dovecot 

我想这是networking服务器的问题,但我不知道我应该从哪里开始寻找什么好的configuration?

UPD。 VPS使用nginx作为Apache 2.2的前端代理。 PHP运行为CGI。 最大执行时间80秒

当网站运行正常时,顶部显示的httpd进程很less。

通过摆脱Apache可以提高性能。 使用PHP-FPM处理PHP,并将来自nginx的上游直接放到PHP FPM中。 您应该尝试使用启用了操作码caching的PHP 5.5,并使用一些WP超级caching等caching插件。