Async IO Server with Blocking DB

Laszlo Nagy gandalf at shopzeus.com
Fri Apr 6 13:28:55 EDT 2012


There is asyncmongo!

http://pypi.python.org/pypi/asyncmongo/0.1.3

Although I have never tried it. It has support for async I/O for mongodb 
and tornadoweb. Here is a bit old article about it:

http://www.dunnington.net/entry/asynchronous-mongodb-in-tornado-with-asyncmongo

I have a related question. I just ran into this post, when I was 
wondering how to implement sessions with tornado. It is also a blocking 
db access, right? Say, what if I run four instances of tornado on a 
computer (one instance per CPU core) and load-balance requests between 
these instances with ngnix. It cannot be guaranteed that requests from 
the same user will always go to the same web server process. So the same 
session must somehow be accessed from multiple processes. But tornado 
does not have built-in session support.  I have read this article about 
the issue:

http://milancermak.posterous.com/benchmarking-tornados-sessions-0

but I found no actual code for session managers. Does anyone know a 
good, tested implementation of sessions for tornado? Or should I just 
create my own? I'm thinking about running mongodb and using it for 
storing sessions (plus also using it for storing application data...)

Thanks

    Laszlo




More information about the Python-list mailing list