To limit CPU time utilization in multiprocessor/multithreaded systems, a new option, `limits.cpu_max_count`, has been added to the main nxs-backup config. This option allows you to set an integer limit on the number of CPU's used to run nxs-backup. This restriction only applies to operations performed directly by nxs-backup (data compression), external utilities called from nxs-backup are not subject to this restriction. The default value of 0, means that all available cpu's will be used.
Here is an example of config CPU usage limit in nxs-backup.conf
:
include_jobs_configs: ["conf.d/*.conf"]
limits:
cpu_max_count: 4
In this example, nxs-backup will not use more than 4 CPU when compressing data.
For single-core/single-threaded systems, there is no support for limiting CPU consumption built into nxs-backup. However, you can use cgroups or cpulimit to limit CPU time as a percentage.
Here is an example of running the nxs-backup
with cpulimit
::
$ cpulimit -l 50 -- nxs-backup start
In this example, nxs-backup will be limited to the cpulimit utility and will not use more than 50% of CPU time.