Comments on Linux taskset Command Tutorial for Beginners (with Examples)

In this tutorial, we will discuss a utility - dubbed taskset - that lets you achieve processor affinity. Ever heard of the term processor affinity? It's a feature that allows you to bind or unbind processes to a particular central processing unit, or a range of CPUs.

3 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Krish

By far the best tutorial I've seen on this topic..

By: Wes McGee

It is a great help.  Especially as I am the novice 'tinkerer'.  So I've been googling to learn about taskset and how I might be able to have my two instances of Octoprint  (Octoprint and Octoprint2 processes?) run on seperate cores of my raspberry pi.  Which in turn brings about more questions like *)Can I just designate the cores by number 0,1,2,3. *)Which file in the bootloader or config file can I edit and insert the taskset options I need where the file is called.  *) and would assigning the two server processes to individual cores even be beneficial to the performance of my little printing setup.

But this definately helped me in learning that it can be done and showed me the route I need to be headed in.

By: prochor666

Not working on Debian 11 (16 CPUs) and Ubuntu 22.04 (24 CPUs). Getting affinity is ok, but setting affinity does not work.