Search My Techie Guy

Monday, July 13, 2020

This Linux command forces the CPU to work on compressing a continuous stream of random data

You can use this linux command to stress test your system CPU, it forces the CPU to work on compressing a continuous stream of random data:

[root@cacti-testbed jnomwesigwa]# dd if=/dev/urandom | gzip -9 >> /dev/null &[2] 1933[root@cacti-testbed jnomwesigwa]#


You can then use the top command to monitor the CPU utilization in real time. 






To stop this process, run the following command to find the "dd" process id (e.g 2106) and kill it. 

[root@cacti-testbed jnomwesigwa]# ps -ef | grep ddroot 2 0 0 21:51 ? 00:00:00 [kthreadd]root 152 2 0 21:51 ? 00:00:00 [ipv6_addrconf]dbus 708 1 0 21:51 ? 00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-onlyroot 2106 1 20 22:08 pts/0 00:01:16 dd if=/dev/urandomroot 2201 2178 0 22:14 pts/0 00:00:00 grep --color=auto dd[root@cacti-testbed jnomwesigwa]# [root@cacti-testbed jnomwesigwa]# [root@cacti-testbed jnomwesigwa]# [root@cacti-testbed jnomwesigwa]# kill -9 2106


No comments: