日期:2014-05-16  浏览次数:20762 次

apache 和 nginx 压力测试结果竟然是这样? 难道nginx真的比apache强大那么多?
模拟1000个用户,设置10秒

apache

Transactions:                3725 hits
Availability:              100.00 %
Elapsed time:                9.26 secs
Data transferred:           32.39 MB
Response time:                1.21 secs
Transaction rate:          402.27 trans/sec
Throughput:                3.50 MB/sec
Concurrency:              488.71
Successful transactions:        3725
Failed transactions:               0
Longest transaction:            7.71
Shortest transaction:            0.00

nginx

Transactions:                10152 hits
Availability:              100.00 %
Elapsed time:                9.54 secs
Data transferred:           545.65 MB
Response time:                0.31secs
Transaction rate:         1064.15trans/sec
Throughput:               57.20 MB/sec
Concurrency:             329.25
Successful transactions:        10152
Failed transactions:               0
Longest transaction:            8.04
Shortest transaction:            0.00

------解决方案--------------------
就我所知道的,“每天要接受上千万的用户访问”,已经不是一台机器能够搞定的事情;
一般是好几层,最前面是nginx的集群,然后是memcache的集群,再后面才是apache/tomcat这样的web服务器或者应用服务器。