在过去的15-20天里,我注意到了一个网站上的问题。该网站有两个图片库,一个是几年前建立的一个旧的静态HTML图片库,另一个主要是由ZENPhoto CMS提供动力。此外,我有相同的画廊CMS在另外两个网站上相同的VPS。
问题是,经过一段时间后,PHP生成的页面站点的加载变得非常缓慢,或者我得到503服务临时不可用错误。但是,问题只是在PHP生成的页面上,带有静态.html页面的站点的旧部分正在快速工作,同时也很好。所有静态.html页面的工作速度都很快,即使所有其他PHP生成的页面加载速度都很慢或无法访问。
另外,拥有相同CMS库的另外两个站点和具有不同PHP驱动的映像库的VPS上的另外两个站点也同时在同一VPS上工作得很好。
因此,当站点开始挂起时,只有PHP生成的内容不能工作,正如我所说的其他静态页面正在工作。然后我需要重新启动Apache,在重新启动之后,一切都运行得非常好和快速,一段时间以来,仅仅是PHP页面在这一个站点上变得越来越慢。如果我不重新启动apache,这种缓慢需要一些时间(几分钟、几个小时,取决于流量),在此期间,PHP驱动的内容在该站点上加载非常缓慢或不可用。过了一段时间后,每件事都开始起作用了,一次又一次地快起来了。在具有更多流量的小时内,PHP内容加载缓慢或不可用;在流量较少的小时内,PHP内容加载速度有时较快,有时稍慢一些。
另外,只有在这个站点上,并且只有PHP驱动的页面,静态页面甚至在大多数流量时间内都运行得很快。
无论何时开始放缓,网站的访问量都在减少。
我还注意到,在周末,网站的工作情况要好得多,可能是因为游客较少。
当站点开始减速时,我可以在Apache状态中看到这样的情况:
mod_fcgid status:
Total FastCGI processes: 37
Process: php5 (/usr/local/cpanel/cgi-sys/php5)
Pid Active Idle Accesses State
11300 39 28 7 Working
11274 47 28 7 Working
11296 40 29 3 Working
11283 45 30 3 Working
11304 36 31 1 Working
11282 46 32 3 Working
11292 42 33 1 Working
11289 44 34 1 Working
11305 35 35 0 Working
11273 48 36 2 Working
11280 47 39 1 Working
10125 133 40 12 Exiting(communication error)
11294 41 41 1 Exiting(communication error)
11277 47 42 2 Exiting(communication error)
11291 43 43 1 Exiting(communication error)
10187 108 43 10 Exiting(communication error)
10209 95 44 7 Exiting(communication error)
10171 113 44 5 Exiting(communication error)
11275 47 47 1 Exiting(communication error)
10144 125 48 8 Exiting(communication error)
10086 149 48 20 Exiting(communication error)
10212 94 49 5 Exiting(communication error)
10158 118 49 5 Exiting(communication error)
10169 114 50 4 Exiting(communication error)
10105 141 50 16 Exiting(communication error)
10094 146 50 15 Exiting(communication error)
10115 139 51 17 Exiting(communication error)
10213 93 51 9 Exiting(communication error)
10197 103 51 7 Exiting(communication error)
Process: php5 (/usr/local/cpanel/cgi-sys/php5)
Pid Active Idle Accesses State
7983 1079 2 149 Ready
7979 1079 11 151 Ready
Process: php5 (/usr/local/cpanel/cgi-sys/php5)
Pid Active Idle Accesses State
7990 1066 0 57 Ready
8001 1031 64 35 Ready
7999 1032 94 29 Ready
8000 1031 91 36 Ready
8002 1029 34 52 Ready
Process: php5 (/usr/local/cpanel/cgi-sys/php5)
Pid Active Idle Accesses State
7991 1064 29 115 Ready当它很好地工作时,就没有“退出(通信错误)”的行。
Active和Idle是从上次请求开始的时间和时间,以秒为单位。
CPU是双四核E5440 Xeon (2.83GHz).
运行Linux2.6.18-028歧义099.3,x86_64。
免费产出:
total used free shared buffers cached
Mem: 8388608 882164 7506444 0 0 0
-/+ buffers/cache: 882164 7506444
Swap: 0 0 0
Total: 8388608 882164 7506444当前磁盘使用情况:
Filesystem Size Used Avail Use% Mounted on
/dev/vzfs 100G 34G 67G 34% /
none在Apache/2.2.22上运行
系统信息:(Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_pass身/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_fcgid/2.3.6
发布于 2012-07-05 11:42:44
您正在运行一个Virtuozzo,这是成本太低的VPS托管提供商的第一选择。问题很可能是其他人把鼻涕锤出了主机,而你却被困在交火中。如果性能对您来说很重要,我建议您切换到一个不会让他们的主机过度竞争的提供商。
https://serverfault.com/questions/404969
复制相似问题