https://access.redhat.com/articles/5467
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 <command>
# 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.
本文介绍如何使用taskset和chrt命令设置CPU亲和性和实时调度策略,以提高进程性能。通过实验不同的选项,可以确定是否达到预期的性能提升。具体效果取决于应用程序的工作负载和系统的整体负载。

被折叠的 条评论
为什么被折叠?



