diff --git a/README.md b/README.md index e4bf7457..e268881f 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ All tests were run on a AWS medium instance running ubuntu, using 1 process. Ea | Server | Implementation | Requests/sec | Avg Latency | | ------- | ------------------- | ------------:| -----------:| | Sanic | Python 3.5 + uvloop | 29,128 | 3.40ms | +| Wheezy | gunicorn + meinheld | 20,244 | 4.94ms | | Falcon | gunicorn + meinheld | 18,972 | 5.27ms | | Flask | gunicorn + meinheld | 4,988 | 20.08ms | | Aiohttp | Python 3.5 + uvloop | 2,974 | 33.49ms | diff --git a/tests/performance/wheezy/simple_server.py b/tests/performance/wheezy/simple_server.py new file mode 100644 index 00000000..99a9f1e4 --- /dev/null +++ b/tests/performance/wheezy/simple_server.py @@ -0,0 +1,46 @@ +# Run with: gunicorn --workers=1 --worker-class=meinheld.gmeinheld.MeinheldWorker simple_server:main +""" Minimal helloworld application. +""" + +from wheezy.http import HTTPResponse +from wheezy.http import WSGIApplication +from wheezy.http.response import json_response +from wheezy.routing import url +from wheezy.web.handlers import BaseHandler +from wheezy.web.middleware import bootstrap_defaults +from wheezy.web.middleware import path_routing_middleware_factory + +import ujson + +class WelcomeHandler(BaseHandler): + + def get(self): + response = HTTPResponse(content_type='application/json; charset=UTF-8') + response.write(ujson.dumps({"test":True})) + return response + +all_urls = [ + url('', WelcomeHandler, name='default'), +# url('', welcome, name='welcome') +] + + +options = {} +main = WSGIApplication( + middleware=[ + bootstrap_defaults(url_mapping=all_urls), + path_routing_middleware_factory + ], + options=options +) + + +if __name__ == '__main__': + import sys + from wsgiref.simple_server import make_server + try: + print('Visit http://localhost:{}/'.format(sys.argv[-1])) + make_server('', int(sys.argv[-1]), main).serve_forever() + except KeyboardInterrupt: + pass + print('\nThanks!')