diff --git a/perfkitbenchmarker/linux_benchmarks/redis_memtier_benchmark.py b/perfkitbenchmarker/linux_benchmarks/redis_memtier_benchmark.py index 05df0c7e8..945c78afb 100644 --- a/perfkitbenchmarker/linux_benchmarks/redis_memtier_benchmark.py +++ b/perfkitbenchmarker/linux_benchmarks/redis_memtier_benchmark.py @@ -76,7 +76,6 @@ memtier_pipeline: 1 placement_group_style: none redis_aof: False - redis_server_io_threads: 0 vm_groups: servers: vm_spec: *default_dual_core diff --git a/perfkitbenchmarker/linux_packages/redis_server.py b/perfkitbenchmarker/linux_packages/redis_server.py index 5271e111f..5ce1bf414 100644 --- a/perfkitbenchmarker/linux_packages/redis_server.py +++ b/perfkitbenchmarker/linux_packages/redis_server.py @@ -43,6 +43,8 @@ class RedisEvictionPolicy: None, 'Only supported for redis version >= 6, the ' 'number of redis server IO threads to use.', + lower_bound=1, + upper_bound=128, ) _IO_THREADS_DO_READS = flags.DEFINE_bool( 'redis_server_io_threads_do_reads', @@ -157,10 +159,11 @@ def _GetIOThreads(vm) -> int: return _IO_THREADS.value # Redis docs suggests that i/o threads should not exceed number of cores. nthreads_per_core = vm.CheckLsCpu().threads_per_core + num_cpus = vm.NumCpusForBenchmark() if nthreads_per_core == 1: - return vm.NumCpusForBenchmark() - 1 + return max(num_cpus - 1, 1) else: - return vm.NumCpusForBenchmark() // 2 + return num_cpus // 2 def _BuildStartCommand(vm, port: int) -> str: