一.下面先交代一下测试云主机
cpu:
root@alexknight:/tmp/webbench-1.5# cat /proc/cpuinfo |grep model
model :
model name : Intel(R) Core(TM) i5-4260U CPU @ .40GHz
root@alexknight:/tmp/webbench-1.5#
mem:
root@alexknight:/tmp/webbench-1.5# free -m
total used free shared buffers cached
Mem:
-/+ buffers/cache:
Swap:
二.测试对比
测试工具为webbench.
- 下面是django自带wsgi webserver的性能
root@alexknight:/tmp/webbench-1.5# webbench -c -t http://115.28.21.25:8008/
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar -, GPL Open Source Software. Benchmarking: GET http://115.28.21.25:8008/
clients, running sec. Speed= pages/min, bytes/sec.
Requests: susceed, failed.
大概能承受20路并发,当上升到25路时,会开始出现失败请求。
- 下面用uwsgi+nginx取代自带的wsgi server
root@alexknight:/tmp/webbench-1.5# webbench -c -t http://115.28.21.25:8000/
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar -, GPL Open Source Software. Benchmarking: GET http://115.28.21.25:8000/
clients, running sec. Speed= pages/min, bytes/sec.
Requests: susceed, failed.
大概能承受170路并发,效果还算明显的,当请求继续上升时,就会开始出现失败请求。