Zygo / bees

Best-Effort Extent-Same, a btrfs dedupe agent
GNU General Public License v3.0
655 stars 55 forks source link

bees "--loadavg=3" option causes load crazy 20+ and OOM kill #271

Open petaramesh opened 9 months ago

petaramesh commented 9 months ago

Hello,

I have been using bees (updated to the latest version) on my BTRFS NAS for years with great satisfaction, however it uses much IO bandwidth and sometimes thrashes badly my BTRFS disks and system performance, with a system load going above 5-6 for hours (bees high activity sometimes lasting for days...)

So I wanted to limit the system load and added "--loadavg-target 3" to OPTIONS in beesd.conf and restarted bees.

Immediately the system load started rising and quickly went well over 20, and eventually my system OOM killer kicked in and killed bees. Weird !

Then I figured out I had missed the "=" sign in "--loadavg-target=3", so I added it and rebooted (because I wansn't sure of the state of my system after an OOM kill).

Alas even with this "--loadavg-target=3" setting the system load quickly rised above 10+ so I stopped bees, completely removed the "--loadavg-target" option, restarted, and things went back to usual : with a load high, but sustainable.

So I wonder why the "--loadavg-target=3" did the exact contrary of what I was expecting...

Checking my system logs, it however shows that it was actually understood :

beesd[3096]: bees[3096]: setting load average target to 3 beesd[3096]: bees[3096]: setting worker thread pool minimum size to 0 beesd[3096]: bees[3096]: setting worker thread pool maximum size to 2 beesd[3096]: bees[3096]: setting root path to '/run/bees/mnt/' beesd[3096]: bees[3096]: Starting bees main loop...

Some system info :

kakra commented 5 months ago

bees doesn't look at the loadavg values you are looking at, instead it looks at an inverse value which extrapolates the immediate current value from the other values (thus reversing the average). This may explain your observation.

Still, it should not have the opposite effect of not running with a limiter at all. Maybe bees doesn't respect some other parameters properly when using the limiter? Maybe spawning too many threads? @Zygo