« phpMyAdmin中对GB2312和UTF8乱码的解决 | 首 页 | 回到Titanic »

2007 年 06 月 05 日

eAccelerator 0.9.5 安装和性能测试

| 分类: 服务器技术 Server Tech. |

  • 名称: eAccelerator
  • 主页: http://eaccelerator.net/
  • 安装过程:
  • # wget http://internap.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.5.tar.bz2
    # tar jxf eaccelerator-0.9.5.tar.bz2
    # cd eaccelerator-0.9.5
    # /usr/local/bin/phpize
    # ./configure --enable-eaccelerator=shared --with-php-config=/usr/local/bin/php-config
    # make && make install
    # mv /usr/local/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so /usr/local/lib/php/extensions/
    # rm -rf /usr/local/lib/php/extensions/no-debug-non-zts-20020429/
  • 修改 php.ini
  • (添加以下内容。默认的eAccelerator的安装目录是
    /usr/local/lib/php/extensions/no-debug-non-zts-20020429/)
    [eAccelerator]
    extension="/usr/local/lib/php/extensions/eaccelerator.so"
    eaccelerator.shm_size="16"
    eaccelerator.cache_dir="/tmp/eaccelerator"
    eaccelerator.enable="1"
    eaccelerator.optimizer="1"
    eaccelerator.check_mtime="1"
    eaccelerator.debug="0"
    eaccelerator.filter=""
    eaccelerator.shm_max="0"
    eaccelerator.shm_ttl="0"
    eaccelerator.shm_prune_period="0"
    eaccelerator.shm_only="0"
    eaccelerator.compress="1"
    eaccelerator.compress_level="9"
  • 建立缓存目录
  • mkdir /tmp/eaccelerator
    chmod 0777 /tmp/eaccelerator
  • 性能对比:
  • (使用 apache ApacheBench)
    # /usr/local/apache2/bin/ab -c 50 -n3000 http://localhost/phpinfo.php
    各10轮结果如下:
  • 环境: Fedora Core 5 + PHP 4.4.6 + Apache 2.0.59
  • 主机:AMD Athlon(tm) 64 Processor 3200+, 3G 内存
  • Default Default + ZendOptimizer-3.2.0 Default + ZendOptimizer-3.2.0 + eAccelerator 0.9.5
    Server Software:        Apache Server Software:        Apache Server Software:        Apache
    Server Hostname:        localhost Server Hostname:        localhost Server Hostname:        localhost
    Server Port:            80 Server Port:            80 Server Port:            80
    Document Path:          /phpinfo.php Document Path:          /phpinfo.php Document Path:          /phpinfo.php
    Document Length:        209 bytes Document Length:        209 bytes Document Length:        209 bytes
    Concurrency Level:      20 Concurrency Level:      20 Concurrency Level:      20
    Time taken for tests:   3.304046 seconds Time taken for tests:   3.325664 seconds Time taken for tests:   2.409044 seconds
    Complete requests:      1000 Complete requests:      1000 Complete requests:      1000
    Failed requests:        0 Failed requests:        0 Failed requests:        0
    Write errors:           0 Write errors:           0 Write errors:           0
    Non-2xx responses:      1007 Non-2xx responses:      1010 Non-2xx responses:      1006
    Total transferred:      375611 bytes Total transferred:      376730 bytes Total transferred:      375238 bytes
    HTML transferred:       210463 bytes HTML transferred:       211090 bytes HTML transferred:       210254 bytes
    Requests per second:    302.66 [#/sec] (mean) Requests per second:    300.69 [#/sec] (mean) Requests per second:    415.10 [#/sec] (mean)
    Time per request:       66.081 [ms] (mean) Time per request:       66.513 [ms] (mean) Time per request:       48.181 [ms] (mean)
    Time per request:       3.304 [ms] (mean, across all concurrent requests) Time per request:       3.326 [ms] (mean, across all concurrent requests) Time per request:       2.409 [ms] (mean, across all concurrent requests)
    Transfer rate:          110.77 [Kbytes/sec] received Transfer rate:          110.35 [Kbytes/sec] received Transfer rate:          151.93 [Kbytes/sec] received
    Connection Times (ms) Connection Times (ms) Connection Times (ms)
                  min  mean[+/-sd] median   max               min  mean[+/-sd] median   max               min  mean[+/-sd] median   max
    Connect:        0   12  14.1      9      98 Connect:        1   24  15.0     22     122 Connect:       -2    9   4.8      9      44
    Processing:    19   49  34.2     38     219 Processing:    12   38  29.8     28     240 Processing:    18   35  11.2     33     254
    Waiting:        7   39  31.4     31     178 Waiting:        0   26  21.3     21     226 Waiting:        7   30   9.1     30      88
    Total:         33   61  39.8     46     298 Total:         28   63  36.3     50     265 Total:         31   45  10.8     43     258
    Percentage of the requests served within a certain time (ms) Percentage of the requests served within a certain time (ms) Percentage of the requests served within a certain time (ms)
      50%     46   50%     50   50%     43
      66%     50   66%     55   66%     45
      75%     56   75%     61   75%     47
      80%     63   80%     71   80%     48
      90%    122   90%    114   90%     56
      95%    154   95%    145   95%     63
      98%    210   98%    198   98%     72
      99%    220   99%    210   99%     74
     100%    298 (longest request)  100%    265 (longest request)  100%    258 (longest request)
    (END)

    引用

    引用本文的 URL:
    http://weblog.kreny.com/cgi-bin/mt/mt-tb.cgi/251.

    发表评论

    (如果您还为在此成功留言,也许是因为需要管理员逐一审核留言内容后放可看到您的评论。请稍后并感谢您的耐心等待。)

    阅览更多文章请访问 首页过去的存档