Package: redis-benchmarks-specification
Benchmark specifications goalScopeInstallation and ExecutionInstalling package requirementsInstalling Redis benchmarks specificationTesting out the redis-benchmarks-spec-runnerTesting out redis-benchmarks-spec-sc-coordinatorArchitecture diagramDirectory layoutSpecificationsSpec tool implementationsContributing guidelinesJoining the performance initiative and adding a continuous benchmark platformJoining the performance initiativeAdding a continuous benchmark platformAdding redis-benchmarks-spec-sc-coordinator to supervisordDevelopmentRunning formatersRunning lintersRunning testsLicenseBenchmark specifications goalThe Redis benchmarks specification describes the cross-language/tools requirements and expectations to foster performance and observability standards around redis related technologies.Members from both industry and academia, including organizations and individuals are encouraged to contribute.Currently, the following members actively support this project:Redis Ltd.via the Redis Performance Group: providing steady-stable infrastructure platform to run the benchmark suite. Supporting the active development of this project within the company.Intel.: Intel is hosting an on-prem cluster of servers dedicated to the always-on automatic performance testing.ScopeThis repo aims to provide Redis related benchmark standards and methodologies for:Management of benchmark data and specifications across different setupsRunning benchmarks and recording resultsExporting performance results in several formats (CSV, RedisTimeSeries, JSON)Finding on-cpu, off-cpu, io, and threading performance problems by attaching profiling tools/probers ( perf (a.k.a. perf_events), bpf tooling, vtune )Finding performance problems by attaching telemetry probesCurrent supported benchmark tools:redis-benchmarkmemtier_benchmark[SOON]redis-benchmark-goInstallation and ExecutionThe Redis benchmarks specification and implementations is developed for Unix and is actively tested on it.
To have access to the latest SPEC and Tooling impletamtion you only need to install one python package.Before package's installation, please install its' dependencies.Installing package requirements# install pip installer for python3sudoaptinstallpython3-pip-y
sudopip3install--upgradepip# install dockersudoaptinstalldocker.io-y# install supervisordsudoaptinstallsupervisor-yInstalling Redis benchmarks specificationInstallation is done using pip, the package installer for Python, in the following manner:python3-mpipinstallredis-benchmarks-specification--ignore-installedPyYAMLTo run particular version - use its number, e.g. 0.1.57:pip3installredis-benchmarks-specification==0.1.57Testing out the redis-benchmarks-spec-client-runnerThere is an option to run "redis-benchmarks-spec" tests using standalone runner approach. For this option redis-benchmarks-specificaiton should be run together with redis-server in the same time.# Run redis server[taskset-ccpu]/src/redis-server--port6379--dirlogs--logfileserver.log--save""[--daemonizeyes]# Run benchmarkredis-benchmarks-spec-client-runner--db_server_hostlocalhost--db_server_port6379--client_aggregated_results_folder./testUse taskset when starting the redis-server to pin it to a particular cpu and get more consistent results.
Option "--daemonize yes" given to server run command allows to run redis-server in background.Option "--test X.yml" given to benchmark execution command allows to run particular test, where X - test nameFull list of option can be taken with "-h" option:$ redis-benchmarks-spec-client-runner -h
  usage: redis-benchmarks-spec-client-runner [-h]
                                             [--platform-name PLATFORM_NAME]
                                             [--triggering_env TRIGGERING_ENV]
                                             [--setup_type SETUP_TYPE]
                                             [--github_repo GITHUB_REPO]
                                             [--github_org GITHUB_ORG]
                                             [--github_version GITHUB_VERSION]
                                             [--logname LOGNAME]
                                             [--test-suites-folder TEST_SUITES_FOLDER]
                                             [--test TEST]
                                             [--db_server_host DB_SERVER_HOST]
                                             [--db_server_port DB_SERVER_PORT]
                                             [--cpuset_start_pos CPUSET_START_POS]
                                             [--datasink_redistimeseries_host DATASINK_REDISTIMESERIES_HOST]
                                             [--datasink_redistimeseries_port DATASINK_REDISTIMESERIES_PORT]
                                             [--datasink_redistimeseries_pass DATASINK_REDISTIMESERIES_PASS]
                                             [--datasink_redistimeseries_user DATASINK_REDISTIMESERIES_USER]
                                             [--datasink_push_results_redistimeseries] [--profilers PROFILERS]
                                             [--enable-profilers] [--flushall_on_every_test_start]
                                             [--flushall_on_every_test_end]
                                             [--preserve_temporary_client_dirs]
                                             [--client_aggregated_results_folder CLIENT_AGGREGATED_RESULTS_FOLDER]
                                             [--tls]
                                             [--tls-skip-verify]
                                             [--cert CERT]
                                             [--key KEY]
                                             [--cacert CACERT]
  redis-benchmarks-spec-client-runner (solely client) 0.1.61
  ...Testing out redis-benchmarks-spec-sc-coordinatorAlternative way of running redis-server for listeting is running via redis-benchmarks coordinator.You should now be able to print the following installed benchmark runner help:$redis-benchmarks-spec-sc-coordinator-h
