Apache服务器性能评测 不指定

jed , 2009-3-24 14:13 , 服务器技术 , 评论(0) , 阅读(2464) , Via 本站原创 | |
为了客观的了解Apache的服务器性能,在此选取Apache自带的性能测试软件ApacheBench, Version 2.0.40-dev and  Version 2.3 分别作为性能测试工具。

1.比较现有T2000 Apache2.2.8经过优化前后的效果
Webserver IP:10.56.234.31
优化前httpd.conf:
----------------------------------------------------------------------
           StartServers        10
           MinSpareServers     50
           MaxSpareServers    100
           ServerLimit     10000
           MaxClients        10000
           MaxRequestsPerChild  0
----------------------------------------------------------------------
优化后httpd.conf:
----------------------------------------------------------------------
           StartServers        150
           MinSpareServers     10
           MaxSpareServers    20
           ServerLimit     20000
           MaxClients        20000
           MaxRequestsPerChild 10000
----------------------------------------------------------------------
测试命令: /opt/apache2.2.8/bin/ab -n 10000 -c 1000
http://127.0.0.1/pete/20kb/automot.jpg
测试方法: 访问20kb的jpg图片来获取tps数据,为了排除网络因素,选取127.0.0.1本地环路地址。
测试结果:
    ----------------------------------------------
    使用ApacheBench v2.0进行测试
    apache2.2.8(20k) 优化前 1657tps
    apache2.2.8(20k) 优化后 1666tps
    ---------------------------------------------
    使用 ApacheBench v2.3进行测试
    apache2.2.8(20k) 优化前 1765tps
    apache2.2.8(20k) 优化后 1822tps
    -----------------------------------------------
测试结论:由于这个Apache2.2.8版本没有编入worker.c模块,无法进行worker优化。但是,单独就对prefork的优化,发现性能提升很小。基本保持以后的水平。同时我们发现,测试结果受到T2000机器状态影响很大。所以,本测试基本在没有其他压力的情况下进行。


2.比较现有T2000上Apache2.2.8和Apache2.2.11优化后的性能
Webserver IP:10.56.234.31
配置:
a. Apache2.2.8优化后配置请见step1
b.Apache2.2.11中对于httpd-mpm.conf优化:
----------------------------------------------------------------------

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
StartServers       150
MinSpareServers    10
MaxSpareServers    20
ServerLimit        20000
MaxClients         20000
MaxRequestsPerChild 10000
# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
StartServers         2
MaxClients         1500
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0

发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]