欢迎光临
我们一直在努力

实现Linux 进程绑定CPU 技术

快速绑定ceph osd 到CPU 核上

import os,sys,time
import commands
count=0
pids = commands.getoutput(""" ps -ef |grep ceph-osd|grep -v grep|awk '{print $2}' """)
for i in pids.split("\n"):
    count += 1
    os.system("taskset -cp %s %s" %(count,i))
    print "taskset -cp %s %s" %(count,i)
import os,sys,time
import commands
count=0
pids = commands.getoutput(""" ps -ef |grep ceph-osd|grep -v grep|awk '{print $2}' """)
for i in pids.split("\n"):
    count += 1
    os.system("taskset -cp %s %s" %(count,i))
    print "taskset -cp %s %s" %(count,i) import os,sys,time
import commands
count=0
pids = commands.getoutput(""" ps -ef |grep ceph-osd|grep -v grep|awk '{print $2}' """)
for i in pids.split("\n"):
    count += 1
    os.system("taskset -cp %s %s" %(count,i))
    print "taskset -cp %s %s" %(count,i) import os,sys,time
import commands
count=0
pids = commands.getoutput(""" ps -ef |grep ceph-osd|grep -v grep|awk '{print $2}' """)
for i in pids.split("\n"):
    count += 1
    os.system("taskset -cp %s %s" %(count,i))
    print "taskset -cp %s %s" %(count,i)

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。