usage:redis-benchmarks-spec-sc-coordinator[-h]--event_stream_hostEVENT_STREAM_HOST--event_stream_portEVENT_STREAM_PORT--event_stream_passEVENT_STREAM_PASS--event_stream_userEVENT_STREAM_USER[--cpu-countCPU_COUNT][--platform-namePLATFORM_NAME][--lognameLOGNAME][--consumer-start-idCONSUMER_START_ID][--setups-folderSETUPS_FOLDER][--test-suites-folderTEST_SUITES_FOLDER][--datasink_redistimeseries_hostDATASINK_REDISTIMESERIES_HOST][--datasink_redistimeseries_portDATASINK_REDISTIMESERIES_PORT][--datasink_redistimeseries_passDATASINK_REDISTIMESERIES_PASS][--datasink_redistimeseries_userDATASINK_REDISTIMESERIES_USER][--datasink_push_results_redistimeseries]redis-benchmarks-specrunner(self-contained)0.1.13

optionalarguments:-h,--helpshowthishelpmessageandexit--event_stream_hostEVENT_STREAM_HOST--event_stream_portEVENT_STREAM_PORT--event_stream_passEVENT_STREAM_PASS--event_stream_userEVENT_STREAM_USER--cpu-countCPU_COUNTSpecifyhowmuchoftheavailableCPUresourcesthecoordinatorcanuse.(default:8)--platform-namePLATFORM_NAMESpecifytherunningplatformname.Bydefaultitwillusethemachinename.(default:fco-ThinkPad-T490)--lognameLOGNAMElognametowritethelogsto(default:None)--consumer-start-idCONSUMER_START_ID--setups-folderSETUPS_FOLDERSetupsfolder,containingthebuildenvironmentvariationssub-folderthatweusetotriggerdifferentbuildartifacts(default:/home/fco/redislabs/redis-benchmarks-specification/redis_benchmarks_specification/setups)--test-suites-folderTEST_SUITES_FOLDERTestsuitesfolder,containingthedifferenttestvariations(default:/home/fco/redislabs/redis-benchmarks-specification/redis_benchmarks_specification/test-suites)--datasink_redistimeseries_hostDATASINK_REDISTIMESERIES_HOST--datasink_redistimeseries_portDATASINK_REDISTIMESERIES_PORT--datasink_redistimeseries_passDATASINK_REDISTIMESERIES_PASS--datasink_redistimeseries_userDATASINK_REDISTIMESERIES_USER--datasink_push_results_redistimeseriesuploadstheresultstoRedisTimeSeries.Propercredentialsarerequired(default:False)Note that the minimum arguments to run the benchmark coordinator are:--event_stream_host,--event_stream_port,--event_stream_pass,--event_stream_userYou should use the provided credentials to be able to access the event streams.
Apart from it, you will need to discuss with the Performance Group the unique platform name that will be used to showcase results, coordinate work, among other thigs.If all runs accordingly you should see the following sample log when you run the tool with the credentials:$poetryrunredis-benchmarks-spec-sc-coordinator--platform-nameexample-platform\--event_stream_host<...>\--event_stream_port<...>\--event_stream_pass<...>\--event_stream_user<...>2021-09-2210:47:12INFOredis-benchmarks-specrunner(self-contained)0.1.132021-09-2210:47:12INFOUsingtopologiesfolderdir/home/fco/redislabs/redis-benchmarks-specification/redis_benchmarks_specification/setups/topologies2021-09-2210:47:12INFOReadingtopologiesspecificationsfrom:/home/fco/redislabs/redis-benchmarks-specification/redis_benchmarks_specification/setups/topologies/topologies.yml2021-09-2210:47:12INFOUsingtest-suitesfolderdir/home/fco/redislabs/redis-benchmarks-specification/redis_benchmarks_specification/test-suites2021-09-2210:47:12INFORunningallspecifiedbenchmarks:/home/fco/redislabs/redis-benchmarks-specification/redis_benchmarks_specification/test-suites/redis-benchmark-full-suite-1Mkeys-100B.yml2021-09-2210:47:12INFOThereareatotalof1test-suitesinfolder/home/fco/redislabs/redis-benchmarks-specification/redis_benchmarks_specification/test-suites2021-09-2210:47:12INFOReadingeventstreamsfrom:<...>:<...>withuser<...>2021-09-2210:47:12INFOcheckingbuildspecrequirements2021-09-2210:47:12INFOWilluseconsumergroupnamedrunners-cg:redis/redis/commits-example-platform.2021-09-2210:47:12INFOCreatedconsumergroupnamedrunners-cg:redis/redis/commits-example-platformtodistributework.2021-09-2210:47:12INFOEnteringblockingreadwaitingforwork.You're now actively listening for benchmarks requests to Redis!Architecture diagramIn a very brief description, github.com/redis/redis upstream changes trigger an HTTP API call containing the
relevant git information.The HTTP request is then converted into an event ( tracked within redis ) that will trigger multiple build variants requests based upon the distinct platforms described inplatforms.As soon as a new build variant request is received, the build agent (redis-benchmarks-spec-builder)
prepares the artifact(s) and proceeds into adding an artifact benchmark event so that the benchmark coordinator (redis-benchmarks-spec-sc-coordinator)  can deploy/manage the required infrastructure and DB topologies, run the benchmark, and export the performance results.Directory layoutSpecificationsThe following is a high level status report for currently available specs.redis_benchmarks_specificationtest-suites: contains the benchmark suites definitions, specifying the target redis topology, the tested commands, the benchmark utility to use (the client), and if required the preloading dataset steps.redis_benchmarks_specification/setupsplatforms: contains the standard platforms considered to provide steady stable results, and to represent common deployment targets.topologies: contains the standard deployment topologies definition with the associated minimum specs to enable the topology definition.builders: contains the build environment variations, that enable to build Redis with different compilers, compiler flags, libraries, etc...Spec tool implementationsThe following is a high level status report for currently available spec implementations.STATUS: Experimentalredis-benchmarks-spec-api: contains the API that translates the POST HTTP request that was triggered by github.com/redis/redis upstream changes, and fetches the relevant git/source info and coverts it into an event ( tracked within redis ).STATUS: Experimentalredis-benchmarks-spec-builder: contains the benchmark build agent utility that receives an event indicating a new build variant, generates the required redis binaries to test, and triggers the benchmark run on the listening agents.STATUS: Experimentalredis-benchmarks-spec-sc-coordinator: contains the coordinator utility that listens for benchmark suite run requests and setups the required steps to spin the actual benchmark topologies and to trigger the actual benchmarks.STATUS: Experimentalredis-benchmarks-spec-client-runner: contains the client utility that triggers the actual benchmarks against an endpoint provided. This tool is setup agnostic and expects the DB to be properly spinned beforehand.Contributing guidelinesAdding new test suitesTBDAdding new topologiesTBDJoining the performance initiative and adding a continuous benchmark platformJoining the performance initiativeIn order to join the performance initiative the only requirement is that you provide a steady-stable infrastructure
platform to run the benchmark suites, and you reach out to one of the Redis Performance Initiative member viaperformance <at> redis <dot> comso that we can provide you with the required secrets to actively listen for benchmark events.If you check the above "Architecture diagram", this means you only need to run the last moving part of the arch, meaning you will have
one or more benchmark coordinator machines actively running benchmarks and pushing the results back to our datasink.Adding a continuous benchmark platformIn order to be able to run the benchmarks on the platform you need pip installer for python3, and docker.
Apart from it, we recommend you manage theredis-benchmarks-spec-sc-coordinatorprocess(es) state via a process monitoring tool like
supervisorctl, lauchd, daemon tools, or other.For this example we relly upponsupervisorctlfor process managing.Adding redis-benchmarks-spec-sc-coordinator to supervisordLet's add a supervisord entry as followvi /etc/supervisor/conf.d/redis-benchmarks-spec-sc-coordinator-1.confYou can use the following template and update according to your credentials:[supervisord]loglevel=debug[program:redis-benchmarks-spec-sc-coordinator]command=redis-benchmarks-spec-sc-coordinator--platform-namebicx02\--event_stream_host<...>\--event_stream_port<...>\--event_stream_pass<...>\--event_stream_user<...>\--datasink_push_results_redistimeseries\--datasink_redistimeseries_host<...>\--datasink_redistimeseries_port<...>\--datasink_redistimeseries_pass<...>\--logname/var/opt/redis-benchmarks-spec-sc-coordinator-1.logstartsecs=0autorestart=truestartretries=1After editing the conf, you just need to reload and confirm that the benchmark runner is active::~#supervisorctlreload
Restartedsupervisord
:~#supervisorctlstatus
redis-benchmarks-spec-sc-coordinatorRUNNINGpid27842,uptime0:00:00DevelopmentInstallpypoetryto manage your dependencies and trigger tooling.pipinstallpoetryInstalling dependencies from lock filepoetry installRunning formaterspoetryrunblack.Running linterspoetryrunflake8Running testsA test suite is provided, and can be run with:$pip3install-r./dev_requirements.txt
$toxTo run a specific test:$tox--utils/tests/test_runner.pyLicenseredis-benchmarks-specification is distributed under the BSD3 license - seeLICENSE