Last active
December 16, 2015 23:09
-
-
Save kracekumar/5512421 to your computer and use it in GitHub Desktop.
Hello world bench mark between brubeck.io and diesel.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| from brubeck.request_handling import Brubeck, WebMessageHandler | |
| from brubeck.connections import Mongrel2Connection | |
| import sys | |
| class DemoHandler(WebMessageHandler): | |
| def get(self): | |
| name = self.get_argument('name', 'dude') | |
| self.set_body('Take five, %s!' % name) | |
| return self.render() | |
| config = { | |
| 'msg_conn': Mongrel2Connection('tcp://127.0.0.1:9999', | |
| 'tcp://127.0.0.1:9998'), | |
| 'handler_tuples': [(r'^/brubeck', DemoHandler)], | |
| } | |
| app = Brubeck(**config) | |
| app.run() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from diesel.web import DieselFlask | |
| app = DieselFlask(__name__) | |
| @app.route('/') | |
| def index(): | |
| return "Hello world12345" | |
| app.run() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| brubeck_handler = Handler( | |
| send_spec='tcp://127.0.0.1:9999', | |
| send_ident='34f9ceee-cd52-4b7f-b197-88bf2f0ec378', | |
| recv_spec='tcp://127.0.0.1:9998', | |
| recv_ident='') | |
| media_dir = Dir( | |
| base='media/', | |
| index_file='index.html', | |
| default_ctype='text/plain') | |
| brubeck_host = Host( | |
| name="localhost", | |
| routes={ | |
| '/media/': media_dir, | |
| '/': brubeck_handler}) | |
| brubeck_serv = Server( | |
| uuid="f400bf85-4538-4f7a-8908-67e313d515c2", | |
| access_log="/log/mongrel2.access.log", | |
| error_log="/log/mongrel2.error.log", | |
| chroot="./", | |
| default_host="localhost", | |
| name="brubeck test", | |
| pid_file="/run/mongrel2.pid", | |
| port=6767, | |
| hosts = [brubeck_host] | |
| ) | |
| settings = { "zeromq.threads": 1, 'limits.content_length': 10485760, 'upload.temp_store': '/tmp/mongrel2.upload.XXXXXX' } | |
| servers = [brubeck_serv] |
Author
Author
Brubeck: demo_noclasses.py
siege -u http://localhost:6767/brubeck -c50 -r2
Transactions: 100 hits
Availability: 100.00 %
Elapsed time: 2.05 secs
Data transferred: 0.00 MB
Response time: 0.03 secs
Transaction rate: 48.78 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 1.59
Successful transactions: 100
Failed transactions: 0
Longest transaction: 0.10
Shortest transaction: 0.01
siege -u http://localhost:8080 -c50 -r2
Transactions: 100 hits
Availability: 100.00 %
Elapsed time: 2.03 secs
Data transferred: 0.00 MB
Response time: 0.01 secs
Transaction rate: 49.26 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 0.64
Successful transactions: 100
Failed transactions: 0
Longest transaction: 0.02
Shortest transaction: 0.00
siege -u http://localhost:6767/brubeck -c50 -r20
Transactions: 1000 hits
Availability: 100.00 %
Elapsed time: 14.16 secs
Data transferred: 0.02 MB
Response time: 0.00 secs
Transaction rate: 70.62 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 0.32
Successful transactions: 1000
Failed transactions: 0
Longest transaction: 0.06
Shortest transaction: 0.00
siege -u http://localhost:8080 -c50 -r20
Transactions: 1000 hits
Availability: 100.00 %
Elapsed time: 15.06 secs
Data transferred: 0.02 MB
Response time: 0.01 secs
Transaction rate: 66.40 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 0.35
Successful transactions: 1000
Failed transactions: 0
Longest transaction: 0.03
Shortest transaction: 0.00
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
siege -u http://localhost:6767/brubeck -c50 -r20siege -u http://localhost:8080 -c50 -r20