Domanda

I want to try playing around with gevent as a web server and application framework. I don't see any way to "restart" the server or update the application code without killing and starting the whole python application again.

Is this just how it's done? Maybe it's just a matter of me understanding a different paradigm to the apache way.

Also, as a semi-related question, is it even a good idea to run a web server AND the site/service itself through gevent. I've seen other implementations using gunicorn for the server and gevent for the application but from the benchmarks I've seen, gevent far outperforms gunicorn as a server when it comes to scaling.

È stato utile?

Soluzione

Gunicorn has 3 gevent workers:

  • -k gevent (using gunicorn's HTTP parser)
  • -k gevent_pywsgi (using gevent.pywsgi module)
  • -k gevent_wsgi (using gevent.wsgi module)

gevent.wsgi is a fast HTTP server based on libevent.

gevent.pywsgi is WSGI server implemented in Python.

The reason for existence of gevent.pywsgi is libevent-http having a few limitations, such as not supporting keep-alive, streaming, ssl and websockets.

Note, that the new alpha version (1.0a3) of gevent uses libev and does not include a WSGI server based on libevent-http. Currently, gevent.wsgi here is an alias for gevent.pywsgi.

The server classes in gevent don't have any features related to process management, restart, reload and so on. Those features are necessary for deployment though. Gunicorn provides that for gevent's WSGI servers. Use it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top