Added minimum threshold of cpu-usage for limited process #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides the option that
cpulimit
send STOP signal to processes only using more than given value. This funciton is important specifically when the cpu-usage of each process is unbalaced. For example, when we would like to limit cpu-usage of parallel wrokers which execute some function on url string and donwload images based on it. Since originalcpulimit
does send STOP signal to all process, it causes inefficency due to interference with downloading image, which is not use much cpu.To solve this problem, I newly add the option to stop process consuming much cpu resource and leave not-cpu-bounded processes to continue, making it possible to process with efficiency.
We can use it as
cpulimit -l 10 -i -m 0.01
. This means process using more than 1% of cpu are stopped, and the others are ignored bycpulimit
.