2

When the CPU (Intel i5-8400) is heavily loaded, the fan seems to increase its speed and make noise.

I want to eliminate the noise when running CPU-intensive backup process (backup2l program). (It is apparently CPU-intensive because of compressing backup with gzip.)

How to make a process not to use turbo boost?

My OS is Ubuntu Linux 18.10.

If such a feature is not available in Linux, we should report a feature suggestion.

8
  • 1
    Consider using nice ..
    – tink
    Dec 19, 2018 at 22:28
  • @tink I already have nice -n 19 backup2l -b but this seems not to work. Should we report feature suggestion to prevent turbo boost for nice processes?
    – porton
    Dec 19, 2018 at 22:30
  • 3
    If nice doesn't do the trick consider cpulimit or using cgroups.
    – tink
    Dec 19, 2018 at 22:32
  • 3
    Aiui nice is for priority, cpulimit is what you want. Also, you may want to change fan settings in your "BIOS", but careful not to overheat anything.
    – pbhj
    Dec 19, 2018 at 23:52
  • 3
    Also bear in mind that the turbos kick in because the BIOS figures it needs the additional cooling because of the CPU doing a lot of hard work. If you shut off the additional cooling but don't decrease the workload, you're going to have a bad time... Dec 20, 2018 at 10:21

3 Answers 3

7

That's what cpulimit is for:

cpulimit --exe=gzip --background --limit=100
cpulimit --exe=tar --background --limit=100

this will limit the total CPU usage of the most CPU-resource intensive programs used by the backup2l script to 100% per core. If that would still make too much noise, reduce that number until your machine is quiet again.

After backup2l is finished, just killall cpulimit to go back to normal operations.

Note: your backup might take twice as long if you limit it to only 2 cores just like a car: the faster, the noisier...

2
  • When I started it manually with --monitor-forks, I had at least a few tens (maybe hundreds) of cpulimit processes and my system became nearly unrespponsible
    – porton
    Dec 30, 2018 at 1:03
  • And note that cpulimit will use kill -CONT and kill -STOP to emulate this behaviors. (Maybe I am wrong about that) Jan 2, 2019 at 16:48
5

/usr/local/bin/myproclimitator:

#!/bin/bash
#
PIDNUM=$1

while sleep 1;do 
 kill -CONT $PIDNUM
 sleep 0.1
 kill -STOP $PIDNUM || exit 
done

Call it like:

myproclimitator pidnum 
16
  • 1
    This is wonderful, I also once thought SIGSTOP was a golden ticket... except a lot of processes will not expect being stopped constantly. Tell me which complex processes that tolerate being stopped once every 100ms, please.
    – user2497
    Dec 28, 2018 at 12:48
  • All process should be fine, because this is similar from what multitask system does to run more than one process in a single cpu for example. Dec 28, 2018 at 13:12
  • 1
    Please be more specific If you already know that, why you ask me ? Dec 28, 2018 at 15:24
  • 1
    My acknowledge is limited for now to this: It should not have any trouble without any program. Open a new question and try to be more specific. Show a running example. Maybe someone can help you better. Dec 28, 2018 at 16:51
  • 2
    Neither I. I really believe in you, but I just cannot imagine a logical reason for the problem you describe. Are you pretty sure that everyone has this problems? This inconsistencies you experienced are not related to time or date ? I will test more when I am at home. Dec 28, 2018 at 18:48
4

From Processor boosting control:

/sys/devices/system/cpu/cpufreq/boost

controls the boost setting for the whole system. You can read and write that file with either "0" (boosting disabled) or "1" (boosting allowed).

This is a global setting, so writing a 0 there will prevent all processes from using boost and making a noise.

1
  • I do not want all processes to stop use boosts. So your answer is not to my question.
    – porton
    Dec 20, 2018 at 19:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .