Monday, May 29, 2023

BrandPost: Introducing the Redis/Intel Benchmark Specification for Efficiency Testing, Profiling, and Evaluation

Latest News

Redis and Intel are collaborating on “zero-touch” efficiency and profiling automation to increase Redis’ capacity to search out efficiency penalties and enhance the effectivity of database code. The Redis Benchmark specification describes cross-language and tooling necessities and expectations to advertise efficiency and observability requirements for Redis-related applied sciences.

A key motive for Redis’ reputation as a key-value database is its efficiency, measured in sub-millisecond response instances to queries. To proceed bettering efficiency throughout Redis elements, Redis and Intel have collaborated to develop a framework for robotically triggering efficiency testing, telemetry assortment, profiling, and information visualization on code commit. Did. Our purpose is easy. The purpose is to determine adjustments in efficiency as early as doable.

This automation permits {hardware} companions similar to Intel to achieve perception into how their software program is utilizing their platform and determine alternatives to additional optimize Redis on Intel CPUs. Most significantly, a deeper understanding of software program helps Intel design higher merchandise.

This weblog put up describes how Redis and Intel are working collectively on this sort of automation. “Zero-touch” profiling can amplify your pursuit of efficiency degradation and discover alternatives to enhance the effectivity of your database code.

Customary Specs: Motives and Necessities

Each Redis and Intel wish to determine alternatives for software program and {hardware} optimization. To realize this, we now have determined to advertise a set of inter-company and inter-community requirements for all points associated to efficiency and observability necessities and expectations.

From a software program perspective, it goals to robotically determine efficiency degradation and higher perceive hotspots to seek out alternatives for enchancment. We would like the framework to be simple to put in, complete when it comes to take a look at case protection, and simple to increase. The purpose is to accommodate personalized benchmarks, benchmarking instruments, and hint/probe mechanisms.

From a {hardware} perspective, we wish to examine completely different generations of platforms to evaluate the affect of latest {hardware} options. Moreover, I wish to accumulate telemetry and carry out “what-if” checks similar to frequency scaling, core scaling, and testing cache prefetchers on and off. This permits us to isolate the affect of every of those optimizations on Redis efficiency and informs us about completely different optimizations and future CPU and platform structure choices.

Customary SPEC implementation

Based mostly on the above assumptions, we created the Redis Benchmarks Specification framework. It’s simple to put in by way of PyPi and gives a simple method to assess Redis efficiency and the underlying system it runs on. The Redis Benchmark Specification at present accommodates about 60 completely different benchmarks equivalent to a number of instructions and options. Simply extendable with your individual personalized benchmarks, benchmarking instruments, tracing or probing mechanisms.

See also  the place tech jobs are

Redis and Intel repeatedly benchmark their frameworks. Categorize every benchmark end result by department and tag to interpret the ensuing efficiency information over time and by model. Moreover, use this device to approve performance-related pull requests to the Redis venture. The choice-making course of consists of benchmarking outcomes and a proof of why these outcomes had been obtained utilizing profiling device output and prober output in a “zero-touch” totally computerized mode.

The end result: you possibly can generate platform-level insights and carry out “what-if” evaluation. That is because of hint and probe open supply instruments similar to memtier_benchmark, redis-benchmark, Linux perf_events, bcc/BPF hint instruments, Brendan Greg’s FlameGraph repository, and Intel Efficiency Counter Monitor for accumulating hardware-related telemetry information. is.

For those who’re serious about studying extra about utilizing profilers with Redis, try our very detailed efficiency engineering information on profiling and tracing on CPUs..

So how does it work? thanks.

software program structure

The primary purpose of the Redis benchmark specification is to determine efficiency adjustments as early as doable. Because of this as quickly as you push a set of adjustments to Git, you possibly can (or ought to) measure and consider the efficiency affect of the pushed adjustments on a number of benchmarks.

One of many optimistic results is that it makes the job of the core Redis maintainers simpler. Triggering CI/CD benchmarks occurs just by tagging a selected pull request (PR) with “motion run:benchmarks”. That set off is translated into an occasion (tracked inside Redis) that initiates a number of construct variant requests primarily based on the person platforms described within the Redis Benchmark Specification Platform Reference.

A construct agent (redis-benchmarks-spec-builder) prepares an artifact when a brand new construct variant request is acquired. Add an artifact benchmark occasion so that every one benchmark platforms (together with Intel Labs’) can hearken to benchmark execution occasions. This additionally initiates the method of deploying and managing the required infrastructure and database topology, working benchmarks, and exporting efficiency outcomes. All information is saved in Redis (utilizing the Redis Stack function). That is later used for diff-based evaluation between baseline builds and comparability builds (like the instance within the picture beneath) and diff evaluation over time on the identical department/tag.

