4 ms·
I use pymongo with gevent. A small hack is necessary to prevent pymongo from making a new connection for each thread that accesses mongodb (because with gevent,
by inportb 15y ago
I use pymongo with gevent. A small hack is necessary to prevent pymongo from making a new connection for each thread that accesses mongodb (because with gevent, you can have a massive number of threads). I'd imagine the same is true with eventlet.
- deepu_256 15y agoDo you mind sharing the details of that hack ??
- inportb 15y agoSure! https://github.com/inportb/playground/blob/master/Pinako/geventmongo/geventmongo.py https://github.com/inportb/playground/blob/master/Pinako/gev...
- robspychala 15y agoBTW, how is the performance compared to sync pymongo in your use? I'm testing with eventlet and seeing it about 10-20% slower. https://gist.github.com/1088452 https://gist.github.com/1088452