Trying out `shiftfs`

Here are some benchmarks, on Ubuntu 19.10 (latest daily).

Before enabling shiftfs

myusername@myusername-desktop:~$ time lxc launch ubuntu:18.04 mycontainer
Creating mycontainer
Starting mycontainer

real	0m2,551s
user	0m0,074s
sys	0m0,033s
myusername@myusername-desktop:~$ time lxc launch ubuntu:18.04 mycontainer2
Creating mycontainer2
Starting mycontainer2

real	0m2,550s
user	0m0,071s
sys	0m0,034s
myusername@myusername-desktop:~$ time lxc launch ubuntu:18.04 mycontainer3
Creating mycontainer3
Starting mycontainer3

real	0m2,718s
user	0m0,069s
sys	0m0,036s
myusername@myusername-desktop:~$ 

After enabling shiftfs

myusername@myusername-desktop:~$ time lxc launch ubuntu:18.04 mycontainer
Creating mycontainer
Starting mycontainer

real	0m0,513s
user	0m0,070s
sys	0m0,041s
myusername@myusername-desktop:~$ time lxc launch ubuntu:18.04 mycontainer2
Creating mycontainer2
Starting mycontainer2

real	0m0,473s
user	0m0,066s
sys	0m0,031s
myusername@myusername-desktop:~$ time lxc launch ubuntu:18.04 mycontainer3
Creating mycontainer3
Starting mycontainer3

real	0m0,550s
user	0m0,072s
sys	0m0,027s
myusername@myusername-desktop:~$ 

This shows that the creation speed went from 2.5s down to 500s (SSD disk, using ZFS over a loop file).

Using lxd-benchmark but no shiftfs

$ lxd.benchmark launch --count 10 --parallel 10 ubuntu:18.04
Test environment:
  Server backend: lxd
  Server version: 3.14
  Kernel: Linux
  Kernel architecture: x86_64
  Kernel version: 5.0.0-17-generic
  Storage backend: zfs
  Storage version: 0.7.12-1ubuntu5
  Container backend: lxc
  Container version: 3.1.0

Test variables:
  Container count: 10
  Container mode: unprivileged
  Startup mode: normal startup
  Image: ubuntu:18.04
  Batches: 1
  Batch size: 10
  Remainder: 0

[Jul  2 12:41:37.107] Found image in local store: 6ae1c6e92017402f1aee655fa8d785ee9d2337a3369d76115cecad5e7a303e07
[Jul  2 12:41:37.107] Batch processing start
[Jul  2 12:41:46.664] Processed 10 containers in 9.557s (1.046/s)
[Jul  2 12:41:46.664] Batch processing completed in 9.557s

Using lxd-benchmark and shiftfs

$ lxd.benchmark launch --count 10 --parallel 10 ubuntu:18.04
Test environment:
  Server backend: lxd
  Server version: 3.14
  Kernel: Linux
  Kernel architecture: x86_64
  Kernel version: 5.0.0-17-generic
  Storage backend: zfs
  Storage version: 0.7.12-1ubuntu5
  Container backend: lxc
  Container version: 3.1.0

Test variables:
  Container count: 10
  Container mode: unprivileged
  Startup mode: normal startup
  Image: ubuntu:18.04
  Batches: 1
  Batch size: 10
  Remainder: 0

[Jul  2 12:38:16.553] Found image in local store: 6ae1c6e92017402f1aee655fa8d785ee9d2337a3369d76115cecad5e7a303e07
[Jul  2 12:38:16.553] Batch processing start
[Jul  2 12:38:18.353] Processed 10 containers in 1.800s (5.557/s)
[Jul  2 12:38:18.353] Batch processing completed in 1.800s

This was launching 10 Ubuntu containers in parallel. The time spent, when from 9.5s way down to 1.8s.

2 Likes