Database Reference
In-Depth Information
Using the Python Stress Test
Cassandra ships with a popular utility called py_stress that you can use to run a stress test on
your Cassandra cluster. To run py_stress , navigate to the <cassandra-home>/contribdirectory.
You might want to check out the README.txtile, as it will have the list of dependencies re-
quired to run the tool.
There are a few steps we need to go through before we can run the tool. First, make sure that
you still have the default keyspace (Keyspace1) in your configuration and have it loaded, as the
tool will run against the default column family definitions.
Then, you need to build the Python Thrift interface, which may require a few steps.
Generating the Python Thrift Interfaces
Before we can run the stress tool, we need to make sure that we have the Thrift interfaces for
Python available to it (because it's a Python script). You'll know that you haven't done this step
yet, or have done it incorrectly, if you see an error like this after running the command:
No module named thrift.transport
Make sure that you have Python installed on your system. To do this, open a terminal and type
$python ; you should see output similar to this:
eben@morpheus$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information
Make sure that you have Python 2.6 or better installed so that you can take advantage of the
newest multithreading capabilities it offers, which come in handy with the stress test.
Getting Thrift
To get Thrift, download it from http://incubator.apache.org/thrift . This will give you a file like
thrift-0.2.0-incubating.tar.gz, which you can decompress. Then, in the directory where you de-
compressed it, execute the following command on Linux to establish some dependencies:
$ sudo apt-get install -y libboost-dev libevent-dev python-dev automake pkg-config
libtool flex bison
Thrift might not run on your system if you don't have the C++ Boost libraries properly installed.
Get Boost from http://www.boost.org . Then, in the Boost home directory, run these commands:
$ ./bootstrap.sh
$ ./bjam
Search WWH ::




Custom Search