Install cpulimit by entering the following commands in the terminal:
sudo apt update sudo apt install cpulimit
Description:
tool for limiting the CPU usage of a process
cpulimit is a simple program that attempts to limit the CPU usage of a process (expressed in percentage, not in CPU time). This is useful to control batch jobs, when you don't want them to eat too much CPU. It does not act on the nice value or other priority stuff, but on the real CPU usage. Besides it is able to adapt itself to the overall system load, dynamically and quickly.
Homepage: http://limitcpu.sourceforge.net/
Version: 2.5-1
Section: universe/admin