Skip to content

Commit b0bb243

Browse files
committed
Minor doc clarification about concurrency limits
1 parent 92439a1 commit b0bb243

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

cassandra/concurrent.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ def execute_concurrent(session, statements_and_parameters, concurrency=100, rais
4141
raised.
4242
4343
The `concurrency` parameter controls how many statements will be executed
44-
concurrently. It is recommended that this be kept below the number of
44+
concurrently. When :attr:`.Cluster.protocol_version` is set to 1 or 2,
45+
it is recommended that this be kept below 100 times the number of
4546
core connections per host times the number of connected hosts (see
4647
:meth:`.Cluster.set_core_connections_per_host`). If that amount is exceeded,
4748
the event loop thread may attempt to block on new connection creation,
48-
substantially impacting throughput.
49+
substantially impacting throughput. If :attr:`~.Cluster.protocol_version`
50+
is 3 or higher, you can safely experiment with higher levels of concurrency.
4951
5052
Example usage::
5153

docs/performance.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ dramatically:
242242
~/python-driver $ python benchmarks/callback_full_pipeline.py -n 100000 --hosts=127.0.0.1,127.0.0.2,127.0.0.3 --libev-only --threads=1
243243
Average throughput: 679.61/sec
244244
245-
Until this is improved, you should limit the number of callback chains you run.
245+
When :attr:`.Cluster.protocol_version` is set to 1 or 2, you should limit the
246+
number of callback chains you run to rougly 100 per node in the cluster.
247+
When :attr:`~.Cluster.protocol_version` is 3 or higher, you can safely experiment
248+
with higher numbers of callback chains.
246249

247250
For many use cases, you don't need to implement this pattern yourself. You can
248251
simply use :meth:`cassandra.concurrent.execute_concurrent` and

0 commit comments

Comments
 (0)