全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
楼主: windywinter

LNAMP vs LLMP

[复制链接]
发表于 2011-1-12 21:43:32 | 显示全部楼层
小白 不懂 路过  不掉西你们~
 楼主| 发表于 2011-1-12 21:43:53 | 显示全部楼层
原帖由 lyylts 于 2011-1-12 21:39 发表


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

真WTF……
发表于 2011-1-12 21:44:16 | 显示全部楼层
缓存缓存,我都缓存了超过20G内容了。。。
发表于 2011-1-12 21:45:53 | 显示全部楼层
原帖由 瘦够了 于 2011-1-12 21:44 发表
缓存缓存,我都缓存了超过20G内容了。。。


并发到了一定程度,基于文件的缓存会成为大负担的..........
 楼主| 发表于 2011-1-12 21:53:38 | 显示全部楼层
原帖由 风声 于 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:04 | 显示全部楼层
一直在玩LNMP
发表于 2011-1-12 22:04:48 | 显示全部楼层
我参考 http://www.mgrei.com/archives/206.html 这个的配置,伪静态,我只设置了apache的,nginx完全没动,wordpress能实现固定链接和super cache不过我弄下来一个WP.内存消耗达到了280MB....

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

可惜我没去测试差别,因为没东西测试
 楼主| 发表于 2011-1-12 22:08:44 | 显示全部楼层
原帖由 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)
复制代码
为什么啊为什么……
 楼主| 发表于 2011-1-12 22:12:19 | 显示全部楼层
原帖由 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 编辑 ]
发表于 2011-1-12 22:18:08 | 显示全部楼层
所以咯,你弄个0.8.54来试试吧,反正都是稳定版.期待你继续测试,我也不知道lNAMPH究竟意味着实际上的多少优势
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-22 21:01 , Processed in 0.061527 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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