From c1baeddb8d9aa74a6309cce53905af00a7b33c76 Mon Sep 17 00:00:00 2001 From: yuyanting_google Date: Tue, 6 Dec 2016 10:14:00 -0800 Subject: [PATCH] Add cassandra read concurrency flag --- perfkitbenchmarker/data/cassandra/cassandra.yaml.j2 | 2 +- .../linux_benchmarks/cassandra_stress_benchmark.py | 1 + .../linux_benchmarks/cassandra_ycsb_benchmark.py | 3 ++- perfkitbenchmarker/linux_packages/cassandra.py | 6 +++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/perfkitbenchmarker/data/cassandra/cassandra.yaml.j2 b/perfkitbenchmarker/data/cassandra/cassandra.yaml.j2 index 2e88fca3f1..585aa86dfa 100644 --- a/perfkitbenchmarker/data/cassandra/cassandra.yaml.j2 +++ b/perfkitbenchmarker/data/cassandra/cassandra.yaml.j2 @@ -29,7 +29,7 @@ seed_provider: - class_name: org.apache.cassandra.locator.SimpleSeedProvider parameters: - seeds: "{{ seeds }}" -concurrent_reads: 32 +concurrent_reads: {{ concurrent_reads }} concurrent_writes: {{ num_cpus * 8 }} concurrent_counter_writes: 32 memtable_allocation_type: heap_buffers diff --git a/perfkitbenchmarker/linux_benchmarks/cassandra_stress_benchmark.py b/perfkitbenchmarker/linux_benchmarks/cassandra_stress_benchmark.py index b58807fdde..a327834261 100644 --- a/perfkitbenchmarker/linux_benchmarks/cassandra_stress_benchmark.py +++ b/perfkitbenchmarker/linux_benchmarks/cassandra_stress_benchmark.py @@ -251,6 +251,7 @@ def GenerateMetadataFromFlags(benchmark_spec): metadata.update({ + 'concurrent_reads': FLAGS.cassandra_concurrent_reads, 'num_data_nodes': len(vm_dict[CASSANDRA_GROUP]), 'num_loader_nodes': len(vm_dict[CLIENT_GROUP]), 'num_cassandra_stress_threads': FLAGS.num_cassandra_stress_threads, diff --git a/perfkitbenchmarker/linux_benchmarks/cassandra_ycsb_benchmark.py b/perfkitbenchmarker/linux_benchmarks/cassandra_ycsb_benchmark.py index 04c07e0300..ec64b8614d 100644 --- a/perfkitbenchmarker/linux_benchmarks/cassandra_ycsb_benchmark.py +++ b/perfkitbenchmarker/linux_benchmarks/cassandra_ycsb_benchmark.py @@ -174,7 +174,8 @@ def Run(benchmark_spec): 'cassandra.deleteconsistencylevel': WRITE_CONSISTENCY} metadata = {'ycsb_client_vms': FLAGS.ycsb_client_vms, - 'num_vms': len(cassandra_vms)} + 'num_vms': len(cassandra_vms), + 'concurrent_reads': FLAGS.cassandra_concurrent_reads} samples = list(benchmark_spec.executor.LoadAndRun( loaders, load_kwargs=kwargs, run_kwargs=kwargs)) diff --git a/perfkitbenchmarker/linux_packages/cassandra.py b/perfkitbenchmarker/linux_packages/cassandra.py index c7627e7e71..292c9626c9 100644 --- a/perfkitbenchmarker/linux_packages/cassandra.py +++ b/perfkitbenchmarker/linux_packages/cassandra.py @@ -54,6 +54,9 @@ FLAGS = flags.FLAGS +flags.DEFINE_integer('cassandra_concurrent_reads', 32, + 'Concurrent read requests each server accepts.') + def CheckPrerequisites(): """Verifies that the required resources are present. @@ -140,7 +143,8 @@ def Configure(vm, seed_vms): 'data_path': posixpath.join(vm.GetScratchDir(), 'cassandra'), 'seeds': ','.join(vm.internal_ip for vm in seed_vms), 'num_cpus': vm.num_cpus, - 'cluster_name': 'Test cluster'} + 'cluster_name': 'Test cluster', + 'concurrent_reads': FLAGS.cassandra_concurrent_reads} for config_file in [CASSANDRA_ENV_TEMPLATE, CASSANDRA_YAML_TEMPLATE]: local_path = data.ResourcePath(config_file)