Giter VIP home page Giter VIP logo

resctl-demo's Introduction

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 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, disable selinux by setting SELINUX=disabled 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.

resctl-demo's People

Contributors

htejun avatar plv avatar davide125 avatar saravan2 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.