Feh / nocache

minimize caching effects
BSD 2-Clause "Simplified" License
554 stars 53 forks source link

nocache works, systemd-run doesn't #52

Open alkisg opened 1 year ago

alkisg commented 1 year ago

This is the first issue I have ever opened to say that "your program works better than the alternative that you suggest"!

Test case, first without any optimizations:

Then I try with nocache:

==> this is the correct optimization I'm looking for, to favor the user process.

Then I try the same thing with the systemd-run command that you mention in https://github.com/Feh/nocache#if-you-use-systemd. I get the same results as "without any optimizations", 7 minutes and 2.5 minutes.

I do NOT notice this thing you mention:

During (notice how buff/cache only goes up by ~300MiB):

I was NOT able to make systemd-run limit the pagecache. buff/cache for me was using all the RAM, and my "free" column went down to almost zero.

The systemd.resource-control manpage mentions that:

Options for controlling the Legacy Control Group Hierarchy (Control Groups version 1 are now fully deprecated: CPUShares=weight, StartupCPUShares=weight, MemoryLimit=bytes, ...

So I tested with the recommended MemoryHigh instead, and I even tried MemoryMax, to no avail. I was unable to make systemd-run NOT fill up the RAM with the pagecache, and as a result, the user-process couldn't keep its own pages in RAM and needed 2.5 minutes instead of 1.5 minute.

==> So I guess the actual issue is, "could you please update README.md with a working example for the newer cgroups v2?"