Skip to content

Instantly share code, notes, and snippets.

@dcramer
Last active December 13, 2015 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dcramer/4950101 to your computer and use it in GitHub Desktop.
Save dcramer/4950101 to your computer and use it in GitHub Desktop.
gevent hello world w/ apache bench from an AWS m1.large to Heroku
$ ab -c 100 -t 60 http://pure-depths-6229.herokuapp.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking pure-depths-6229.herokuapp.com (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests
Server Software: gevent/0.13
Server Hostname: pure-depths-6229.herokuapp.com
Server Port: 80
Document Path: /
Document Length: 12 bytes
Concurrency Level: 100
Time taken for tests: 19.182 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 8200000 bytes
HTML transferred: 600000 bytes
Requests per second: 2606.61 [#/sec] (mean)
Time per request: 38.364 [ms] (mean)
Time per request: 0.384 [ms] (mean, across all concurrent requests)
Transfer rate: 417.46 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 2 26.9 1 3010
Processing: 4 36 53.0 28 1326
Waiting: 4 36 53.0 28 1326
Total: 5 38 59.3 29 3036
Percentage of the requests served within a certain time (ms)
50% 29
66% 32
75% 35
80% 37
90% 46
95% 69
98% 132
99% 307
100% 3036 (longest request)
$ ab -c 500 -t 60 http://pure-depths-6229.herokuapp.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking pure-depths-6229.herokuapp.com (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests
Server Software: gevent/0.13
Server Hostname: pure-depths-6229.herokuapp.com
Server Port: 80
Document Path: /
Document Length: 12 bytes
Concurrency Level: 500
Time taken for tests: 17.181 seconds
Complete requests: 50000
Failed requests: 10
(Connect: 0, Receive: 0, Length: 10, Exceptions: 0)
Write errors: 0
Total transferred: 8198360 bytes
HTML transferred: 599880 bytes
Requests per second: 2910.13 [#/sec] (mean)
Time per request: 171.814 [ms] (mean)
Time per request: 0.344 [ms] (mean, across all concurrent requests)
Transfer rate: 465.98 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 3 74 436.1 15 9042
Processing: 13 85 104.8 49 1800
Waiting: 0 85 104.8 49 1800
Total: 26 159 448.6 65 9297
Percentage of the requests served within a certain time (ms)
50% 65
66% 78
75% 99
80% 122
90% 196
95% 390
98% 962
99% 3068
100% 9297 (longest request)
from gevent.wsgi import WSGIServer
import gevent.monkey
import os
gevent.monkey.patch_all()
def application(environ, start_response):
status = '200 OK'
headers = [
('Content-Type', 'text/html')
]
start_response(status, headers)
return ['Hello World!']
WSGIServer(('', int(os.environ.get('PORT', 8000))), application).serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment