{"@attributes":{"version":"2.0"},"channel":{"title":"PyVideo.org - libevent","link":"https:\/\/pyvideo.org\/","description":{},"lastBuildDate":"Fri, 11 Mar 2011 00:00:00 +0000","item":{"title":"Using Coroutines to Create Efficient, High-Concurrency Web Applications","link":"https:\/\/pyvideo.org\/pycon-us-2011\/pycon-2011--using-coroutines-to-create-efficient-.html","description":"<h3>Description<\/h3><p>Using Coroutines to Create Efficient, High-Concurrency Web Applications<\/p>\n<p>Presented by Matt Spitz<\/p>\n<p>Creating high-concurrency python web applications is inherently\ndifficult for a variety of reasons. In this talk, I'll discuss the\nvarious iterations of application server paradigms we've used at meebo,\nthe advantages\/disadvantages of each approach, and why we've settled on\na coroutine-based WSGI setup to handle our high-concurrency web\napplications going forward.<\/p>\n<p>Abstract<\/p>\n<p>There are a number of ways in which to create a web application in\npython. Some examples include a straight-up CGI scripts that run anew\nwith each request, preforked Apache workers that each handle multiple\nrequests, and using an asynchronous web framework like Twisted.<\/p>\n<p>At meebo, we've settled on using gunicorn, a lightweight WSGI server,\nwhich supports gevent, a coroutine-based network library for python.\nGevent monkeypatches python's system modules to make network requests\nasynchronous using an event loop based on libevent. This trick allows\nthe developer to use a simple blocking CGI as a non-blocking web\napplication that can handle many concurrent requests.<\/p>\n<p>I'll discuss our iteration process through these approaches to building\nweb applications, why we ended up choosing gunicorn+gevent, the\nchallenges this new framework presents, and how we've dealt with them.<\/p>\n","pubDate":"Fri, 11 Mar 2011 00:00:00 +0000","guid":"tag:pyvideo.org,2011-03-11:\/pycon-us-2011\/pycon-2011--using-coroutines-to-create-efficient-.html","category":["PyCon US 2011","coroutines","gevent","gunicorn","highconcurrency","libevent","pycon","pycon2011","wsgi"]}}}