Rails服务器Nginx+Fastcgi比Nginx+Mongrel快不少

测试Fastcgi命令 ab -n1000 -c[并发数] http://localhost:4001/test
测试Mongrel命令 ab -n1000 -c[并发数] http://localhost:4002/test
请求对象:rails最简单的generate直接生成的view
下图测试结果数据为“每秒请求数 ”   
 FastcgiMongrel+Proxy性能提升百分比
1并发180.76164.529.87%
2并发175.92113.2655.32%
10并发182.01121.2150.16%
100并发182.15117.1855.44%
200并发107.1947.34126.43%
500并发107.3816.62546.09%
总结:测试下来Nginx+Fastcgi比Nginx+Mongrel快很多,但200并发和500并发测试时,到大约900请求后会速度走骤降,特别是mongrel几乎都快挂了。mongrel和fastcgi都这样,不清楚为什么。但用100并发,无论连续测几次都能以稳正的正常速度完成。
--2008-12-29 23:58--
于是让nginx多开了4个fcgi进程,共5个fcgi进程,于是可以支持500并发了
Requests per second: 178.93 [#/sec] (mean)
Time per request: 2794.346 [ms] (mean)
Time per request: 5.589 [ms] (mean, across all concurrent requests)
为什么我只开1个fcgi就不行呢

发表评论

电子邮件地址不会被公开。 必填项已被标记为 *

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>