4 ms·
Has anyone used nginx with cherrypy?
by ahi 17y ago
Has anyone used nginx with cherrypy?
- SyK 17y agoThis is my exact approach for dozens of tiny internal / "glue layer" HTTP servers, all over the place, for a long time now. It's brilliant. Almost effort-free and insanely fast, in most cases. It offers a really cool path too, in nginx + Py -> nginx + Py/C -> nginx + C plugin, to grow from a quick throw-together prototype to something that will take as much load as you can make up with silly benchmarking tools, while development takes a sensible route. Edit: As a cool more concrete example, I used this trick to build a very quick 'hardware access layer' for an embedded device when it was insisted that Flash be used for the UI. It was 99% Python but with nginx to serve static files and proxy the rest to Flash, and CherryPy as an access layer to a local SQLite DB for data, with Python C calls to proprietary hardware drivers for the device. Sounds sloppy perhaps but for what it had to do and how well it runs it was incredibly quick and painless to put together.
- jamwt 17y agoOh yes, lots--works fantastically well. http://shoptalkapp.com http://shoptalkapp.com is nginx -> haproxy -> (cherrypy/diesel)
- z8000 17y agoI'm curious why haproxy is in the mix. There's a couple of better balancers for nginx if that's why.
- SyK 17y agoWhy haproxy? I've always seen it as more of an incoming traffic choice, and actually use it in front of nginx clusters in some cases, this seems confusing.
- jamwt 17y agoIf you're doing SSL work, something that does SSL decryption needs to be in front. So I can't do my fancy HAProxy routing rules on HTTP requests HAProxy can't read--it would be reduced to a simple TCP-level balancer then. Basically, nginx is there for ssl, gzip, caching (redis/memcache mod), and all those http-plugin-goodness things. Simple proxy directly to HAProxy on loopback, which specializes in load balancing, traffic routing, failover, etc. Then, finally, the application code on N nodes behind HAProxy.
- jamwt 17y agoHAProxy supports sophisticated balancing schemes, rule-based backend selection, etc. I.e., if Host header is X, and Ip is Y, but no cookie was provided, then use pool... with this balancing scheme. nginx's proxy setup out of the box is useful, but I wouldn't consider it on par with things like ZXTM or a Big IP when it comes to robust balancing/fallback patterns and flexible routing rules. If there's a module that provides all that, I'm happy to hear about it--I haven't found it yet.
- rlpb 17y agoI'm using this combination for the (low traffic) dynamic parts of my site. It seems to work fine.