Database Reference
In-Depth Information
What we've done here is used the -t flag to use 10 threads at once. This means that in 50
seconds, we wrote 1,000,000 records—about 2 milliseconds latency per write, with a totally un-
tuned database that is already managing 1.5GB of data.
You should run the test several times to get an idea of the right number of threads given
your hardware setup. Depending on the number of cores on your system, you're going to see
worse—not better—performance if you set the number of threads arbitrarily high, because the
processor will devote more time to managing the threads than doing your work. You want this
to be a rough match between the number of threads and the number of cores available to get a
reasonable test.
Now that we have all of this data in the database, let's use the test to read some values too:
$ ./stress.py -d 192.168.1.5 -o read
total,interval_op_rate,avg_latency,elapsed_time
103960,10396,0.00478858081549,10
225999,12203,0.00406984714627,20
355129,12913,0.00384438665076,30
485728,13059,0.00379976526221,40
617036,13130,0.00378045491559,50
749154,13211,0.00375620621777,60
880605,13145,0.00377542658007,70
1000000,11939,0.00374060139004,80
As you can see, Cassandra doesn't read nearly as fast as it writes; it takes about 80 seconds to
read one million values. Remember, though, that this is out of the box, untuned, single-threaded,
on a regular workstation running other programs, and the database is 2GB in size. Regardless,
this is a great tool to help you do performance tuning for your environment and to get a set of
numbers that indicates what to expect in your cluster.
Startup and JVM Settings
Cassandra allows you to configure a variety of options for how the server should start up, how
much Java memory should be allocated, and so forth. In this section we look at how to tune the
startup.
If you're using Windows, the startup script is called cassandra.bat, and on Linux it's cassandra.sh.
You can start the server by simply executing this file, which sets several defaults. But there's an-
other file in the bindirectory that allows you to configure a variety of settings related to how
Cassandra starts. This file is called cassandra.in.shand it separates certain options, such as the
JVM settings, into a different file to make it easier to update.
Search WWH ::




Custom Search