News for hackers. Stuff that matters.
Re:Ask HN: What is your preferred Python stack for high traf... by espeed on Sunday August 21, 2011 @11:11PM (#2911142)

  * haproxy - frontline proxy
  * varnish - app server cache
  * nginx - static files
  * uwsgi - app server
  * flask - primary framework
  * tornado - async/comet connections
  * bulbflow - graph database toolkit
  * rabbitmq - queue/messaging
  * redis - caching & sessions
  * neo4j - high performance graph database
  * hadoop - data processing
Re:Ask HN: What is your preferred Python stack for high traf... by lamnk on Monday August 22, 2011 @02:56PM (#2913615)
Why Varnish in front of Nginx? AFAIK Nginx can pretty much handle the role of Varnish.
Re:Ask HN: What is your preferred Python stack for high traf... by espeed on Monday August 22, 2011 @10:02PM (#2915023)
Varnish connects directly to the app servers -- it's not in front of nginx (nginx is to the side serving other content).
Re:Ask HN: What is your preferred Python stack for high traf... by bigethan on Sunday August 21, 2011 @11:23PM (#2911171)
Any particular reason you chose Tornado over other options? I know that they each have their strengths, was wondering which strengths you valued.

And for the web frame works side, have you found flask to be too light at times?

Re:Ask HN: What is your preferred Python stack for high traf... by espeed on Monday August 22, 2011 @12:14AM (#2911275)
Tornado is solid and proven, however we will explore gevent on uwsgi more in the future. Using gevent for comet/async would enable us to consolidate the Tornado code into Flask, but we have been focused on other stuff so we'll test gevent when we have more time.

Flask is at about the right level of abstraction for what a Web framework should be these days. In this era of the social graph, it can be more interesting to store your social graph in a graph database and use it as your primary datastore. And if you're not using a relational database as the primary datastore, why would you want a framework that's built around an ORM?

ORM-based frameworks are ok if you stay inside the box, but they can get in the way when you're not using the RDBMS for authentication and authorization. And when you strip out all the stuff that's tied to the ORM and auth, you end up with with something that looks a lot like Flask. It's usually cleaner to start with something that was designed from the ground up to be a polyglot framework.

P.S. We chose uswgi because it's high performance and high quality (Roberto is a really smart guy), and there's a little-known feature in works -- uwsgi binary connectors to varnish and haproxy that will enable you to connect uwsgi directly to varnish and haproxy over a binary protocol and thus eliminate the HTTP overhead.

Varnish has a modern architecture that's superior to most of the other Web caches (https://www.varnish-cache.org/trac/wiki/ArchitectNotes) -- it was designed by Poul-Henning Kamp, the FreeBSD kernel hacker, and the code is so clean it was published as a book (http://phk.freebsd.dk/misc/_book2.pdf)

Re:Ask HN: What is your preferred Python stack for high traf... by reinhardt on Monday August 22, 2011 @09:27AM (#2912358)
I don't hear varnish and haproxy being used together often, especially when nginx is also in the mix. Are they really complementary and worth the extra complexity?
Re:Ask HN: What is your preferred Python stack for high traf... by ghotli on Monday August 22, 2011 @10:20AM (#2912522)
At scale yes. They're built to solve different problems and excel at each individually. Nginx can proxy, but HAProxy is more flexible. Nginx can cache, but Varnish is much more flexible and efficient. We use all three technologies and route the traffic to the service best suited for the traffic.
Re:Ask HN: What is your preferred Python stack for high traf... by coderdude on Monday August 22, 2011 @12:08AM (#2911258)
That is the hippest stack I've ever seen. :)

Makes me want to try a few of those that are new to me though.