You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Entries are going to be removed from the table upon reaching EOL.
56
+
May the list above be exhausted this notice will be dropped altogether.
57
+
58
+
### Performance
59
+
60
+
[Loop devices are notorious for their "bad" performance]. While it's not arguable that they incur and some overhead both
61
+
in terms of CPU and memory it, it always should be evaluated in a context of a concrete use case. Generally speaking,
62
+
if one does not constantly `fsync` after each write to a filesystem based on a loopback device \[and just let kernel do its job\]
63
+
the performance seems to be comparable to regular block devices. Although, it must be noted that in such cases write
64
+
operations are susceptible to the "double caching" issue where data are cached first while being written to the loopback
65
+
device backed filesystem and then data cached again while changes are bing finally committed to the backing block device.
66
+
This means that there may be a delay (on average, up to a 2 x 30 seconds = 1 minute) before writes will become durable
67
+
by being committed to the backing block device. Also, cache buffers are usually freed and committed more often when
68
+
system runs low on memory which means that usage of loopback devices is unlikely to degrade performance of the system as
69
+
a whole but system running low on memory is likely to have loopback devices performing worse. For the record, cache memory
70
+
is not being counted against `memory.max_usage_in_bytes` cgroup controller and therefore is ignored by Docker.
71
+
72
+
Last but not least, the release of Linux kernel `v4.4` includes "[Faster and leaner loop device with Direct I/O and Asynchronous I/O support]"
73
+
which [circumvents the "double buffering" issue].
74
+
75
+
In terms of CPU, while no comprehensive benchmarks have been done during development of the plugin, the overhead seem to
76
+
be negligible.
77
+
15
78
16
79
## Development
17
-
Go 1.11
80
+
Go 1.11 modules
81
+
18
82
```bash
19
83
go mod vendor
20
84
go mod tidy
21
85
```
22
86
23
-
# Extra
24
-
validate options
87
+
## License
88
+
89
+
This is free and unencumbered software released into the public domain. See [LICENSE](./LICENSE)
25
90
26
-
if _, err := exec.LookPath("mkfs.xfs"); err != nil {
27
-
logrus.Fatal("mkfs.xfs is not available, please install xfsprogs to continue")
28
-
}
91
+
[Loop devices are notorious for their "bad" performance]: https://serverfault.com/questions/166748/performance-of-loopback-filesystems
92
+
[Faster and leaner loop device with Direct I/O and Asynchronous I/O support]: https://kernelnewbies.org/Linux_4.4#Faster_and_leaner_loop_device_with_Direct_I.2FO_and_Asynchronous_I.2FO_support
93
+
[circumvents the "double buffering" issue]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bc07c10a3603a5ab3ef01ba42b3d41f9ac63d1b6
allocated_size="$(($(run stat -c '%b %B' ${DATA_DIR}/${volume}.${FS}| tr ' ' '*')))"# allocated space in bytes
27
+
apparent_size="$(run stat -c '%s'${DATA_DIR}/${volume}.${FS})"# apparent space in bytes
28
28
29
29
# checks
30
30
assertTrue "Regular ${FS} volume of ${apparent_size} MiB should take at least same space: ${allocated_size} MiB""[ ${allocated_size} -ge ${apparent_size} ]"
0 commit comments