In HPC, we may need to protect head node from unnecessary heavy process that may cause login problem for users. One of the solutions is by using cpulimit. We can create a cronjob to monitor all processes and set certain limit for them. This is how I usually did in CentOS/RHEL 7.x.
yum install cpulimit
- Create a script to monitor the process. The script below is a modified version of the script in this forum. You can modify inputs of the first 3 variables:
CPU_LIMIT, BLACK_PROCESSES_LIST, and WHITE_PROCESSES_LIST.