我的应用是bottle 做app, gevent做wsgiserver
简单的echo程序
https://gist.github.com/mengzhuo/89ae5dee035a1985a738用ab测试自己的app,发现
Requests per second: 2017.96 [#/sec] (mean)
测试时Python进程已经100%了
可这应该根本不算能承受C10K吧....,有什么地方我错了?
···
ab -c 10000 -n 10000 -r http://localhost:8998/echo
This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
http://www.zeustech.net/Licensed to The Apache Software Foundation,
http://www.apache.org/Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software:
Server Hostname: localhost
Server Port: 8998
Document Path: /echo
Document Length: 16 bytes
Concurrency Level: 10000
Time taken for tests: 4.956 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 1430000 bytes
HTML transferred: 160000 bytes
Requests per second: 2017.96 [#/sec] (mean)
Time per request: 4955.505 [ms] (mean)
Time per request: 0.496 [ms] (mean, across all concurrent requests)
Transfer rate: 281.80 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 832 1042.9 253 3009
Processing: 6 192 284.3 67 1688
Waiting: 2 192 284.3 67 1688
Total: 47 1024 1118.6 789 4682
···
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/124090
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.