On Fri, Jun 8, 2012 at 9:28 PM, Biswas, Pinakee <[email protected]> wrote: > With so many options available, it becomes a bit confusing to conclude on a > specific design J: > > 1. Whether to embed the Pylons/Pyramid application in a light weight > web server (like nginx as suggested by Jonathan) if possible > > 2. Or to redirect the network HTTP traffic from the web server to the > WSGI servers (pastehttpserver, cherrypy etc.)? > > > > Which one would be the best approach in terms of performance? As far as my > knowledge goes, I think 2 would be good if we have distributed systems > wherein the webserver distributes the load across multiple instances of the > WSGI server (given that the webserver is a light weight process just routing > traffic between the WSGI servers and network).
Embedding using nginx, mod_wsgi, or maybe uwsgi is more performant. #2 is called a reverse proxy, and from what I've read there's significant overhead in converting one HTTP request to a different HTTP request for forwarding. FastCGI/scgi/mod_wsgi, etc, are supposed to be more efficient protocols than proxying. I use proxying because it's simpler and more foolproof. I can use a text web browser on the server to contact the WSGI port directly for testing/troubleshooting, to tell whether a blockage is in the Python code or in Apache. I can run functional tests (Twill) on it just like the development environment. My sites are moderate usage so I don't have to worry about hardware capacity. For load distribution, you'd use a real load balancer at the front end. Each backend server would run its own instance of Nginx/Apache. So it doesn't change anything re WSGI choices on those servers. -- Mike Orr <[email protected]> -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
