Extremely poor webui performance when servers have a lot of files

Hi, I notice that mineos repeatedly walks the filesystem of all the servers, presumably to work out how much diskspace they use.

However, this really bad for servers with lots of files (eg. those running dynmap, which in default configuration stores map tiles as separate files). Thus it’s not unreasonable for a single long-running server to consist of more than 800000 files. MineOS webui ends up spending all of its time walking filesystems trees, and none of it doing actually useful work, such as presenting a UI in a reasonable amount of time. :stuck_out_tongue:

Even after reducing the file count, issues can persist, with MineOS continuing to use more CPU than any of the minecraft servers. Is it really necessary to walk /proc/ multiple times per second?

root@minecraft2019:/var/games/minecraft/servers/SpacePolitixMC/plugins/dynmap/web# strace -tt -f -p 24206 2>&1|grep '/proc/[1]/environ'
[pid 24206] 14:55:42.910365 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 16
[pid 24206] 14:55:43.436366 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 16
[pid 24206] 14:55:43.986817 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 16
[pid 24206] 14:55:44.507240 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 16
[pid 24206] 14:55:45.057636 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 16
[pid 24206] 14:55:47.731543 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 18
[pid 24206] 14:55:48.260164 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 18
[pid 24206] 14:55:48.864853 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 18
[pid 24206] 14:55:49.412424 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 18
[pid 24206] 14:55:50.016674 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 20
[pid 24206] 14:55:50.627371 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 20
[pid 24206] 14:55:51.233290 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 20
[pid 24206] 14:55:51.896682 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 20
[pid 24206] 14:55:52.507238 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 20
[pid 24206] 14:55:53.149310 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 20
[pid 24206] 14:55:53.725930 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 21
[pid 24206] 14:55:53.987681 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 21
[pid 24206] 14:55:54.573704 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 21
[pid 24206] 14:55:54.999960 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 21
[pid 24206] 14:55:55.717006 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 21
[pid 24206] 14:55:56.464455 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 21
[pid 24206] 14:55:56.948499 openat(AT_FDCWD, "/proc/1/environ", O_RDONLY|O_CLOEXEC) = 22

Oh, this has already been reported.