See also  What's Deep Tech?Life after shopper apps

A brand new decide to the identical working department will generate a brand new set of benchmark occasions, repeating the above course of.


Determine 1. The structure of the platform from triggering a workflow from a pull request to a number of benchmarking brokers producing the ultimate benchmarking and profiling information.

Intel Lab {hardware} configuration

This framework may be deployed each on-premises and within the cloud. In collaboration with Intel, we host an on-premises cluster of servers devoted to our always-on automated efficiency testing framework (see Determine 2).


Determine 2. Intel lab setup

The cluster consists of 6 current-generation (IceLake) and 6 previous-generation (CascadeLake) servers linked to high-speed 40Gb switches (see Determine 3). Older servers are used for efficiency testing throughout {hardware} generations and for load-generating purchasers in client-server benchmarks.

We plan to increase the lab to incorporate a number of generations of servers, together with beta (pre-release) platforms for early analysis and “what-if” evaluation of proposed platform options.

One of many advantages we noticed with a devoted on-premises setup is much less run-to-run variability and extra steady outcomes. Moreover, you could have the flexibleness to switch the server so as to add or take away elements as wanted.


Determine 3. Server configuration

I am wanting ahead to

Immediately, the Redis Benchmarks Specification is the de facto efficiency testing toolset for Redis utilized by efficiency groups. We run about 60 benchmarks in every day steady integration (CI) and likewise use them for handbook efficiency investigations.

The advantages are already there. Through the growth cycle of Redis 7.0 and seven.2, the brand new specification allowed us to arrange new enhancements similar to these in these pull requests.

  • Change compiler optimizations to -O3 -flto. Efficiency enhancements of as much as 5% had been measured in benchmark SPEC checks.
  • Use snprintf as soon as with addReplyDouble. A measured enchancment in easy ZADD of about 25%.
  • Transfer the consumer flag to a extra cacheable place within the consumer construction. Gained again 2% CPU cycles misplaced since v6.2.
  • Optimize d2string() and addReplyDouble() in grisu2. Wanting on the affect of the ZRANGE WITHSCORES command, the achievable ops/sec improved by 23% for a 10-element response, 50% for a 100-element response, and 68% for a 1,000-element response.
  • Optimize creation of stream id sds with XADD key *. End result: About 20% CPU cycles saved.
  • Use a monotonic or wall clock to measure command execution time. ,Recovered as much as 4% of execution time.
  • Keep away from delayed sequence response with ZRANGE command BYRANK. The added performance recovers the 3-15% efficiency drop since v5.
  • Optimize delayed response and use shared objects as an alternative of sprintf. Enhancements measured with the ZRANGE command vary from 3% to 9%.
See also  This is why Oracle is making Database 23c free to builders:

In abstract, the above work enabled as much as 68% efficiency enchancment for the command in query.


Determine 4. A pattern visualization from Redis developer group Grafana monitoring the efficiency of every platform/benchmark/model over time.

future work

Present efficiency engineering techniques detect efficiency adjustments in the course of the growth cycle and assist builders perceive the affect of code adjustments. We have made nice progress, however there’s nonetheless loads we wish to enhance.

We’re engaged on bettering the flexibility to mixture efficiency information throughout teams of benchmarks. This lets you reply questions like “Which stack consumes essentially the most CPU in all benchmarks?” And “what’s the easiest consequence to optimize and produce most impact for all instructions?”

Furthermore, baseline and comparative analyzes rely closely on easy variance-based calculations. We’re searching for higher statistical evaluation strategies that allow trend-based evaluation over teams of information factors and extra granular evaluation to keep away from the “boiling frog drawback” of the noisy surroundings of the cloud. I’m going to strategy

The Redis API has over 400 instructions. We have to proceed working to extend visibility and enhance efficiency throughout API efficiency. And it ought to accomplish that whereas additionally specializing in essentially the most used instructions as decided by neighborhood and buyer suggestions.

We plan to increase our deployment choices, together with cluster-level benchmarking, replication, and extra. We plan to reinforce the visualization and evaluation capabilities, and plan to increase the checks to extra {hardware} platforms, together with early (pre-release) platforms from Intel.

Our purpose is to increase the usage of our efficiency platform throughout the neighborhood and the Redis developer group. The extra information and extra completely different views we carry into this venture, the extra doubtless we’re to ship a quicker Redis.

Attempt it without cost.


Please enter your comment!
Please enter your name here

Hot Topics

Related Articles