概述
Linux工具使用——使用tuna进行性能调优
tuna工具(redhat系列里的工具)可以改变进程(线程)属性,包括调度策略、优先级和CPU核心亲和性,同时还可以修改中断的CPU核心亲和性。它既有图像界面,还可以在终端通过命令进行执行。此外,利用tuna指令时改变是及时生效的。
tuna -h显示信息如下
Usage: tuna [OPTIONS] -h, --help Give this help list -a, --config_file_apply=profilename Apply changes described in profile -l, --config_file_list List preloaded profiles -g, --gui Start the GUI -G, --cgroup Display the processes with the type of cgroups they are in -c, --cpus=CPU-LIST CPU-LIST affected by commands -C, --affect_children Operation will affect children threads -f, --filter Display filter the selected entities -i, --isolate Move all threads away from CPU-LIST -I, --include Allow all threads to run on CPU-LIST -K, --no_kthreads Operations will not affect kernel threads -m, --move Move selected entities to CPU-LIST -p, --priority=[POLICY:]RTPRIO Set thread scheduler tunables: POLICY and RTPRIO -P, --show_threads Show thread list -Q, --show_irqs Show IRQ list -q, --irqs=IRQ-LIST IRQ-LIST affected by commands -s, --save=FILENAME Save kthreads sched tunables to FILENAME -S, --sockets=CPU-SOCKET-LIST CPU-SOCKET-LIST affected by commands -t, --threads=THREAD-LIST THREAD-LIST affected by commands -U, --no_uthreads Operations will not affect user threads -v, --version Show version -W, --what_is Provides help about selected entities -x, --spread Spread selected entities over CPU-LIST |
1.显示操作
1)显示线程信息列表(这里的线程好像是进程啊!)
tuna -P 或 tuna --show_threads
2)显示中断信息列表
tuna -P 或 tuna --show_threads
3)显示指定线程id的信息(id之间用可逗号隔开)
tuna --threads=1,2 --show_threads 或 tuna –threads 1,2 --show_threads
4)显示指定中断号的信息(中断号之间用逗号隔开)
tuna --irqs=70,71 --show_irqs
5)显示指定CPU核心上的线程信息
tuna --cpus=0,1 --show_threads
tuna –cpus=0-5 --show_threads
6)显示指定CPU核心上的中断信息
tuna --cpus=0,1 --show_irqs
2.设置操作
1)将指定CPU核心上运行的所有任务(这里的任务指的是进程、线程和中断)从该核心上脱离,这些任务会转移到它们可用的另一个核心上去。
tuna --cpus=13 --isolate
2)允许线程在指定的CPU核心上运行
tuna --cpus=12,13 --include
3)将指定的线程(进程id或进程的名称)移动到指定的CPU核心上
tuna --cpus=0,1 --threads=ssh* --move
4)将指定的中断(id或者名称)响应移动到指定的CPU核心上
tuna --irqs=70,71 --cpus=12,13 --move
5)将名称以sfc1开头的中断响应移动到指定的CPU核心上
tuna --irqs=sfc1* --cpus=7,8 --move --spread
6)修改线程的调度策略和优先级
tuna --threads=7861 --priority=RR:40
关于线程的调度策略和优先级,详见Linux性能优化——进程调度策略和优先级
版权声明:本文为博主原创文章,转载请注明链接 https://blog.csdn.net/luroujuan/article/details/86562298
最后
以上就是美满电源为你收集整理的Linux工具使用——使用tuna进行性能调优Linux工具使用——使用tuna进行性能调优的全部内容,希望文章能够帮你解决Linux工具使用——使用tuna进行性能调优Linux工具使用——使用tuna进行性能调优所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复