spacepaste

  1.  
  2. # gunicorn with 2 workers / gunicorn -w 2 gunicorn_test:app -b unix:/tmp/gunicorn.sock
  3. $ ab -c 100 -n 1000 http://127.0.0.1:81/
  4. This is ApacheBench, Version 2.3 <$Revision: 655654 $>
  5. Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
  6. Licensed to The Apache Software Foundation, http://www.apache.org/
  7. Benchmarking 127.0.0.1 (be patient)
  8. Completed 100 requests
  9. Completed 200 requests
  10. Completed 300 requests
  11. Completed 400 requests
  12. Completed 500 requests
  13. Completed 600 requests
  14. Completed 700 requests
  15. Completed 800 requests
  16. Completed 900 requests
  17. Completed 1000 requests
  18. Finished 1000 requests
  19. Server Software: nginx
  20. Server Hostname: 127.0.0.1
  21. Server Port: 81
  22. Document Path: /
  23. Document Length: 14 bytes
  24. Concurrency Level: 100
  25. Time taken for tests: 0.182 seconds
  26. Complete requests: 1000
  27. Failed requests: 0
  28. Write errors: 0
  29. Total transferred: 173000 bytes
  30. HTML transferred: 14000 bytes
  31. Requests per second: 5493.15 [#/sec] (mean)
  32. Time per request: 18.205 [ms] (mean)
  33. Time per request: 0.182 [ms] (mean, across all concurrent requests)
  34. Transfer rate: 928.04 [Kbytes/sec] received
  35. Connection Times (ms)
  36. min mean[+/-sd] median max
  37. Connect: 0 0 0.7 0 4
  38. Processing: 1 17 3.3 18 20
  39. Waiting: 1 17 3.4 18 20
  40. Total: 5 17 2.7 18 20
  41. Percentage of the requests served within a certain time (ms)
  42. 50% 18
  43. 66% 18
  44. 75% 19
  45. 80% 19
  46. 90% 19
  47. 95% 19
  48. 98% 20
  49. 99% 20
  50. 100% 20 (longest request)
  51. # gunicorn with 2 meinheld workers / gunicorn -k "egg:meinheld#gunicorn_worker" -w 2 gunicorn_test:app -b unix:/tmp/gunicorn.sock
  52. $ ab -c 100 -n 1000 http://127.0.0.1:81/
  53. This is ApacheBench, Version 2.3 <$Revision: 655654 $>
  54. Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
  55. Licensed to The Apache Software Foundation, http://www.apache.org/
  56. Benchmarking 127.0.0.1 (be patient)
  57. Completed 100 requests
  58. Completed 200 requests
  59. Completed 300 requests
  60. Completed 400 requests
  61. Completed 500 requests
  62. Completed 600 requests
  63. Completed 700 requests
  64. Completed 800 requests
  65. Completed 900 requests
  66. Completed 1000 requests
  67. Finished 1000 requests
  68. Server Software: nginx/1.0.0
  69. Server Hostname: 127.0.0.1
  70. Server Port: 81
  71. Document Path: /
  72. Document Length: 13 bytes
  73. Concurrency Level: 100
  74. Time taken for tests: 0.076 seconds
  75. Complete requests: 1000
  76. Failed requests: 0
  77. Write errors: 0
  78. Total transferred: 155155 bytes
  79. HTML transferred: 13013 bytes
  80. Requests per second: 13148.73 [#/sec] (mean)
  81. Time per request: 7.605 [ms] (mean)
  82. Time per request: 0.076 [ms] (mean, across all concurrent requests)
  83. Transfer rate: 1992.28 [Kbytes/sec] received
  84. Connection Times (ms)
  85. min mean[+/-sd] median max
  86. Connect: 0 1 0.8 1 4
  87. Processing: 1 6 1.9 6 13
  88. Waiting: 1 6 1.9 5 13
  89. Total: 3 7 1.8 7 13
  90. Percentage of the requests served within a certain time (ms)
  91. 50% 7
  92. 66% 7
  93. 75% 8
  94. 80% 9
  95. 90% 10
  96. 95% 10
  97. 98% 12
  98. 99% 13
  99. 100% 13 (longest request)
  100. # gunicorn with 2 gevent workers / gunicorn -k gevent -w 2 gunicorn_test:app -b unix:/tmp/gunicorn.sock
  101. $ ab -c 100 -n 1000 http://127.0.0.1:81/
  102. This is ApacheBench, Version 2.3 <$Revision: 655654 $>
  103. Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
  104. Licensed to The Apache Software Foundation, http://www.apache.org/
  105. Benchmarking 127.0.0.1 (be patient)
  106. Completed 100 requests
  107. Completed 200 requests
  108. Completed 300 requests
  109. Completed 400 requests
  110. Completed 500 requests
  111. Completed 600 requests
  112. Completed 700 requests
  113. Completed 800 requests
  114. Completed 900 requests
  115. Completed 1000 requests
  116. Finished 1000 requests
  117. Server Software: nginx/1.0.0
  118. Server Hostname: 127.0.0.1
  119. Server Port: 81
  120. Document Path: /
  121. Document Length: 13 bytes
  122. Concurrency Level: 100
  123. Time taken for tests: 0.193 seconds
  124. Complete requests: 1000
  125. Failed requests: 0
  126. Write errors: 0
  127. Total transferred: 155000 bytes
  128. HTML transferred: 13000 bytes
  129. Requests per second: 5177.48 [#/sec] (mean)
  130. Time per request: 19.314 [ms] (mean)
  131. Time per request: 0.193 [ms] (mean, across all concurrent requests)
  132. Transfer rate: 783.70 [Kbytes/sec] received
  133. Connection Times (ms)
  134. min mean[+/-sd] median max
  135. Connect: 0 0 0.6 0 3
  136. Processing: 1 18 6.9 18 37
  137. Waiting: 1 18 6.9 18 37
  138. Total: 4 18 6.7 18 37
  139. Percentage of the requests served within a certain time (ms)
  140. 50% 18
  141. 66% 22
  142. 75% 23
  143. 80% 24
  144. 90% 26
  145. 95% 29
  146. 98% 35
  147. 99% 37
  148. 100% 37 (longest request)
  149. # gunicorn with 8 gevent workers / gunicorn -k gevent -w 8 gunicorn_test:app -b unix:/tmp/gunicorn.sock
  150. $ ab -c 100 -n 1000 http://127.0.0.1:81/
  151. This is ApacheBench, Version 2.3 <$Revision: 655654 $>
  152. Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
  153. Licensed to The Apache Software Foundation, http://www.apache.org/
  154. Benchmarking 127.0.0.1 (be patient)
  155. Completed 100 requests
  156. Completed 200 requests
  157. Completed 300 requests
  158. Completed 400 requests
  159. Completed 500 requests
  160. Completed 600 requests
  161. Completed 700 requests
  162. Completed 800 requests
  163. Completed 900 requests
  164. Completed 1000 requests
  165. Finished 1000 requests
  166. Server Software: nginx/1.0.0
  167. Server Hostname: 127.0.0.1
  168. Server Port: 81
  169. Document Path: /
  170. Document Length: 13 bytes
  171. Concurrency Level: 100
  172. Time taken for tests: 0.115 seconds
  173. Complete requests: 1000
  174. Failed requests: 0
  175. Write errors: 0
  176. Total transferred: 155142 bytes
  177. HTML transferred: 13000 bytes
  178. Requests per second: 8671.00 [#/sec] (mean)
  179. Time per request: 11.533 [ms] (mean)
  180. Time per request: 0.115 [ms] (mean, across all concurrent requests)
  181. Transfer rate: 1313.71 [Kbytes/sec] received
  182. Connection Times (ms)
  183. min mean[+/-sd] median max
  184. Connect: 0 3 1.0 2 6
  185. Processing: 1 8 2.2 8 18
  186. Waiting: 1 7 2.1 7 15
  187. Total: 4 11 2.2 11 21
  188. Percentage of the requests served within a certain time (ms)
  189. 50% 11
  190. 66% 12
  191. 75% 12
  192. 80% 13
  193. 90% 14
  194. 95% 15
  195. 98% 16
  196. 99% 17
  197. 100% 21 (longest request)
  198. # uwsgi 8 processes / uwsgi -s /tmp/uwsgi.sock -L -l 1000 -M -p 8 -O2 --home ~/ve/meinheld -w gunicorn_test:app
  199. $ ab -c 100 -n 1000 http://127.0.0.1:82/
  200. This is ApacheBench, Version 2.3 <$Revision: 655654 $>
  201. Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
  202. Licensed to The Apache Software Foundation, http://www.apache.org/
  203. Benchmarking 127.0.0.1 (be patient)
  204. Completed 100 requests
  205. Completed 200 requests
  206. Completed 300 requests
  207. Completed 400 requests
  208. Completed 500 requests
  209. Completed 600 requests
  210. Completed 700 requests
  211. Completed 800 requests
  212. Completed 900 requests
  213. Completed 1000 requests
  214. Finished 1000 requests
  215. Server Software: nginx/1.0.0
  216. Server Hostname: 127.0.0.1
  217. Server Port: 82
  218. Document Path: /
  219. Document Length: 13 bytes
  220. Concurrency Level: 100
  221. Time taken for tests: 0.083 seconds
  222. Complete requests: 1000
  223. Failed requests: 0
  224. Write errors: 0
  225. Total transferred: 155155 bytes
  226. HTML transferred: 13013 bytes
  227. Requests per second: 12114.75 [#/sec] (mean)
  228. Time per request: 8.254 [ms] (mean)
  229. Time per request: 0.083 [ms] (mean, across all concurrent requests)
  230. Transfer rate: 1835.61 [Kbytes/sec] received
  231. Connection Times (ms)
  232. min mean[+/-sd] median max
  233. Connect: 0 1 0.6 1 3
  234. Processing: 1 7 1.1 7 9
  235. Waiting: 1 7 1.1 7 8
  236. Total: 4 8 0.8 8 10
  237. Percentage of the requests served within a certain time (ms)
  238. 50% 8
  239. 66% 8
  240. 75% 8
  241. 80% 8
  242. 90% 9
  243. 95% 9
  244. 98% 9
  245. 99% 10
  246. 100% 10 (longest request)
  247. # gunicorn with 2 meinheld workers (ab w/keep-alives) / gunicorn -k "egg:meinheld#gunicorn_worker" -w 2 gunicorn_test:app -b unix:/tmp/gunicorn.sock
  248. $ ab -k -c 100 -n 1000 http://127.0.0.1:81/
  249. This is ApacheBench, Version 2.3 <$Revision: 655654 $>
  250. Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
  251. Licensed to The Apache Software Foundation, http://www.apache.org/
  252. Benchmarking 127.0.0.1 (be patient)
  253. Completed 100 requests
  254. Completed 200 requests
  255. Completed 300 requests
  256. Completed 400 requests
  257. Completed 500 requests
  258. Completed 600 requests
  259. Completed 700 requests
  260. Completed 800 requests
  261. Completed 900 requests
  262. Completed 1000 requests
  263. Finished 1000 requests
  264. Server Software: nginx/1.0.0
  265. Server Hostname: 127.0.0.1
  266. Server Port: 81
  267. Document Path: /
  268. Document Length: 13 bytes
  269. Concurrency Level: 100
  270. Time taken for tests: 0.050 seconds
  271. Complete requests: 1000
  272. Failed requests: 0
  273. Write errors: 0
  274. Keep-Alive requests: 1000
  275. Total transferred: 160160 bytes
  276. HTML transferred: 13013 bytes
  277. Requests per second: 20079.51 [#/sec] (mean)
  278. Time per request: 4.980 [ms] (mean)
  279. Time per request: 0.050 [ms] (mean, across all concurrent requests)
  280. Transfer rate: 3140.56 [Kbytes/sec] received
  281. Connection Times (ms)
  282. min mean[+/-sd] median max
  283. Connect: 0 0 0.6 0 3
  284. Processing: 1 4 1.6 4 8
  285. Waiting: 1 4 1.6 4 8
  286. Total: 2 5 1.7 4 8
  287. Percentage of the requests served within a certain time (ms)
  288. 50% 4
  289. 66% 5
  290. 75% 6
  291. 80% 7
  292. 90% 7
  293. 95% 7
  294. 98% 8
  295. 99% 8
  296. 100% 8 (longest request)
  297. # uwsgi 8 processes (ab w/keep-alives) / uwsgi -s /tmp/uwsgi.sock -L -l 1000 -M -p 8 -O2 --home ~/ve/meinheld -w gunicorn_test:app
  298. ab -k -c 100 -n 1000 http://127.0.0.1:82/
  299. This is ApacheBench, Version 2.3 <$Revision: 655654 $>
  300. Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
  301. Licensed to The Apache Software Foundation, http://www.apache.org/
  302. Benchmarking 127.0.0.1 (be patient)
  303. Completed 100 requests
  304. Completed 200 requests
  305. Completed 300 requests
  306. Completed 400 requests
  307. Completed 500 requests
  308. Completed 600 requests
  309. Completed 700 requests
  310. Completed 800 requests
  311. Completed 900 requests
  312. Completed 1000 requests
  313. Finished 1000 requests
  314. Server Software: nginx/1.0.0
  315. Server Hostname: 127.0.0.1
  316. Server Port: 82
  317. Document Path: /
  318. Document Length: 13 bytes
  319. Concurrency Level: 100
  320. Time taken for tests: 0.070 seconds
  321. Complete requests: 1000
  322. Failed requests: 0
  323. Write errors: 0
  324. Keep-Alive requests: 1000
  325. Total transferred: 160480 bytes
  326. HTML transferred: 13039 bytes
  327. Requests per second: 14333.84 [#/sec] (mean)
  328. Time per request: 6.976 [ms] (mean)
  329. Time per request: 0.070 [ms] (mean, across all concurrent requests)
  330. Transfer rate: 2246.38 [Kbytes/sec] received
  331. Connection Times (ms)
  332. min mean[+/-sd] median max
  333. Connect: 0 0 0.7 0 4
  334. Processing: 1 6 1.1 7 7
  335. Waiting: 1 6 1.1 7 7
  336. Total: 3 7 0.7 7 9
  337. Percentage of the requests served within a certain time (ms)
  338. 50% 7
  339. 66% 7
  340. 75% 7
  341. 80% 7
  342. 90% 7
  343. 95% 7
  344. 98% 7
  345. 99% 7
  346. 100% 9 (longest request)
  347. # nginx.conf
  348. upstream gunicorn_server {
  349. server unix:/tmp/gunicorn.sock fail_timeout=0;
  350. }
  351. server {
  352. server_name localhost;
  353. listen 127.0.0.1:81;
  354. access_log off;
  355. keepalive_timeout 5;
  356. location / {
  357. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  358. proxy_set_header Host $http_host;
  359. proxy_redirect off;
  360. proxy_pass http://gunicorn_server;
  361. proxy_buffering off;
  362. }
  363. }
  364. server {
  365. server_name localhost;
  366. listen 127.0.0.1:82;
  367. access_log off;
  368. keepalive_timeout 5;
  369. location / {
  370. uwsgi_pass unix:/tmp/uwsgi.sock;
  371. include uwsgi_params;
  372. }
  373. }
  374. # gunicorn_test.py
  375. def app(environ, start_response):
  376. data = "Hello, World!"
  377. start_response("200 OK", [
  378. ("Content-Type", "text/plain"),
  379. ("Content-Length", str(len(data)))
  380. ])
  381. return iter([data])
  382.