我每天都有一个拥有超过10000名访客的网站。服务器正在使用带有PHP FastCGI的lighttpd。 当并发在线访问者达到高数量(即超过180)时。服务器遇到更高的负载和非常慢的响应。我启用了Xcache,并使用了Php5.3。 服务器负载:23.74,18.78,10.97
有些专家可以看看我的配置,并建议我做什么?
fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/bin/php5-cgi",
"socket" => "/tmp/php.socket",
"min-procs" => 1,
"max-procs" => 5,
# "max-load-per-proc" => 8,
"idle-timeout" => 30,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "10",
"PHP_FCGI_MAX_REQUESTS" => "500"
),
"broken-scriptfilename" => "enable"
)))
Lighttpd for fastCGI的统计数据如下:
fastcgi.active-requests: 174
fastcgi.backend.0.0.connected: 2764
fastcgi.backend.0.0.died: 0
fastcgi.backend.0.0.disabled: 0
fastcgi.backend.0.0.load: 34
fastcgi.backend.0.0.overloaded: 0
fastcgi.backend.0.1.connected: 3698
fastcgi.backend.0.1.died: 0
fastcgi.backend.0.1.disabled: 0
fastcgi.backend.0.1.load: 35
fastcgi.backend.0.1.overloaded: 0
fastcgi.backend.0.2.connected: 4993
fastcgi.backend.0.2.died: 0
fastcgi.backend.0.2.disabled: 0
fastcgi.backend.0.2.load: 35
fastcgi.backend.0.2.overloaded: 0
fastcgi.backend.0.3.connected: 6811
fastcgi.backend.0.3.died: 0
fastcgi.backend.0.3.disabled: 0
fastcgi.backend.0.3.load: 35
fastcgi.backend.0.3.overloaded: 0
fastcgi.backend.0.4.connected: 8629
fastcgi.backend.0.4.died: 0
fastcgi.backend.0.4.disabled: 0
fastcgi.backend.0.4.load: 35
fastcgi.backend.0.4.overloaded: 0
fastcgi.backend.0.load: 174
fastcgi.requests: 26895
服务器内存:64GB
CPUINFO:
processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz
stepping : 7
cpu MHz : 3600.056
cache size : 10240 KB
physical id : 0
siblings : 8
core id : 3
cpu cores : 4
apicid : 7
initial apicid : 7
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 7200.11
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
答案 0 :(得分:1)
刚刚发现,这是PHP脚本中的一个函数,调用 glob 函数,当存在大量文件时,速度变得很慢会导致麻烦