Skip to content

Instantly share code, notes, and snippets.

@gbrayut
Last active July 8, 2022 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbrayut/7075c2a3cd3fa662d14b50bfb53d9315 to your computer and use it in GitHub Desktop.
Save gbrayut/7075c2a3cd3fa662d14b50bfb53d9315 to your computer and use it in GitHub Desktop.
systemd-nspawn latency
$ uname -a;systemctl --version
Linux gbmint02 5.4.0-113-generic #127-Ubuntu SMP Wed May 18 14:30:56 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
systemd 245 (245.4-4ubuntu3.17)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid
$ sudo machinectl pull-tar http://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-root.tar.xz
$ time /bin/sh -c 'ls /sys/fs/cgroup >/dev/null'
real 0m0.006s
user 0m0.003s
sys 0m0.003s
$ time sudo systemd-nspawn -qM focal-server-cloudimg-amd64-root /bin/sh -c 'ls /sys/fs/cgroup >/dev/null'
real 0m0.072s
user 0m0.019s
sys 0m0.017s
$ time docker run --rm --network none --entrypoint '' -it ubuntu:20.04 /bin/sh -c 'ls /sys/fs/cgroup >/dev/null'
real 0m0.532s
user 0m0.025s
sys 0m0.018s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment