title: Load Testing CassandraDB with JMeter
body: <p>I am using the Cassandra JMeter Plugin <a href="https://github.com/slowenthal/jmeter-cassandra#cassandra-jmeter-plugin-for-cassandra" rel="nofollow">https://github.com/slowenthal/jmeter-cassandra#cassandra-jmeter-plugin-for-cassandra</a> which i have integrated in apache-JMeter2.9</p>
  
  <p>I have a Cassandra Cluster containing 2 Datacenter and 2 nodes on each datacenter.</p>
  
  <p><strong>JMeter:</strong></p>
  
  <p><strong>Cassandra Connection:</strong></p>
  
  <pre><code>contact points : 192.168.1.50,192.168.1.51,192.168.1.52
  keyspace : test_db
  </code></pre>
  
  <p><strong>Cassandra Sampler</strong> </p>
  
  <pre><code>CQL Query : select  * from test_db.feed_yogesh limit 1000;
  Consistency Level : QUORUM
  </code></pre>
  
  <p><strong>Testing Scenario</strong></p>
  
  <p>1.Fetch 1000 records for 1 user</p>
  
  <pre><code>User/Thread : 1
  Ramp-Up-Period : 0
  Generate Summary Results =      1 in   2.2s =    0.5/s Avg:  2180 Min:  2180 Max:  2180 Err:     0 (0.00%)
  </code></pre>
  
  <p>2.Fetch 1000 records for 1000 user</p>
  
  <p>I want to test for Multiple Users Concurrently hence I added Ramp-Up-period as 0 which as per JMeter will immediately start all the users.</p>
  
  <pre><code>User/Thread : 1000
  RampUp Period : 0
  Summary Results =   1000 in    18s =   56.1/s Avg:  6857 Min:  5000 Max: 17044 Err:   987 (98.70%)
  </code></pre>
  
  <p>It Does start all my user but only 4-5 users return success rest all give me error such as </p>
  
  <pre><code>All host(s) tried for query failed (tried: /192.168.1.50:9042 (com.datastax.driver.core.BusyConnectionException))
  </code></pre>
  
  <p>But when i Test the same 1000 User giving a Ramp-up-period of 300 it returns all success.</p>
  
  <pre><code>User/Thread : 1000
  RampUp Period : 300
  Generate Summary Results =   1000 in   301s =    3.3/s Avg:   519 Min:   255 Max:  1811 Err:     0 (0.00%) 
  </code></pre>
  
  <p>Cassndra Sampler.jmx</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jmeterTestPlan version="1.2" properties="2.4" jmeter="2.9 r1437961"&gt;
    &lt;hashTree&gt;
      &lt;TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true"&gt;
        &lt;stringProp name="TestPlan.comments"&gt;&lt;/stringProp&gt;
        &lt;boolProp name="TestPlan.functional_mode"&gt;false&lt;/boolProp&gt;
        &lt;boolProp name="TestPlan.serialize_threadgroups"&gt;false&lt;/boolProp&gt;
        &lt;elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"&gt;
          &lt;collectionProp name="Arguments.arguments"/&gt;
        &lt;/elementProp&gt;
        &lt;stringProp name="TestPlan.user_define_classpath"&gt;&lt;/stringProp&gt;
      &lt;/TestPlan&gt;
      &lt;hashTree&gt;
        &lt;ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true"&gt;
          &lt;stringProp name="ThreadGroup.on_sample_error"&gt;continue&lt;/stringProp&gt;
          &lt;elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"&gt;
            &lt;boolProp name="LoopController.continue_forever"&gt;false&lt;/boolProp&gt;
            &lt;stringProp name="LoopController.loops"&gt;1&lt;/stringProp&gt;
          &lt;/elementProp&gt;
          &lt;stringProp name="ThreadGroup.num_threads"&gt;1000&lt;/stringProp&gt;
          &lt;stringProp name="ThreadGroup.ramp_time"&gt;0&lt;/stringProp&gt;
          &lt;longProp name="ThreadGroup.start_time"&gt;1420788860000&lt;/longProp&gt;
          &lt;longProp name="ThreadGroup.end_time"&gt;1420788860000&lt;/longProp&gt;
          &lt;boolProp name="ThreadGroup.scheduler"&gt;false&lt;/boolProp&gt;
          &lt;stringProp name="ThreadGroup.duration"&gt;&lt;/stringProp&gt;
          &lt;stringProp name="ThreadGroup.delay"&gt;&lt;/stringProp&gt;
        &lt;/ThreadGroup&gt;
        &lt;hashTree&gt;
          &lt;org.apache.cassandra.jmeter.config.CassandraConnection guiclass="TestBeanGUI" testclass="org.apache.cassandra.jmeter.config.CassandraConnection" testname="Cassandra Connection" enabled="true"&gt;
            &lt;stringProp name="contactPoints"&gt;192.168.1.50,192.168.1.51,192.168.1.52&lt;/stringProp&gt;
            &lt;stringProp name="keyspace"&gt;test_db&lt;/stringProp&gt;
            &lt;stringProp name="loadBalancer"&gt;Default&lt;/stringProp&gt;
            &lt;stringProp name="localDataCenter"&gt;&lt;/stringProp&gt;
            &lt;stringProp name="password"&gt;&lt;/stringProp&gt;
            &lt;stringProp name="sessionName"&gt;mydatabase&lt;/stringProp&gt;
            &lt;stringProp name="username"&gt;&lt;/stringProp&gt;
          &lt;/org.apache.cassandra.jmeter.config.CassandraConnection&gt;
          &lt;hashTree/&gt;
          &lt;org.apache.cassandra.jmeter.sampler.CassandraSampler guiclass="TestBeanGUI" testclass="org.apache.cassandra.jmeter.sampler.CassandraSampler" testname="Cassandra Sampler" enabled="true"&gt;
            &lt;stringProp name="batchSize"&gt;&lt;/stringProp&gt;
            &lt;stringProp name="consistencyLevel"&gt;QUORUM&lt;/stringProp&gt;
            &lt;stringProp name="query"&gt;select  * from test_db.feed_yogesh limit 1000;&lt;/stringProp&gt;
            &lt;stringProp name="queryArguments"&gt;Running&lt;/stringProp&gt;
            &lt;stringProp name="queryType"&gt;Simple Statement&lt;/stringProp&gt;
            &lt;stringProp name="resultVariable"&gt;&lt;/stringProp&gt;
            &lt;stringProp name="sessionName"&gt;mydatabase&lt;/stringProp&gt;
            &lt;stringProp name="variableNames"&gt;VARCHAR&lt;/stringProp&gt;
          &lt;/org.apache.cassandra.jmeter.sampler.CassandraSampler&gt;
          &lt;hashTree/&gt;
          &lt;ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"&gt;
            &lt;boolProp name="ResultCollector.error_logging"&gt;false&lt;/boolProp&gt;
            &lt;objProp&gt;
              &lt;name&gt;saveConfig&lt;/name&gt;
              &lt;value class="SampleSaveConfiguration"&gt;
                &lt;time&gt;true&lt;/time&gt;
                &lt;latency&gt;true&lt;/latency&gt;
                &lt;timestamp&gt;true&lt;/timestamp&gt;
                &lt;success&gt;true&lt;/success&gt;
                &lt;label&gt;true&lt;/label&gt;
                &lt;code&gt;true&lt;/code&gt;
                &lt;message&gt;true&lt;/message&gt;
                &lt;threadName&gt;true&lt;/threadName&gt;
                &lt;dataType&gt;true&lt;/dataType&gt;
                &lt;encoding&gt;false&lt;/encoding&gt;
                &lt;assertions&gt;true&lt;/assertions&gt;
                &lt;subresults&gt;true&lt;/subresults&gt;
                &lt;responseData&gt;false&lt;/responseData&gt;
                &lt;samplerData&gt;false&lt;/samplerData&gt;
                &lt;xml&gt;false&lt;/xml&gt;
                &lt;fieldNames&gt;false&lt;/fieldNames&gt;
                &lt;responseHeaders&gt;false&lt;/responseHeaders&gt;
                &lt;requestHeaders&gt;false&lt;/requestHeaders&gt;
                &lt;responseDataOnError&gt;false&lt;/responseDataOnError&gt;
                &lt;saveAssertionResultsFailureMessage&gt;false&lt;/saveAssertionResultsFailureMessage&gt;
                &lt;assertionsResultsToSave&gt;0&lt;/assertionsResultsToSave&gt;
                &lt;bytes&gt;true&lt;/bytes&gt;
              &lt;/value&gt;
            &lt;/objProp&gt;
            &lt;stringProp name="filename"&gt;&lt;/stringProp&gt;
          &lt;/ResultCollector&gt;
          &lt;hashTree/&gt;
          &lt;ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="Summary Report" enabled="true"&gt;
            &lt;boolProp name="ResultCollector.error_logging"&gt;false&lt;/boolProp&gt;
            &lt;objProp&gt;
              &lt;name&gt;saveConfig&lt;/name&gt;
              &lt;value class="SampleSaveConfiguration"&gt;
                &lt;time&gt;true&lt;/time&gt;
                &lt;latency&gt;true&lt;/latency&gt;
                &lt;timestamp&gt;true&lt;/timestamp&gt;
                &lt;success&gt;true&lt;/success&gt;
                &lt;label&gt;true&lt;/label&gt;
                &lt;code&gt;true&lt;/code&gt;
                &lt;message&gt;true&lt;/message&gt;
                &lt;threadName&gt;true&lt;/threadName&gt;
                &lt;dataType&gt;true&lt;/dataType&gt;
                &lt;encoding&gt;false&lt;/encoding&gt;
                &lt;assertions&gt;true&lt;/assertions&gt;
                &lt;subresults&gt;true&lt;/subresults&gt;
                &lt;responseData&gt;false&lt;/responseData&gt;
                &lt;samplerData&gt;false&lt;/samplerData&gt;
                &lt;xml&gt;false&lt;/xml&gt;
                &lt;fieldNames&gt;false&lt;/fieldNames&gt;
                &lt;responseHeaders&gt;false&lt;/responseHeaders&gt;
                &lt;requestHeaders&gt;false&lt;/requestHeaders&gt;
                &lt;responseDataOnError&gt;false&lt;/responseDataOnError&gt;
                &lt;saveAssertionResultsFailureMessage&gt;false&lt;/saveAssertionResultsFailureMessage&gt;
                &lt;assertionsResultsToSave&gt;0&lt;/assertionsResultsToSave&gt;
                &lt;bytes&gt;true&lt;/bytes&gt;
              &lt;/value&gt;
            &lt;/objProp&gt;
            &lt;stringProp name="filename"&gt;&lt;/stringProp&gt;
          &lt;/ResultCollector&gt;
          &lt;hashTree/&gt;
        &lt;/hashTree&gt;
      &lt;/hashTree&gt;
    &lt;/hashTree&gt;
  &lt;/jmeterTestPlan&gt;
  </code></pre>
  
  <p>I am confused, does it mean that multiple user's cannnot read data concurrently do we compulsorily need to add the Ramp-Up-Period value.</p>