1

我有一个每天有 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 的 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

CPU信息:

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:
4

1 回答 1

1

刚发现,是php脚本中调用glob函数的函数,当文件很多时,速度变慢会出问题

于 2013-08-08T20:01:16.537 回答