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)

GD Star Rating
GD Star Rating

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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


This site uses Akismet to reduce spam. Learn how your comment data is processed.