全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 9442|回复: 33
打印 上一主题 下一主题

LNAMP vs LLMP

[复制链接]
跳转到指定楼层
#
发表于 2011-1-12 21:18:23 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
延续昨天的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。
另外,神马都是浮云 缓存才是王道。

评分

参与人数 5威望 +35 收起 理由
sagawa + 5 早就想加了 没到点
挨个搞 + 15 精品文章
xiasl + 5 原创内容
风声 + 5 看来可以转LNAMP了.
whyyyhk + 5 恶意灌水

查看全部评分

34#
发表于 2011-1-13 15:07:07 | 只看该作者
LNAMP貌似很不错...
33#
 楼主| 发表于 2011-1-13 14:15:05 | 只看该作者
另外也重新试了一下
  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来实现。
32#
 楼主| 发表于 2011-1-13 14:07:54 | 只看该作者

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...
31#
发表于 2011-1-12 23:17:11 | 只看该作者
原帖由 windywinter 于 2011-1-12 23:09 发表

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



有些站在跑,转代价大, 其实主要考虑主流的DX /DZ /ECSHOP /PHPCMS的REWRITE就可以了.
30#
 楼主| 发表于 2011-1-12 23:09:59 | 只看该作者
原帖由 风声 于 2011-1-12 23:07 发表


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

这个你只能调试一下,空想是想不出来的。
29#
发表于 2011-1-12 23:07:20 | 只看该作者
原帖由 windywinter 于 2011-1-12 22:58 发表

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


一直就是考虑这个问题...
28#
 楼主| 发表于 2011-1-12 22:58:25 | 只看该作者
原帖由 风声 于 2011-1-12 22:55 发表



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

里面比较麻烦的主要是rewrite规则,必须具体例子具体分析,有的部分要写在nginx里面,有的可以应该留个apache处理。
27#
发表于 2011-1-12 22:55:48 | 只看该作者
原帖由 wishour 于 2011-1-12 22:52 发表


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



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

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


nginx的静态强大路人皆知,我是指纯php的话,个人感觉要好点.
实际使用的话,LNAMP绝对比LNMP或者LAMP强大,那是必须的,不然谁折腾啊
25#
发表于 2011-1-12 22:50:12 | 只看该作者
原帖由 windywinter 于 2011-1-12 22:41 发表

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


关于NGINX处理静态强大过APACHE已经是下了定论了, 不再讨论了, 否则为什么要LANMP?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-11-13 10:07 , Processed in 0.068875 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表