• Stars
    star
    149
  • Rank 248,619 (Top 5 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 26 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Demonstrate and benchmark various features of Linux resource control in a self-contained package.

resctl-demo logo

Resource control aims to control compute resource distribution to improve reliability and utilization of a system. The facebook kernel and container teams have been intensively researching and implementing mechanisms and methods to advance resource control. This repository contains two projects - resctl-demo and resctl-bench.

resctl-demo

resctl-demo demonstrates and documents various aspects of resource control using self-contained workloads in guided scenarios.

resctl-demo in action

resctl-bench

resctl-bench is a collection of whole-system benchmarks to evaluate resource control and hardware behaviors using realistic simulated workloads.

Comprehensive resource control involves the whole system. Furthermore, testing resource control end-to-end requires scenarios involving realistic workloads and monitoring their interactions. The combination makes benchmarking resource control challenging and error-prone. It's easy to slip up on a configuration and testing with real workloads can be tedious and unreliable.

resctl-bench encapsulates the whole process so that resource control benchmarks can be performed easily and reliably. It verifies and updates system configurations, reproduces resource contention scenarios with a realistic latency-sensitive workload simulator and other secondary workloads, analyzes the resulting system and workload behaviors, and generates easily understandable reports.

Read the documentation for more information.

Premade System Images

Comprehensive resource control has many requirements, some of which can be difficult to configure on an existing system. resctl-demo provides premade images to help getting started. Visit the following page for details:

https://facebookmicrosites.github.io/resctl-demo-website

Installation

resctl-demo and resctl-bench are packaged in Fedora as of Fedora 34 and in EPEL as of EPEL 8. They can be installed with:

sudo dnf install resctl-demo resctl-bench

which will pull in any other dependencies that might be required. On Fedora, you will also want to disable zram based swap:

touch /etc/systemd/zram-generator.conf
systemctl stop dev-zram0.swap

For other distributions, please follow the next sections to install from cargo or from source.

Installation with cargo

resctl-demo and resctl-bench can be installed using cargo which is the package manager for rust. cargo can be installed with rustup:

https://rustup.rs/

For distro-specific way to install cargo, see the distro sub-sections. Note that the distro packaged version might not be recent enough.

Once cargo is available, run the following command to install resctl-bench and resctl-demo. Don't forget to install rd-hashd and rd-agent.

cargo install rd-hashd rd-agent resctl-demo resctl-bench

cargo installs under $HOME/.cargo/bin by default. Feel free to copy them elsewhere as convenient. For example:

cd ~/.cargo/bin
cp rd-hashd rd-agent resctl-demo resctl-bench /usr/local/bin

Information on installing cargo and other dependencies on different distros follows.

Arch

Installing cargo:

pacman -S --needed rust

The common dependencies:

pacman -S --needed coreutils util-linux python python-bcc fio stress

oomd is available through AUR:

git clone https://aur.archlinux.org/oomd-git.git oomd-git
cd oomd-git
makepkg -si

resctl-demo needs the followings to plot graphs and run linux build job as one of the workloads:

pacman -S --needed gnuplot gcc binutils make bison flex pkgconf openssl libelf

Fedora

Installing cargo:

dnf install cargo

The common dependencies:

dnf install coreutils util-linux python3 python3-bcc fio stress oomd

resctl-demo needs the followings to plot graphs and run linux build job as one of the workloads:

dnf install gnuplot gcc binutils make bison flex pkgconf openssl-devel elfutils-devel

Disable zram based swap:

touch /etc/systemd/zram-generator.conf
systemctl stop dev-zram0.swap

If journalctl -u rd-agent shows EXEC failures, put SELinux in permissive mode by setting SELINUX=permissive in /etc/selinux/config and rebooting.

Ubuntu

Installing cargo:

apt install cargo

The common dependencies:

apt install coreutils util-linux python3 python3-bpfcc fio stress oomd

resctl-demo needs the followings to plot graphs and run linux build job as one of the workloads:

apt install gnuplot gcc binutils make bison flex pkgconf libssl-dev libelf-dev

Building and Installing Manually

Building is straight-forward. Check out the source code and run:

cargo build --release

Installing from local source directory:

cargo install --path rd-hashd
cargo install --path rd-agent
cargo install --path resctl-demo
cargo install --path resctl-bench

Alternatively, run build-and-tar.sh script to create a tarball containing the binaries:

./build-and-tar.sh

You can install resctl-demo and resctl-bench by simply untarring the resulting tarball:

cd /usr/local/bin
tar xvzf $SRC_DIR/target/resctl-demo.tar.gz

Follow the instructions in the Installation section to install other dependencies.

Running resctl-demo

resctl-demo should be run as root in hostcritical.slice. Use the following command:

sudo systemd-run --scope --slice hostcritical.slice --unit resctl-demo /usr/local/bin/resctl-demo

Requirements

The basic building blocks are provided by the Linux kernel's cgroup2 and other resource related features. On top, usage and configuration methods combined with user-space helpers such as oomd and sideloader implement resource isolation to achieve workload protection and stacking.

  • Linux kernel in the git branch https://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git resctl-demo-v5.13-rc7 which contains the following extra commits on top of v5.13-rc7:
  • cgroup2
  • btrfs on non-composite storage device (sda or nvme0n1, not md or dm)
  • Swap file on btrfs at least as large as 1/3 of physical memory
  • systemd
  • oomd
  • dd, stdbuf, findmnt, python3, fio, stress, gnuplot, gcc, ld, make, bison, flex, pkg-config, libssl, libelf

License

resctl-demo is apache-2.0 licensed, as found in the LICENSE file.

More Repositories

1

Recoil

Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.
JavaScript
19,610
star
2

libunifex

Unified Executors
C++
1,479
star
3

hermit

Hermit launches linux x86_64 programs in a special, hermetically isolated sandbox to control their execution. Hermit translates normal, nondeterministic behavior, into deterministic, repeatable behavior. This can be used for various applications, including replay-debugging, reproducible artifacts, chaos mode concurrency testing and bug analysis.
Rust
1,189
star
4

Robyn

Robyn is an experimental, AI/ML-powered and open sourced Marketing Mix Modeling (MMM) package from Meta Marketing Science. Our mission is to democratise modeling knowledge, inspire the industry through innovation, reduce human bias in the modeling process & build a strong open source marketing science community.
Jupyter Notebook
1,104
star
5

MIRAI

Rust mid-level IR Abstract Interpreter
Rust
1,004
star
6

reverie

An ergonomic and safe syscall interception framework for Linux.
Rust
544
star
7

ExtendedAndroidTools

Extended Android Tools is a place to host and maintain a build environment and makefiles cross compiling Linux tools we all love for Android.
Python
174
star
8

object-introspection

Object Introspection (OI) enables on-demand, hierarchical profiling of objects in arbitrary C/C++ programs with no recompilation.
C++
153
star
9

allocative

Library and proc macro to analyze memory usage of data structures in rust.
Rust
125
star
10

rust-shed

Repository containing Rust crates common between other Facebook open source projects (like Mononoke or Eden).
Rust
102
star
11

go-media-webtransport-server

WebTransport media server that enables ultra low latency live streaming over QUIC (also VOD and rewind)
Go
94
star
12

webcodecs-capture-play

Live streaming low latency experimentation platform in the browser (using WebCodecs)
JavaScript
88
star
13

moq-encoder-player

This project is provides a minimal implementation (inside the browser) of a live video and audio encoder and video / audio player creating and consuming IETF MOQ stream. The goal is to provide a minimal live platform components that helps testing IETF MOQ interop
HTML
50
star
14

siMMMulator

siMMMulator is an open source R-package that helps users to generate simulated data to plug into Marketing Mix Models (MMMs). The package features a variety of functions to help users build a data set from scratch.
R
45
star
15

moq-go-server

This is an experimental relay (optimized for low latency media transfers) that implements IETF MOQ protocol
Go
43
star
16

MemorySnapshotAnalyzer

Analysis tooling for memory snapshots of managed code runtimes, specifically, Unity Memory Snapshots.
C#
31
star
17

protoquant

Prototype routines for GPU quantization written using PyTorch.
Python
19
star
18

moxygen

Implementation of IETF MOQ protocol
Python
15
star
19

kperf

TCP and TLS performance testing tool.
C
11
star
20

edencommon

Shared library for Watchman and Eden projects.
C++
11
star
21

propellint

A tool joining profile information with static analysis.
C++
5
star
22

r8

Customized version of the D8 dexer and R8 shrinker
Java
5
star
23

usb-video

Android library and app for streaming content from USB Video Class (UVC) devices.
C++
4
star
24

CARL

Classical Action Recognition Library
C++
4
star
25

WMG

Serverless Application Model (SAM) project to deploy a Cloudformation insfrastructure capable of measuring signals in WhatsApp conversations.
JavaScript
3
star
26

iot-session-manager

The IoT Session Manager is an application that provides a reliable and scalable device to device messaging network with simple setup. The system is deployable locally on a machine or on a cloud server and provides extensible methods for device authentication and control automation.
Python
3
star
27

free-threading-benchmarking

Benchmark results for free-threaded builds of Python
3
star
28

xrpa

Xrpa (pronounced "zerpa") is a platform architecture framework for building experimental XR experiences.
C++
3
star
29

fnob

Open source Fnob (Command-line Dynamic Random Generator) package;
SystemVerilog
2
star
30

Rmdkernel

This is a very simple fork of https//github.com/IRkernel/IRkernel to provide an rmarkdown (rather than R) jupyter kernel.
Jupyter Notebook
2
star
31

ndctl

A "device memory" enabling project encompassing tools and libraries for CXL, NVDIMMs, DAX, memory tiering and other platform memory device topics. Forked from https://github.com/pmem/ndctl
C
2
star
32

csproj_benchmark

A tool that generates Visual Studio C# projects and measures IDE startup performance
C#
1
star