Skip to content

Commit bd57514

Browse files
A. Jesse Jiryu Davisbehackett
authored andcommitted
Update Tornado and Twisted recommendations
1 parent 59f30ba commit bd57514

File tree

2 files changed

+6
-35
lines changed

2 files changed

+6
-35
lines changed

doc/faq.rst

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -38,41 +38,15 @@ Starting with version 2.2 PyMongo supports Python 3.x where x >= 1. See the
3838

3939
Does PyMongo support asynchronous frameworks like Gevent, Tornado, or Twisted?
4040
------------------------------------------------------------------------------
41-
The only async framework that PyMongo fully supports is `Gevent
42-
<http://www.gevent.org/>`_.
4341

44-
Currently there is no great way to use PyMongo in conjunction with `Tornado
45-
<http://www.tornadoweb.org/>`_ or `Twisted <http://twistedmatrix.com/>`_.
46-
PyMongo provides built-in connection pooling, so some of the benefits of those
47-
frameworks can be achieved just by writing multi-threaded code that shares a
48-
:class:`~pymongo.mongo_client.MongoClient`.
42+
PyMongo fully supports :doc:`Gevent <examples/gevent>`.
4943

50-
There are asynchronous MongoDB drivers in Python: `Motor for Tornado
51-
<https://github.com/mongodb/motor>`_ and `TxMongo for Twisted
52-
<http://github.com/fiorix/mongo-async-python-driver>`_. Compared to PyMongo,
53-
however, these projects are less stable, lack features, and are less actively
54-
maintained.
55-
56-
It is possible to use PyMongo with Tornado, if some precautions are taken to
57-
avoid blocking the event loop:
58-
59-
- Make sure all MongoDB operations are very fast. Use the
60-
`MongoDB profiler <http://www.mongodb.org/display/DOCS/Database+Profiler>`_
61-
to watch for slow queries.
44+
To use MongoDB with `Tornado <http://www.tornadoweb.org/>`_ see the
45+
`Motor <https://github.com/mongodb/motor>`_ project.
6246

63-
- Create a single :class:`~pymongo.mongo_client.MongoClient` instance for your
64-
application in your startup code, before starting the IOLoop.
65-
66-
- Configure the :class:`~pymongo.mongo_client.MongoClient` with a short
67-
``socketTimeoutMS`` so slow operations result in a
68-
:class:`~pymongo.errors.TimeoutError`, rather than blocking the loop and
69-
preventing your application from responding to other requests.
70-
71-
- Start up extra Tornado processes. Tornado is typically deployed with one
72-
process per CPU core, proxied behind a load-balancer such as
73-
`Nginx <http://wiki.nginx.org/Main>`_ or `HAProxy <http://haproxy.1wt.eu/>`_;
74-
when using Tornado with a blocking driver like PyMongo it's recommended you
75-
start two or three processes per core instead of one.
47+
For `Twisted <http://twistedmatrix.com/>`_, see `TxMongo
48+
<http://github.com/fiorix/mongo-async-python-driver>`_. Compared to PyMongo,
49+
TxMongo is less stable, lack features, and is less actively maintained.
7650

7751
What does *OperationFailure* cursor id not valid at server mean?
7852
----------------------------------------------------------------

doc/tools.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ These are alternatives to PyMongo.
113113

114114
* `Motor <https://github.com/mongodb/motor>`_ is a full-featured, non-blocking
115115
MongoDB driver for Python Tornado applications.
116-
* `asyncmongo <https://github.com/bitly/asyncmongo>`_ is an asynchronous library
117-
for accessing mongo which is built on the Tornado IOLoop, but doesn't support
118-
to replica sets.
119116
* `TxMongo <http://github.com/fiorix/mongo-async-python-driver>`_ is an
120117
asynchronous Python driver for MongoDB, although it is not currently
121118
recommended for production use.

0 commit comments

Comments
 (0)