from gevent import pywsgi  ("""A WSGI server based on :class:`StreamServer`
that supports HTTPS.""")
instead of
from gevent import wsgi

gevent.wsgi doesn't support streaming and ssl

and I use an option spawn=Pool(96),
it allows to limit the number of connections

parser.add_option('-w',
                      '--workers',
                      default='',
                      dest='workers',
                      help='number of workers number')


    @staticmethod
    def gevent(app,address, **options):
        from gevent import monkey; monkey.patch_all()
        from gevent import pywsgi
        from gevent.pool import Pool
        pywsgi.WSGIServer(address, app, spawn = 'workers' in options and
Pool(int(option.workers)) or 'default').serve_forever()

Attachment: anyserver.py
Description: Binary data

Reply via email to