I'm working on a small Pyramid app that is going to be finished soon, so now I'm starting to think about the way I'm going to deploy it.
Most Pyramid deployment tutorials suggest using nginx as a reverse proxy for pserve. Since a Pyramid application is just a wsgi app, I could also deploy it as nginx + wsgi, without using reverse proxy. I guess the latter will be a little harder since I'm completely new to all that stuff, but intuitively it should work faster.
So the question is: is there any considerable performance difference between nginx + pserve and nginx + wsgi deployment scenarios?
Well, first of all - pserve
is just a launcher - that launches Waitress
. Waitress is a WSGI server, so you're already using WSGI in that case. If the question is whether that's enough to run in production: I'd say that yes, that would work just fine. Start there, and worry about performance if it becomes an issue. The other popular WSGI server is Gunicorn, but it might not get you more performance, as depending on your application load and request pattern, there might not be much time spent in the WSGI part anyways.
nginx+pserve (w/waitress)+supervisord is a good setup and has served us well for low traffic sites, at least.
There are other recipes for other deployment strategies available in the Pyramid cookbook, but my suggestion is to just go ahead and deploy it and worry about that later.