This is an old revision of the document!


Redhat Enterprise Linux / RHEL

How do I set the real time scheduling priority of a process?

In the event that a process is not achieving the desired performance performance benchmarks, it can be helpful to set CPU affinity, real-time scheduling policy and real-time scheduling priority. Experimenting with different options using the taskset and chrt commands can help determine if this approach will provide the desired results.

The taskset sets CPU affinity for a process. The chrt sets real time scheduling options. The two commands can be used in tandem. For example:

 taskset -c 2-3 chrt -f 1 <command>

The above usage would force <command> to run on CPUs 2 through 3, using the “fifo” scheduling policy at priority level 1. The results of using these options depend on the workload of the application, as well as the load of the system in general.

For more information on the taskset and chrt commands, see their respective man pages. For more information on setting these attributes within an application, rather than when launching the application, see man 2 sched_setaffinity and man 2 sched_setscheduler.

Red Hat’s customer service and support teams receive technical support questions from users all over the world. Red Hat technicians add the questions and answers to Red Hat Knowledgebase on a daily basis. Access to Red Hat Knowledgebase is free. Red Hat Magazine offers a preview into the Red Hat Knowledgebase by highlighting some of the most recent entries. The information provided in this article is for your information only. The origin of this information may be internal or external to Red Hat. While Red Hat attempts to verify the validity of this information before it is posted, Red Hat makes no express or implied claims to its validity.

linux/redhat.1206215739.txt.gz · Last modified: 2009/05/25 00:34 (external edit)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready