Open broberts-zd opened 10 years ago
I like this!
cc @osheroff
It's not OS-independent, though. This is a Linux-specific way of gathering load average and the number of CPUs. If a Gem exists that can obtain system facts in an OS-independent way, I'd use that instead.
Also I think run policy is better enforced elsewhere, like in a wrapper script.
Typically this should be done in a wrapper script in accordance with separation of concerns between general functionality of the app (mostly developers province) and the specific operational reality of our environment (mostly ops). But but but.... I think we are going to have to go with this austerity option anyway. We need to add something to ultragrep to prevent it from driving up the load average too much. 7% of our PD alerts come from ultragrep running the way it currently does - and adding this load check to prevent it from running won't solve the issue. Just one instance of ultragrep (I think) will set off alerts. What I proposed here was just the first part of --austerity-mode, I was planning to also limit its resource usage (see op-5030).
Another concern is: should this be in the open source version of ultragrep? If not, just fork.
... not the program will do a load average check prior to running