Benchmarks for servers on Linux: a collection of open tools

We continue to discuss performance evaluation tools for CPU on Linux machines. Today's material includes: temci, uarch-bench, likwid, perf-tools, and llvm-mca.

More benchmarks:

Benchmarks for servers on Linux: a collection of open tools
Photo - Lukas Blazek - Unsplash

temci

This is a tool for assessing the execution time of two programs. Essentially, it allows comparison of the execution time of two applications. The utility was created by a student from Germany, Johannes Bechberger, as part of his bachelor's thesis in 2016. Today, the tool is distributed is licensed under the GNU General Public License.

Johannes wanted to create a tool that could measure the performance of a computing system in a controlled environment. Therefore, one of the main features of temci is the ability to customize the testing environment. For example, in: change the CPU frequency governor settings, disable hyper-threading and caches L1 and L2, turn off turbo mode on Intel processors, and more. For benchmarking, temci uses tools time, perf_stat and getrusage.

Here’s what the utility looks like in the first case:

# compare the run times of two programs, running them each 20 times
> temci short exec "sleep 0.1" "sleep 0.2" --runs 20
Benchmark 20 times                [####################################]  100%
Report for single runs
sleep 0.1            (   20 single benchmarks)
     avg_mem_usage mean =           0.000, deviation =   0.0
     avg_res_set   mean =           0.000, deviation =   0.0
     etime         mean =      100.00000m, deviation = 0.00000%
     max_res_set   mean =         2.1800k, deviation = 3.86455%
     stime         mean =           0.000, deviation =   0.0
     utime         mean =           0.000, deviation =   0.0

sleep 0.2            (   20 single benchmarks)
     avg_mem_usage mean =           0.000, deviation =   0.0
     avg_res_set   mean =           0.000, deviation =   0.0
     etime         mean =      200.00000m, deviation = 0.00000%
     max_res_set   mean =         2.1968k, deviation = 3.82530%
     stime         mean =           0.000, deviation =   0.0
     utime         mean =           0.000, deviation =   0.0

Based on benchmark results, the system generates a convenient report with charts, tables, and graphs, which distinguishes temci from similar solutions.

Among the drawbacks of temci is its 'youth.' Because of this, it does not support all hardware and software configurations. For instance, it is difficult to run it on macOS, and some features are unavailable on ARM systems. The situation may change in the future, as the author is actively developing the project, and the number of stars on GitHub is gradually increasing — just recently, temci was even discussed in the comments on Hacker News.

uarch-bench

A utility for evaluating the performance of low-level CPU functions, developed by engineer Travis Downs (Travis Downs). Recently, he has been maintaining his blog Performance Matters on GitHub Pages, where he discusses benchmarking tools and other related topics. In general, uarch-bench is just beginning to gain popularity, but it is already frequently mentioned it mentions by Hacker News users in thematic threads as a go-to tool for benchmarking.

Uarch-bench allows you to assess memory performance, the speed of parallel data loading, and the operation of clearing YMM registers.You can find the benchmarking results generated by the program in the official repository at the bottom of the page.

It is worth noting that uarch-bench, like temci, disables the Intel Turbo Boost feature (which automatically increases the processor's clock frequency under load) to ensure consistent test results.

So far, the project is in the early stages of development, which means that uarch-bench lacks detailed documentation, and bugs may occur during its operation — for example, known issues with running on Ryzen. It also only supports benchmarks for x86 architectures. The author promises to add more functionality in the future and invites contributions to development.

likwid

This is a set of tools for evaluating the performance of Linux machines with Intel, AMD, and ARMv8 processors. It was created under the auspices of the Federal Ministry of Education and Research of Germany in 2017 and released as open-source.

Among the tools offered by likwid, likwid-powermeter stands out, which provides information from RAPL registers about the power consumed by the system, as well as likwid-setFrequencies — which allows controlling the processor frequency. You can find the full list in the repository.

Engineers involved in HPC research use this tool. For example, with likwid, working a group of specialists from the Regional Computing Center of the University of Erlangen-Nuremberg (RRZE) in Germany. They are also actively participating in the development of this toolset.

Benchmarks for servers on Linux: a collection of open tools
Photo - Clem Onojeghuo - Unsplash

perf-tools

This tool is for analyzing the performance of Linux servers presented Brendan Gregg. He is one of the developers DTrace of the dynamic tracing framework for real-time application debugging.

perf-tools is built on the kernel subsystems perf_events and ftrace. Its utilities allow you to analyze input/output latency (iosnoop), track arguments for system calls (unccount, funcslower, funcgraph, and functrace), and collect statistics on file cache 'hits' (cachestat). In the latter case, the command looks like this:

# ./cachestat -t
Counting cache functions... Output every 1 seconds.
TIME HITS MISSES DIRTIES RATIO BUFFERS_MB CACHE_MB
08:28:57 415 0 0 100.0% 1 191
08:28:58 411 0 0 100.0% 1 191
08:28:59 362 97 0 78.9% 0 8
08:29:00 411 0 0 100.0% 0 9

An extensive community has formed around the tool (almost 6,000 stars on GitHub). There are companies that actively use perf-tools, for example, NetflixHowever, the tool is being refined and modified (though updates have become relatively rare lately). Therefore, errors may occur in its operation — the author states that sometimes perf-tools causes kernel panic.

llvm-mca

A utility that predicts how many computational resources machine code will require on different CPUs. It evaluates Instructions Per Cycle (IPC) and the load on the hardware generated by a particular application.

llvm-mca was introduced in 2018 as part of the LLVM, which focuses on developing a universal system for analysis, transformation, and optimization of programs. It is known that the authors of llvm-mca were inspired by Intel's performance analysis tool IACA and aimed to create its alternative. According to users, the output of the tool (its formatting and quantity) indeed resembles IACA — an example can be found here. However, llvm-mca only understands AT&T syntax, so you will likely need to use converters to work with it.

What we write about in our blogs and social media:

Benchmarks for servers on Linux: a collection of open tools "Mathematical Model from Wall Street" or how to optimize cloud costs

Benchmarks for servers on Linux: a collection of open tools What we write about on Habr:
Benchmarks for servers on Linux: a collection of open tools Risk Minimization: How to Protect Your Data

Benchmarks for servers on Linux: a collection of open tools Books for Those Who Are Already in System Administration or Just Planning to Start
Benchmarks for servers on Linux: a collection of open tools Selection: five books and one course on networking

Benchmarks for servers on Linux: a collection of open toolsAt 1cloud.ru, we offer a free service forDNS hosting. You can manage DNS records through a single personal account.

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster