11Performance Notes
22=================
3- The python driver for Cassandra offers several methods for executing queries.
3+ The Python driver for Cassandra offers several methods for executing queries.
44You can synchronously block for queries to complete using
55:meth: `.Session.execute() `, you can use a future-like interface through
66:meth: `.Session.execute_async() `, or you can attach a callback to the future
@@ -13,7 +13,7 @@ Benchmark Notes
1313All benchmarks were executed using the
1414`benchmark scripts <https://github.com/datastax/python-driver/tree/master/benchmarks >`_
1515in the driver repository. They were executed on a laptop with 16 GiB of RAM, an SSD,
16- and a 2 GHz, four core CPU with hyperthreading . The Cassandra cluster was a three
16+ and a 2 GHz, four core CPU with hyper-threading . The Cassandra cluster was a three
1717node `ccm <https://github.com/pcmanus/ccm >`_ cluster running on the same laptop
1818with version 1.2.13 of Cassandra. I suggest testing these benchmarks against your
1919own cluster when tuning the driver for optimal throughput or latency.
@@ -26,6 +26,17 @@ by using the ``--asyncore-only`` command line option.
2626Each benchmark completes 100,000 small inserts. The replication factor for the
2727keyspace was three, so all nodes were replicas for the inserted rows.
2828
29+ The benchmarks require the Python driver C extensions as well as a few additional
30+ Python packages. Follow these steps to install the prerequisites:
31+
32+ 1. Install packages to support Python driver C extensions:
33+
34+ * Debian/Ubuntu: ``sudo apt-get install gcc python-dev libev4 libev-dev ``
35+ * RHEL/CentOS/Fedora: ``sudo yum install gcc python-dev libev4 libev-dev ``
36+
37+ 2. Install Python packages: ``pip install scales twisted blist ``
38+ 3. Re-install the Cassandra driver: ``pip install --upgrade cassandra-driver ``
39+
2940Synchronous Execution (`sync.py <https://github.com/datastax/python-driver/blob/master/benchmarks/sync.py >`_)
3041-------------------------------------------------------------------------------------------------------------
3142Although this is the simplest way to make queries, it has low throughput
@@ -173,7 +184,7 @@ Callback Chaining (`callback_full_pipeline.py <https://github.com/datastax/pytho
173184-----------------------------------------------------------------------------------------------------------------------------------------------
174185This pattern is very different from the previous patterns. Here we're taking
175186advantage of the :meth: `.ResponseFuture.add_callback() ` function to start
176- another request as soon as one finishes. Futhermore , we're starting 120
187+ another request as soon as one finishes. Furthermore , we're starting 120
177188of these callback chains, so we've always got about 120 operations in
178189flight at any time:
179190
@@ -243,7 +254,7 @@ dramatically:
243254 Average throughput: 679.61/sec
244255
245256 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.
257+ number of callback chains you run to roughly 100 per node in the cluster.
247258When :attr: `~.Cluster.protocol_version ` is 3 or higher, you can safely experiment
248259with higher numbers of callback chains.
249260
0 commit comments