Chinaunix首页 | 论坛 | 博客
  • 博客访问: 154312
  • 博文数量: 29
  • 博客积分: 1662
  • 博客等级: 上尉
  • 技术积分: 327
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-13 18:53
个人简介

thanks

文章分类
文章存档

2022年(1)

2017年(1)

2016年(1)

2015年(3)

2014年(9)

2011年(1)

2009年(1)

2008年(12)

我的朋友

分类: 系统运维

2014-03-21 12:49:14

ubuntu1204amd64 nginx package

curl localhost:8000/


Welcome to nginx!


Welcome to nginx!





测试命令
ab -n 100000 -c 100 localhost:8000/



nginx已经关闭了log,根据cpu已经开启两个工作进程,在开启epool的情况下成绩:
Concurrency Level:      100
Time taken for tests:   20.016 seconds
Complete requests:      100000

Requests per second:    4996.02 [#/sec] (mean)

在配置文件中取消epoll的成绩如下
service nginx reload

Concurrency Level:      100
Time taken for tests:   19.619 seconds
Complete requests:      100000

Requests per second:    5097.07 [#/sec] (mean)

微弱的性能误差不足矣说明有太多影响,但至少,在配置文件中删除use poll是几乎大的影响。




=========
还有
        worker_connections 51200;

貌似修改了性能影响也有限,或许实验条件有限影响没有显示出那么明显吧。


后续实验
在取消        # multi_accept on;(默认未开启)
Requests per second:    5501.15 [#/sec] (mean)

性能又提升了到5k5,说明ubuntu默认是不需要对配置文件做太多修改的。


=======
nginx响应跟cpu性能相关,在个人计算机(双核)上,配置(一个)工作进程数据可以达到
Server Software:        nginx/1.1.19
Server Hostname:        localhost
Server Port:            80

Document Path:          /
Document Length:        151 bytes

Concurrency Level:      100
Time taken for tests:   16.667 seconds
Complete requests:      100000
Failed requests:        0
Write errors:           0
Total transferred:      36200000 bytes
HTML transferred:       15100000 bytes
Requests per second:    5999.94 [#/sec] (mean)
Time per request:       16.667 [ms] (mean)
Time per request:       0.167 [ms] (mean, across all concurrent requests)
Transfer rate:          2121.07 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    6   2.2      6      20
Processing:     4   11   3.5     10      40
Waiting:        3    9   3.8      8      40
Total:         13   17   2.5     16      40

Percentage of the requests served within a certain time (ms)
  50%     16
  66%     16
  75%     17
  80%     17
  90%     19
  95%     22
  98%     25
  99%     27
 100%     40 (longest request)


======
cat /proc/cpuinfo
model name    : AMD E-300 APU with Radeon(tm) HD Graphics

tar xf xxoo
./configure --without-http_rewrite_module --without-http_gzip_module
make && make install

测试结果
curl mh3:8000/



Welcome to nginx!



Welcome to nginx!


If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.



For online documentation and support please refer to
nginx.org.

Commercial support is available at
nginx.com.



Thank you for using nginx.






Requests per second:    6000.15 [#/sec] (mean)
Transfer rate:          4945.43 [Kbytes/sec] received



阅读(1361) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~