全球主机交流论坛

标题: LNAMP vs LLMP [打印本页]

作者: windywinter    时间: 2011-1-12 21:18
标题: LNAMP vs LLMP
延续昨天的http://www.lilynana.eu.org/thread-43855-1-1.htmlhttp://www.lilynana.eu.org/viewthread.php?tid=43921
今天拿闲置的VPS试了一下LNAMP。
debian系统,全apt安装,没编译。由于我基本没有使用apache和nginx的经验,所以配出来的LNAMP是比较裸的。
实验对象是个WordPress,这帖只贴实验数据,耐心点,比较长。配置教程之类以后再说,等我先搞懂了。
静态js文件
LLMP:
  1. Server Software:        lighttpd/1.4.28-devel-485M
  2. Server Hostname:        a.ream.at
  3. Server Port:            80

  4. Document Path:          /wp-includes/js/jquery/jquery.js?ver=1.4.2
  5. Document Length:        72194 bytes

  6. Concurrency Level:      100
  7. Time taken for tests:   1.973 seconds
  8. Complete requests:      10000
  9. Failed requests:        0
  10. Write errors:           0
  11. Total transferred:      725470000 bytes
  12. HTML transferred:       721940000 bytes
  13. Requests per second:    5068.67 [#/sec] (mean)
  14. Time per request:       19.729 [ms] (mean)
  15. Time per request:       0.197 [ms] (mean, across all concurrent requests)
  16. Transfer rate:          359098.65 [Kbytes/sec] received

  17. Connection Times (ms)
  18.               min  mean[+/-sd] median   max
  19. Connect:        0    1   1.6      0      18
  20. Processing:     6   19   4.3     19      58
  21. Waiting:        2   17   5.3     17      45
  22. Total:          9   20   4.8     19      71

  23. Percentage of the requests served within a certain time (ms)
  24.   50%     19
  25.   66%     20
  26.   75%     21
  27.   80%     22
  28.   90%     24
  29.   95%     26
  30.   98%     28
  31.   99%     30
  32. 100%     71 (longest request)
复制代码
LNAMP:
  1. Server Software:        nginx/0.7.67
  2. Server Hostname:        a.ream.at
  3. Server Port:            80

  4. Document Path:          /wp-includes/js/jquery/jquery.js?ver=1.4.2
  5. Document Length:        72194 bytes

  6. Concurrency Level:      100
  7. Time taken for tests:   1.714 seconds
  8. Complete requests:      10000
  9. Failed requests:        0
  10. Write errors:           0
  11. Total transferred:      724220000 bytes
  12. HTML transferred:       721940000 bytes
  13. Requests per second:    5834.89 [#/sec] (mean)
  14. Time per request:       17.138 [ms] (mean)
  15. Time per request:       0.171 [ms] (mean, across all concurrent requests)
  16. Transfer rate:          412670.40 [Kbytes/sec] received

  17. Connection Times (ms)
  18.               min  mean[+/-sd] median   max
  19. Connect:        0    1   1.1      0      13
  20. Processing:     6   16   3.0     16      27
  21. Waiting:        2   14   3.9     14      24
  22. Total:         11   17   2.9     16      27

  23. Percentage of the requests served within a certain time (ms)
  24.   50%     16
  25.   66%     18
  26.   75%     19
  27.   80%     20
  28.   90%     21
  29.   95%     22
  30.   98%     24
  31.   99%     26
  32. 100%     27 (longest request)
复制代码
静态png图片
LLMP:
  1. Server Software:        lighttpd/1.4.28-devel-485M
  2. Server Hostname:        a.ream.at
  3. Server Port:            80

  4. Document Path:          /wp-content/media/suguan10.png
  5. Document Length:        96068 bytes

  6. Concurrency Level:      100
  7. Time taken for tests:   2.074 seconds
  8. Complete requests:      10000
  9. Failed requests:        0
  10. Write errors:           0
  11. Total transferred:      963850000 bytes
  12. HTML transferred:       960680000 bytes
  13. Requests per second:    4822.14 [#/sec] (mean)
  14. Time per request:       20.738 [ms] (mean)
  15. Time per request:       0.207 [ms] (mean, across all concurrent requests)
  16. Transfer rate:          453888.22 [Kbytes/sec] received

  17. Connection Times (ms)
  18.               min  mean[+/-sd] median   max
  19. Connect:        0    2   1.2      2       7
  20. Processing:     0   19   6.8     19      46
  21. Waiting:        0    6   3.8      5      27
  22. Total:          0   21   6.9     20      47

  23. Percentage of the requests served within a certain time (ms)
  24.   50%     20
  25.   66%     24
  26.   75%     25
  27.   80%     26
  28.   90%     29
  29.   95%     32
  30.   98%     37
  31.   99%     38
  32. 100%     47 (longest request)
复制代码
LNAMP:
  1. Server Software:        nginx/0.7.67
  2. Server Hostname:        a.ream.at
  3. Server Port:            80

  4. Document Path:          /wp-content/media/suguan10.png
  5. Document Length:        96068 bytes

  6. Concurrency Level:      100
  7. Time taken for tests:   1.826 seconds
  8. Complete requests:      10000
  9. Failed requests:        0
  10. Write errors:           0
  11. Total transferred:      962810000 bytes
  12. HTML transferred:       960680000 bytes
  13. Requests per second:    5475.35 [#/sec] (mean)
  14. Time per request:       18.264 [ms] (mean)
  15. Time per request:       0.183 [ms] (mean, across all concurrent requests)
  16. Transfer rate:          514816.37 [Kbytes/sec] received

  17. Connection Times (ms)
  18.               min  mean[+/-sd] median   max
  19. Connect:        0    2   0.6      2       4
  20. Processing:     2   16   3.3     16      29
  21. Waiting:        1    4   3.4      3      23
  22. Total:          6   18   3.3     18      30

  23. Percentage of the requests served within a certain time (ms)
  24.   50%     18
  25.   66%     19
  26.   75%     20
  27.   80%     21
  28.   90%     23
  29.   95%     25
  30.   98%     28
  31.   99%     28
  32. 100%     30 (longest request)
复制代码
动态的,php的,主要部分来了,这个页面执行时间很长……不过主要是数据库查询比较多
LLMP:
  1. Server Software:        lighttpd/1.4.28-devel-485M
  2. Server Hostname:        a.ream.at
  3. Server Port:            80

  4. Document Path:          /
  5. Document Length:        30737 bytes

  6. Concurrency Level:      30
  7. Time taken for tests:   295.213 seconds
  8. Complete requests:      3000
  9. Failed requests:        2989
  10.    (Connect: 0, Receive: 0, Length: 2989, Exceptions: 0)
  11. Write errors:           0
  12. Total transferred:      93327663 bytes
  13. HTML transferred:       92493663 bytes
  14. Requests per second:    10.16 [#/sec] (mean)
  15. Time per request:       2952.131 [ms] (mean)
  16. Time per request:       98.404 [ms] (mean, across all concurrent requests)
  17. Transfer rate:          308.73 [Kbytes/sec] received

  18. Connection Times (ms)
  19.               min  mean[+/-sd] median   max
  20. Connect:        0    0   0.1      0       2
  21. Processing:  1668 2942 495.2   2888    8452
  22. Waiting:     1623 2900 494.5   2845    8392
  23. Total:       1668 2942 495.2   2888    8452

  24. Percentage of the requests served within a certain time (ms)
  25.   50%   2888
  26.   66%   2997
  27.   75%   3073
  28.   80%   3129
  29.   90%   3290
  30.   95%   3445
  31.   98%   3706
  32.   99%   4040
  33. 100%   8452 (longest request)
复制代码
LNAMP:
  1. Server Software:        nginx/0.7.67
  2. Server Hostname:        a.ream.at
  3. Server Port:            80

  4. Document Path:          /
  5. Document Length:        30637 bytes

  6. Concurrency Level:      30
  7. Time taken for tests:   312.136 seconds
  8. Complete requests:      3000
  9. Failed requests:        2999
  10.    (Connect: 0, Receive: 0, Length: 2999, Exceptions: 0)
  11. Write errors:           0
  12. Total transferred:      93280153 bytes
  13. HTML transferred:       92488153 bytes
  14. Requests per second:    9.61 [#/sec] (mean)
  15. Time per request:       3121.356 [ms] (mean)
  16. Time per request:       104.045 [ms] (mean, across all concurrent requests)
  17. Transfer rate:          291.84 [Kbytes/sec] received

  18. Connection Times (ms)
  19.               min  mean[+/-sd] median   max
  20. Connect:        0    0   0.2      0       2
  21. Processing:  2262 3063 518.9   3002    9154
  22. Waiting:     2262 3063 518.9   3002    9154
  23. Total:       2262 3064 518.9   3002    9156

  24. Percentage of the requests served within a certain time (ms)
  25.   50%   3002
  26.   66%   3097
  27.   75%   3163
  28.   80%   3205
  29.   90%   3328
  30.   95%   3445
  31.   98%   3712
  32.   99%   5723
  33. 100%   9156 (longest request)
复制代码
还是那个页面,加了个Hyper-Cache缓存插件
LLMP:
  1. Server Software:        lighttpd/1.4.28-devel-485M
  2. Server Hostname:        a.ream.at
  3. Server Port:            80

  4. Document Path:          /
  5. Document Length:        30936 bytes

  6. Concurrency Level:      100
  7. Time taken for tests:   12.440 seconds
  8. Complete requests:      10000
  9. Failed requests:        0
  10. Write errors:           0
  11. Total transferred:      312950000 bytes
  12. HTML transferred:       309360000 bytes
  13. Requests per second:    803.86 [#/sec] (mean)
  14. Time per request:       124.399 [ms] (mean)
  15. Time per request:       1.244 [ms] (mean, across all concurrent requests)
  16. Transfer rate:          24567.28 [Kbytes/sec] received

  17. Connection Times (ms)
  18.               min  mean[+/-sd] median   max
  19. Connect:        0    0   0.9      0      12
  20. Processing:    30  123  17.0    122     192
  21. Waiting:       30  123  17.0    121     192
  22. Total:         42  124  16.7    122     193

  23. Percentage of the requests served within a certain time (ms)
  24.   50%    122
  25.   66%    130
  26.   75%    134
  27.   80%    138
  28.   90%    145
  29.   95%    151
  30.   98%    159
  31.   99%    166
  32. 100%    193 (longest request)
复制代码
LNAMP:
  1. Server Software:        nginx/0.7.67
  2. Server Hostname:        a.ream.at
  3. Server Port:            80

  4. Document Path:          /
  5. Document Length:        30936 bytes

  6. Concurrency Level:      100
  7. Time taken for tests:   10.412 seconds
  8. Complete requests:      10000
  9. Failed requests:        0
  10. Write errors:           0
  11. Total transferred:      312580000 bytes
  12. HTML transferred:       309360000 bytes
  13. Requests per second:    960.45 [#/sec] (mean)
  14. Time per request:       104.118 [ms] (mean)
  15. Time per request:       1.041 [ms] (mean, across all concurrent requests)
  16. Transfer rate:          29318.20 [Kbytes/sec] received

  17. Connection Times (ms)
  18.               min  mean[+/-sd] median   max
  19. Connect:        0    0   0.7      0       9
  20. Processing:    10  103  37.5    117     178
  21. Waiting:       10  103  37.7    117     177
  22. Total:         18  104  37.3    117     178

  23. Percentage of the requests served within a certain time (ms)
  24.   50%    117
  25.   66%    129
  26.   75%    135
  27.   80%    138
  28.   90%    148
  29.   95%    154
  30.   98%    159
  31.   99%    162
  32. 100%    178 (longest request)
复制代码
四个测试里,LNAMP胜出3项,跑纯动态的php反而不如LLMP。
另外,神马都是浮云 缓存才是王道。
作者: Wyane    时间: 2011-1-12 21:18
这个要顶
作者: Globalization    时间: 2011-1-12 21:18
好长
作者: yc260982    时间: 2011-1-12 21:20
不错
作者: windywinter    时间: 2011-1-12 21:22
CAO,
想起来忘了说配置问题了,结果原帖不能改
LLMP方面,php-cgi进程14个;LNAMP那边,apache也是14个。
作者: whyyyhk    时间: 2011-1-12 21:22
提示: 作者被禁止或删除 内容自动屏蔽
作者: windywinter    时间: 2011-1-12 21:25
现在这个主机还开着呢,正跑着LNAMP,想看的可以去玩玩。
作者: xtmp    时间: 2011-1-12 21:28
技术流啊
作者: lyylts    时间: 2011-1-12 21:39
<?php

function whatthefuck($cons) {
  $i = 0;
  $object = new StdClass;
  for (;$i < $cons; $i++) {
    $object->{"your_" . $i} = array("sorry" => 12345);
    $object->{"yourdaddy_" . $i} = new StdClass;
    $object->{"onlyyour"} = array("sorry" => 12345);
  }
  unset($object);
}
whatthefuck(10000);
print "done";
?>

楼主试试拿这段代买跑个测试看看....应该能体现出lnamp的优势
作者: 风声    时间: 2011-1-12 21:40
原帖由 windywinter 于 2011-1-12 21:25 发表
现在这个主机还开着呢,正跑着LNAMP,想看的可以去玩玩。



看了速度很快, 你说那个比不过的PHP一项靠缓存的话,独立服务器上就有很多优势了. 看来LNAMP是很不错.
伪静态你研究清楚了吗?  加减虚拟主机呢?
作者: yugongtian    时间: 2011-1-12 21:43
小白 不懂 路过  不掉西你们~
作者: windywinter    时间: 2011-1-12 21:43
原帖由 lyylts 于 2011-1-12 21:39 发表


楼主试试拿这段代买跑个测试看看....应该能体现出lnamp的优势

真WTF……
作者: 瘦够了    时间: 2011-1-12 21:44
缓存缓存,我都缓存了超过20G内容了。。。
作者: Kokgog    时间: 2011-1-12 21:45
原帖由 瘦够了 于 2011-1-12 21:44 发表
缓存缓存,我都缓存了超过20G内容了。。。


并发到了一定程度,基于文件的缓存会成为大负担的..........
作者: windywinter    时间: 2011-1-12 21:53
原帖由 风声 于 2011-1-12 21:40 发表



看了速度很快, 你说那个比不过的PHP一项靠缓存的话,独立服务器上就有很多优势了. 看来LNAMP是很不错.
伪静态你研究清楚了吗?  加减虚拟主机呢?

rewrite规则nginx和apache的同时起作用,相当于串行处理,即nginx先处理一下,如果处理出来的uri需要给apache,那么apache收到后又会根据自己的rewrite规则继续处理。
nginx里的rewrite的效果跟fastcgi也不太一样,我一上来写什么rewrite都不对,不是死循环就是没法把完整的uri传给apache。
比如这个rewrite规则:
  1. if (!-e $request_filename) {
  2. rewrite . /index.php last;
  3. }
复制代码
fastcgi的用这个写法可以,但LNAMP就不行,查apache的log,发现apache收到的uri就是/index.php,后面的没了
如果写成这样:
  1. if (!-e $request_filename) {
  2. rewrite ^(.+) /index.php$1 last;
  3. }
复制代码
就会死循环。
最后只好让nginx只截留静态文件,location / {}里面直接就是proxy_pass,把rewrite全丢给apache。

[ 本帖最后由 windywinter 于 2011-1-12 21:59 编辑 ]
作者: 瘦够了    时间: 2011-1-12 22:03
一直在玩LNMP
作者: wishour    时间: 2011-1-12 22:04
我参考 http://www.mgrei.com/archives/206.html 这个的配置,伪静态,我只设置了apache的,nginx完全没动,wordpress能实现固定链接和super cache不过我弄下来一个WP.内存消耗达到了280MB....

虚拟主机两边都要设置,但是也还算方便.

可惜我没去测试差别,因为没东西测试
作者: windywinter    时间: 2011-1-12 22:08
原帖由 lyylts 于 2011-1-12 21:39 发表


楼主试试拿这段代买跑个测试看看....应该能体现出lnamp的优势

我去……你怎么想出来的这代码……
LLMP:
  1. Server Software:        lighttpd/1.4.28-devel-485M
  2. Server Hostname:        barri.ream.at
  3. Server Port:            80

  4. Document Path:          /dummy.php
  5. Document Length:        5 bytes

  6. Concurrency Level:      100
  7. Time taken for tests:   197.391 seconds
  8. Complete requests:      10000
  9. Failed requests:        0
  10. Write errors:           0
  11. Total transferred:      1870000 bytes
  12. HTML transferred:       50000 bytes
  13. Requests per second:    50.66 [#/sec] (mean)
  14. Time per request:       1973.915 [ms] (mean)
  15. Time per request:       19.739 [ms] (mean, across all concurrent requests)
  16. Transfer rate:          9.25 [Kbytes/sec] received

  17. Connection Times (ms)
  18.               min  mean[+/-sd] median   max
  19. Connect:        0    0   0.5      0       6
  20. Processing:    88 1965 123.2   1970    2261
  21. Waiting:       88 1965 123.2   1970    2261
  22. Total:         94 1965 122.9   1970    2261

  23. Percentage of the requests served within a certain time (ms)
  24.   50%   1970
  25.   66%   2002
  26.   75%   2024
  27.   80%   2037
  28.   90%   2072
  29.   95%   2100
  30.   98%   2130
  31.   99%   2149
  32. 100%   2261 (longest request)
复制代码
LNAMP:
  1. Server Software:        nginx/0.7.67
  2. Server Hostname:        barri.ream.at
  3. Server Port:            80

  4. Document Path:          /dummy.php
  5. Document Length:        320 bytes

  6. Concurrency Level:      100
  7. Time taken for tests:   1.073 seconds
  8. Complete requests:      10000
  9. Failed requests:        0
  10. Write errors:           0
  11. Total transferred:      5320000 bytes
  12. HTML transferred:       3200000 bytes
  13. Requests per second:    9322.96 [#/sec] (mean)
  14. Time per request:       10.726 [ms] (mean)
  15. Time per request:       0.107 [ms] (mean, across all concurrent requests)
  16. Transfer rate:          4843.57 [Kbytes/sec] received

  17. Connection Times (ms)
  18.               min  mean[+/-sd] median   max
  19. Connect:        0    4   1.4      4       9
  20. Processing:     2    7   1.9      7      14
  21. Waiting:        1    6   1.9      5      12
  22. Total:          6   11   2.1     10      18

  23. Percentage of the requests served within a certain time (ms)
  24.   50%     10
  25.   66%     11
  26.   75%     12
  27.   80%     13
  28.   90%     14
  29.   95%     15
  30.   98%     15
  31.   99%     15
  32. 100%     18 (longest request)
复制代码
为什么啊为什么……
作者: windywinter    时间: 2011-1-12 22:12
原帖由 wishour 于 2011-1-12 22:04 发表
我参考 http://www.mgrei.com/archives/206.html 这个的配置,伪静态,我只设置了apache的,nginx完全没动,wordpress能实现固定链接和super cache不过我弄下来一个WP.内存消耗达到了280MB....

虚拟主机两边都要 ...

他是nginx 0.8.53啊。
他nginx里最重要的rewrite是这个:
  1. if ( !-e $request_filename) {
  2. proxy_pass  http://127.0.0.1:81;
  3. }
复制代码
我觉得这个写法很不错,可惜0.7.67不支持这样写。

[ 本帖最后由 windywinter 于 2011-1-12 22:15 编辑 ]
作者: wishour    时间: 2011-1-12 22:18
所以咯,你弄个0.8.54来试试吧,反正都是稳定版.期待你继续测试,我也不知道lNAMPH究竟意味着实际上的多少优势
作者: lyylts    时间: 2011-1-12 22:34
原帖由 windywinter 于 2011-1-12 22:08 发表

我去……你怎么想出来的这代码……
LLMP:Server Software:        lighttpd/1.4.28-devel-485M
Server Hostname:        barri.ream.at
Server Port:            80

Document Path:          /dummy.php
Document L ...


你把wordpress装上40个功能性但非cache类的插件...结果也会拉开的。
lighttpd面对这种php,或多或少都会mem leak的。
作者: wishour    时间: 2011-1-12 22:38
恩,虽然不知道为什么,我在和别人聊天说道fast cgi在php实际应用上不如mod的时候居然很多人喷我,但是我个人的实践证明,wordpress不开cache,纯动态,apache比nginx或者lighttpd效果好
作者: windywinter    时间: 2011-1-12 22:39
原帖由 lyylts 于 2011-1-12 22:34 发表


你把wordpress装上40个功能性但非cache类的插件...结果也会拉开的。
lighttpd面对这种php,或多或少都会mem leak的。

我的大约有20个……40太丧心病狂了吧……
作者: windywinter    时间: 2011-1-12 22:41
原帖由 wishour 于 2011-1-12 22:38 发表
恩,虽然不知道为什么,我在和别人聊天说道fast cgi在php实际应用上不如mod的时候居然很多人喷我,但是我个人的实践证明,wordpress不开cache,纯动态,apache比nginx或者lighttpd效果好 ...

我的测试结果是相反……
裸的apache比nginx或lighttpd效果好是不可能的,两者处理静态文件的差距太大了。

[ 本帖最后由 windywinter 于 2011-1-12 22:42 编辑 ]
作者: 风声    时间: 2011-1-12 22:50
原帖由 windywinter 于 2011-1-12 22:41 发表

我的测试结果是相反……
裸的apache比nginx或lighttpd效果好是不可能的,两者处理静态文件的差距太大了。


关于NGINX处理静态强大过APACHE已经是下了定论了, 不再讨论了, 否则为什么要LANMP?
作者: wishour    时间: 2011-1-12 22:52
原帖由 windywinter 于 2011-1-12 22:41 发表

我的测试结果是相反……
裸的apache比nginx或lighttpd效果好是不可能的,两者处理静态文件的差距太大了。


nginx的静态强大路人皆知,我是指纯php的话,个人感觉要好点.
实际使用的话,LNAMP绝对比LNMP或者LAMP强大,那是必须的,不然谁折腾啊
作者: 风声    时间: 2011-1-12 22:55
原帖由 wishour 于 2011-1-12 22:52 发表


nginx的静态强大路人皆知,我是指纯php的话,个人感觉要好点.
实际使用的话,LNAMP绝对比LNMP或者LAMP强大,那是必须的,不然谁折腾啊



现在想转,主要在考虑伪静态 / 虚拟主机(否则子域名搞死你) / 备份和恢复的问题(同步) 还有在独立服务器上优化的问题, 我现在跑LNMP(毒妇), 优化了很久才做到安全和效率都最好.
作者: windywinter    时间: 2011-1-12 22:58
原帖由 风声 于 2011-1-12 22:55 发表



现在想转,主要在考虑伪静态 / 虚拟主机(否则子域名搞死你) / 备份和恢复的问题(同步) 还有在独立服务器上优化的问题, 我现在跑LNMP(毒妇), 优化了很久才做到安全和效率都最好. ...

里面比较麻烦的主要是rewrite规则,必须具体例子具体分析,有的部分要写在nginx里面,有的可以应该留个apache处理。
作者: 风声    时间: 2011-1-12 23:07
原帖由 windywinter 于 2011-1-12 22:58 发表

里面比较麻烦的主要是rewrite规则,必须具体例子具体分析,有的部分要写在nginx里面,有的可以应该留个apache处理。


一直就是考虑这个问题...
作者: windywinter    时间: 2011-1-12 23:09
原帖由 风声 于 2011-1-12 23:07 发表


一直就是考虑这个问题...

这个你只能调试一下,空想是想不出来的。
作者: 风声    时间: 2011-1-12 23:17
原帖由 windywinter 于 2011-1-12 23:09 发表

这个你只能调试一下,空想是想不出来的。



有些站在跑,转代价大, 其实主要考虑主流的DX /DZ /ECSHOP /PHPCMS的REWRITE就可以了.
作者: windywinter    时间: 2011-1-13 14:07
标题: LNAMP vs LLMP 第二季
昨天安装的nginx版本是0.7.67,今天换0.8.54又测了一遍。
需要说明的是,0.7.67是1个worker process,0.8.54是4个。这个是debian默认配置文件写的,不能怨我。
LLMP的数据跟昨天的基本一样,为了省字数就不再贴一遍了。
静态js文件
  1. Server Software:        nginx/0.8.54
  2. Server Hostname:        a.ream.at
  3. Server Port:            80

  4. Document Path:          /wp-includes/js/jquery/jquery.js?ver=1.4.2
  5. Document Length:        72194 bytes

  6. Concurrency Level:      100
  7. Time taken for tests:   1.583 seconds
  8. Complete requests:      10000
  9. Failed requests:        0
  10. Write errors:           0
  11. Total transferred:      724220000 bytes
  12. HTML transferred:       721940000 bytes
  13. Requests per second:    6319.07 [#/sec] (mean)
  14. Time per request:       15.825 [ms] (mean)
  15. Time per request:       0.158 [ms] (mean, across all concurrent requests)
  16. Transfer rate:          446913.57 [Kbytes/sec] received

  17. Connection Times (ms)
  18.               min  mean[+/-sd] median   max
  19. Connect:        1    2   0.7      2       6
  20. Processing:     4   13   2.2     13      28
  21. Waiting:        1    3   1.7      2      20
  22. Total:          8   16   2.4     15      32

  23. Percentage of the requests served within a certain time (ms)
  24.   50%     15
  25.   66%     16
  26.   75%     17
  27.   80%     17
  28.   90%     19
  29.   95%     20
  30.   98%     21
  31.   99%     24
  32. 100%     32 (longest request)
复制代码
静态png图片
  1. Server Software:        nginx/0.8.54
  2. Server Hostname:        a.ream.at
  3. Server Port:            80

  4. Document Path:          /wp-content/media/suguan10.png
  5. Document Length:        96068 bytes

  6. Concurrency Level:      100
  7. Time taken for tests:   1.883 seconds
  8. Complete requests:      10000
  9. Failed requests:        0
  10. Write errors:           0
  11. Total transferred:      962810000 bytes
  12. HTML transferred:       960680000 bytes
  13. Requests per second:    5309.85 [#/sec] (mean)
  14. Time per request:       18.833 [ms] (mean)
  15. Time per request:       0.188 [ms] (mean, across all concurrent requests)
  16. Transfer rate:          499255.10 [Kbytes/sec] received

  17. Connection Times (ms)
  18.               min  mean[+/-sd] median   max
  19. Connect:        1    2   0.8      2       9
  20. Processing:     7   16   3.0     16      39
  21. Waiting:        1    2   2.0      2      24
  22. Total:          9   19   3.4     18      48

  23. Percentage of the requests served within a certain time (ms)
  24.   50%     18
  25.   66%     19
  26.   75%     20
  27.   80%     21
  28.   90%     22
  29.   95%     24
  30.   98%     26
  31.   99%     29
  32. 100%     48 (longest request)
复制代码
动态的,php的,主要部分来了,这个页面执行时间很长……不过主要是数据库查询比较多
  1. Server Software:        nginx/0.8.54
  2. Server Hostname:        a.ream.at
  3. Server Port:            80

  4. Document Path:          /
  5. Document Length:        30902 bytes

  6. Concurrency Level:      30
  7. Time taken for tests:   290.482 seconds
  8. Complete requests:      3000
  9. Failed requests:        2993
  10.    (Connect: 0, Receive: 0, Length: 2993, Exceptions: 0)
  11. Write errors:           0
  12. Total transferred:      93352277 bytes
  13. HTML transferred:       92491277 bytes
  14. Requests per second:    10.33 [#/sec] (mean)
  15. Time per request:       2904.824 [ms] (mean)
  16. Time per request:       96.827 [ms] (mean, across all concurrent requests)
  17. Transfer rate:          313.84 [Kbytes/sec] received

  18. Connection Times (ms)
  19.               min  mean[+/-sd] median   max
  20. Connect:        0    0   0.4      0       5
  21. Processing:  1109 2895 448.8   2854    8318
  22. Waiting:     1045 2851 448.2   2809    8268
  23. Total:       1112 2895 448.7   2854    8318

  24. Percentage of the requests served within a certain time (ms)
  25.   50%   2854
  26.   66%   2932
  27.   75%   2986
  28.   80%   3025
  29.   90%   3140
  30.   95%   3240
  31.   98%   3438
  32.   99%   3886
  33. 100%   8318 (longest request)
复制代码
还是那个页面,加了个Hyper-Cache缓存插件
  1. Server Software:        nginx/0.8.54
  2. Server Hostname:        a.ream.at
  3. Server Port:            80

  4. Document Path:          /
  5. Document Length:        30936 bytes

  6. Concurrency Level:      100
  7. Time taken for tests:   5.527 seconds
  8. Complete requests:      10000
  9. Failed requests:        0
  10. Write errors:           0
  11. Total transferred:      312810000 bytes
  12. HTML transferred:       309360000 bytes
  13. Requests per second:    1809.20 [#/sec] (mean)
  14. Time per request:       55.273 [ms] (mean)
  15. Time per request:       0.553 [ms] (mean, across all concurrent requests)
  16. Transfer rate:          55267.32 [Kbytes/sec] received

  17. Connection Times (ms)
  18.               min  mean[+/-sd] median   max
  19. Connect:        0    1   2.8      0      21
  20. Processing:     9   54  19.3     49     162
  21. Waiting:        4   52  19.4     48     162
  22. Total:         22   55  19.0     50     162

  23. Percentage of the requests served within a certain time (ms)
  24.   50%     50
  25.   66%     53
  26.   75%     56
  27.   80%     59
  28.   90%     71
  29.   95%    103
  30.   98%    126
  31.   99%    137
  32. 100%    162 (longest request)
复制代码
2x faster than LLMP...
作者: windywinter    时间: 2011-1-13 14:15
另外也重新试了一下
  1. if ( !-e $request_filename) {
  2. proxy_pass  http://127.0.0.1:81;
  3. }
复制代码
发现0.8.54也不支持这个写法。我查了nginx的document,确实proxy_pass只能写在server和location下面,我就不知道女神这段conf是怎么通过的了。
不过我发现0.8.54可以用try_files来实现。
作者: pcboy128    时间: 2011-1-13 15:07
LNAMP貌似很不错...




欢迎光临 全球主机交流论坛 (https://lilynana.eu.org/) Powered by Discuz! X3.4