

usecpu.sh &After initiation, you will receive a result of process id, for example, 1887:

Sudo chmod +x usecpu.shThe created process can be started using:

When the file is created, set executable permission for it: This code will create a loop that will consume all of the server's CPU. While : do : done Save the code on your file. Sudo nano usecpu.shEnter the following code into the usecpu.sh file: To check the effectiveness of CPULimit, let's create a process ( usecpu.sh) that will consume all of your server's CPU: Sudo yum install cpulimitor sudo dnf install cpulimit 2. Sudo yum install epel-releaseAfterward, the installation can be initiated: Sudo apt-get install cpulimit 1.2 Installation if using CentOS/Fedora:įirstly, it will be required to install the EPEL repository if it was not done previously: When the limitation is implemented, there is no influence on the nice value or the settings on priorities, but on real CPU usage instead. The main purpose of CPULimit is to set a restriction on the specific process on how much CPU it can use. This can be solved by limiting CPU resource usage with CPULimit software. Since when one process is using all of the resources, other processes have to wain in the queue to start their tasks. Such usage will cause issues for other processes to work properly on your VPS instance. There can be cases when your server performance can slow down when even a single process uses all of your server CPU capability.
