tag:blogger.com,1999:blog-18508356.post3149996160727973533..comments2026-02-13T11:24:21.556-05:00Comments on Just a little Python: Building Web Applications with Gevent's WSGI ServerRick Copelandhttp://www.blogger.com/profile/11612114223288841087noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-18508356.post-5483478748734351812013-07-09T10:50:44.646-04:002013-07-09T10:50:44.646-04:00Thanks for the info!Thanks for the info!Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-87266960808251667442013-07-09T10:48:44.385-04:002013-07-09T10:48:44.385-04:00The exception is raised by pyzmq 13.x, see https:/...The exception is raised by pyzmq 13.x, see https://github.com/locustio/locust/issues/58.<br />Remove pyzmq and reinstall it explicitely (download https://pypi.python.org/packages/source/p/pyzmq/pyzmq-2.2.0.1.zip#md5=31d4100d62e352e5e19824ded45aaac9 and run setup.py) will fix the problem...sailoratbayhttps://www.blogger.com/profile/04460688848830067187noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-6242457100985283822013-06-27T13:46:04.568-04:002013-06-27T13:46:04.568-04:00Hmm, that&#39;s strange -- I&#39;m using the follo...Hmm, that&#39;s strange -- I&#39;m using the following versions right now without any errors. It does sound like you probably have some kind of a version mismatch. (I don&#39;t think I&#39;m actually using zmq in my prod site, though, so that might explain it.)<br /><br />pastegevent==0.1<br />gevent==0.13.8<br />gevent-zeromq==0.2.5Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-35023243064233016382013-06-23T11:29:12.225-04:002013-06-23T11:29:12.225-04:00This is a great write up, thank you. I think that ...This is a great write up, thank you. I think that version changes are conspiring against me when trying to use these techniques - I&#39;m getting this error:<br /><br />AttributeError: GreenSocket has no such option: _GREENSOCKET__IN_SEND_MULTIPART<br /><br />Google isn&#39;t much help - I&#39;m getting one result, which is a bug report for locust. The maintainer simply removed gevent_zmq from the build.<br /><br />I tried using zmq directly, but we get a lockup in gevent.sleep in zmq_producer - gevent.sleep never returns.<br /><br />Any ideas how best to proceed?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-18508356.post-31470086579039136222013-01-12T10:27:48.140-05:002013-01-12T10:27:48.140-05:00I don&#39;t see any reason why you wouldn&#39;t be...I don&#39;t see any reason why you wouldn&#39;t be able to do this, so long as you don&#39;t write ourServerApp with any assumptions about what server it&#39;s running under (for instance, using any of the gevent library methods would probably not be compatible with running under a multithreaded WSGI server).Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-64652226232208072102013-01-12T08:36:18.966-05:002013-01-12T08:36:18.966-05:00We want to provide developers with ourServerApp (=...We want to provide developers with ourServerApp (= ourApp + gevent.pywsgi). They should be able to run this configuration as-is for development and testing.<br /><br />For production, they can add (around ourServerApp) their preferred wsgi (application) webserver (including gunicorn, django etc.) and a &#39;proper&#39; web server such as nginx at the front.<br /><br />Is this possible?dbvnoreply@blogger.comtag:blogger.com,1999:blog-18508356.post-83672755773164270792012-12-18T10:45:31.913-05:002012-12-18T10:45:31.913-05:00Hi Rakesh, You can certainly use the gevent wsgi ...Hi Rakesh,<br /><br />You can certainly use the gevent wsgi server to serve static pages; I have an example at http://blog.pythonisito.com/2012/07/realtime-web-chat-with-socketio-and.html if you&#39;re interested. In general, however, for a production system it&#39;s better to use a dedicated static content server or a CDN. Most web frameworks also provide facilities for serving static content (and most Python WSGI framework can be run inside the gevent wsgi servers).<br /><br />Thanks for the comment!Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-91705413301609180832012-12-18T00:53:09.710-05:002012-12-18T00:53:09.710-05:00how to serve the static pages .. ?? is there a met...how to serve the static pages .. ?? is there a method in which gevent can be run as standalone server for both wsgi and its static contents. Rakesh Patilhttps://www.blogger.com/profile/13168635975230208853noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-60470220298063085542012-08-27T12:01:41.898-04:002012-08-27T12:01:41.898-04:00@scape: Thanks for the comment! I believe that&#39...@scape: Thanks for the comment! I believe that&#39;s exactly the approach used with gunicorn+gevent (one interpreter monitors multiple worker processes, each of which use gevent for async networking and greenlets).Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-18668355605536098932012-08-26T08:24:42.746-04:002012-08-26T08:24:42.746-04:00a way to utilize multicore when running with geven...a way to utilize multicore when running with gevent: run more than one python interpreter-- though it likely takes some forethought in program-design.scapehttp://juncoapps.comnoreply@blogger.comtag:blogger.com,1999:blog-18508356.post-78142475354654099892012-08-20T09:13:11.952-04:002012-08-20T09:13:11.952-04:00Thanks, Sergey! Glad you found it useful!Thanks, Sergey! Glad you found it useful!Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-14966474532683495282012-08-19T05:02:37.591-04:002012-08-19T05:02:37.591-04:00Cool! now I know how to write HTTP streaming serve...Cool!<br />now I know how to write HTTP streaming server for testing purposes <br />thanks a lot for post !!!Anonymoushttps://www.blogger.com/profile/03075141187336066805noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-88530737237354754442012-08-08T16:40:15.739-04:002012-08-08T16:40:15.739-04:00Gunicorn is more of a &quot;server manager&quot; t...Gunicorn is more of a &quot;server manager&quot; that spawns multiple worker processes, each of which could be a) synchronous, b) async (using gevent), or c) async (using tornado). In general, the gevent server will probably be easier to initially set up and configure, but on a multicore system, you&#39;ll probably get better performance out of gunicorn (possibly with gevent workers). (See <a href="http://gunicorn.org/design.html" rel="nofollow">http://gunicorn.org/design.html</a> for details on how to choose worker types in Gunicorn).Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-10661895740432981092012-08-08T16:32:40.256-04:002012-08-08T16:32:40.256-04:00I&#39;m new to all this. How is gevent&#39;s WSGI...I&#39;m new to all this. How is gevent&#39;s WSGI server related to Gunicorn? Does one use the other? Are they &#39;competing&#39; products?Greghttps://www.blogger.com/profile/09476585982697091505noreply@blogger.com