How to slow down a command line process on macOS?

On macOS you have the classical nice command similar to linux to reduce the process priority. You can use it like this:

nice -n 20 myProcess

The priority can be adjusted over a range of -20 (the highest – the quickest) to 20 (the lowest – the slowest).

But you can go further and reduce also the disk IO. There is no ionice command on macOS but you can use taskpolicy as described in this article:

taskpolicy -b myProcess

With the 2 commands I was able to divide per 5 the speed of a process (it’s sometimes useful when you want to simulate a degradation of the runtime environment)

One thought on “How to slow down a command line process on macOS?”

Comments are closed.