

At that level the scheduler will see it as a lower priority task and give it less CPU resources. The nice command (without any additional parameters) will start a process with a niceness of 10. Processes on Linux are started with a niceness of 0 by default. The niceness level ranges from -20 (most favorable scheduling) to 19 (least favorable). This is useful when you need to run a CPU intensive task as a background or batch job. The nice command tweaks the priority level of a process so that it runs less frequently. Now run top and you will see that the matho-primes process is using all the available CPU.Įxit top (press the q key) and kill the matho-primes process ( fg to bring the process to the foreground and press CTRL+C). Since we don’t really want to keep the list, the output is redirected to /dev/null. This will generate a list of prime numbers from zero to nine billion nine hundred ninety-nine million nine hundred ninety-nine thousand nine hundred ninety-nine.

Run the command like this: /usr/local/bin/matho-primes 0 9999999999 > /dev/null & You will now have the matho-primes binary in /usr/local/bin.
#Ntopng gzip cpu usage install#
Run make and sudo make install to build and install the binaries. Change directory into mathomatic-16.0.5/primes.
#Ntopng gzip cpu usage archive#
Download the source code from and then unpack the archive file. There isn't a prebuilt package for CentOS so you will need to build it yourself.
#Ntopng gzip cpu usage generator#
We will be using CentOS as our base system, and to artificially load the processor we can use the prime number generator from the Mathomatic toolkit. Simulating high CPU usageīefore looking at these three techniques, we need to find a tool that will simulate high CPU usage on a system. Let's look at how these work and the pros and cons of each.
