Search

A.15. taskset

download PDF
The taskset tool is provided by the util-linux package. It allows administrators to retrieve and set the processor affinity of a running process, or launch a process with a specified processor affinity.

Important

taskset does not guarantee local memory allocation. If you require the additional performance benefits of local memory allocation, Red Hat recommends using numactl instead of taskset.
To set the CPU affinity of a running process, run the following command:
# taskset -pc processors pid
Replace processors with a comma delimited list of processors or ranges of processors (for example, 1,3,5-7. Replace pid with the process identifier of the process that you want to reconfigure.
To launch a process with a specified affinity, run the following command:
# taskset -c processors -- application
Replace processors with a comma delimited list of processors or ranges of processors. Replace application with the command, options and arguments of the application you want to run.
For more information about taskset, see the man page:
$ man taskset
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.