Found a workaround for sa-learn high CPU usage

This thread described a problem with sa-learn consuming huge amounts of CPU, eventually bogging down the machine and using all available memory. Here’s how it looks in munin:

Processes
CPU usage

I found this script that wraps the sa-learn script as a workaround for exactly this issue. It checks current load and backs off if it’s high. Spam processing is generally not a high profile activity, so while this will slow down processing a bit, it should not cause major issues. I have set it up on my MIAB, and I’ll see how it goes.

1 Like

Please consider submitting a PR to the project GitHub.

Do you mind describing in a little more detail how you’re modifying things in a MIAB context? Do you know if MIAB updates will overwrite it?

How often have you been seeing the sa-learn issue? For me it’s very unpredictable and sporadic, but quite bad when it occurs. Keen to hear if you think this fix has worked! :slight_smile: