设为首页 收藏本站
查看: 1052|回复: 0

[经验分享] Xen IO隔离方法及CPU调度脚本

[复制链接]

尚未签到

发表于 2015-4-13 13:09:16 | 显示全部楼层 |阅读模式
IO:


1. Virtual disk I/O management mechanism in Xen
http://lists.xensource.com/archives/html/xen-devel/2007-07/msg00863.html


2. Token-based-QoS-resource-limiting-for-VBD-I-O
http://markmail.org/thread/3hmn7fwfzd5b56oh#query:+page:1+mid:yql4s2c2dvnj6xiu+state:results


3. dm-ioband
http://sourceforge.net/apps/trac/ioband/wiki/dm-ioband/man/examples


4. ionice
for blkpid in $( pgrep blkback ); do
    # 2nd lowest (6) prio in best-effort class (2)
    ionice -c 2 -n 6 -p $blkpid
done








CPU:


#!/bin/sh


# cpucap
# wartungsfenster.de
# reschedule all running xen domUs to a medium-low cpu allocation


# scheduler notes:
    # if you wanna change this to support qos classes (i.e. if the customer can
    # chose a certain performance level, then look at the SEDF and credit2
    # schedulers, or just play around with the weight.
    # I recommend using the weight for now.
    # also I think a 2-core cap + very heavy weight for dom0 should be looked
    # at when you see any io scalability issues.

# hyperthreading notes:
    #we might see hyperthreads so we'll assume 2 cores have a
    #performance of 130 => and 1 core has 65!
    #this means we'll have to tweak xen vcpu allocation to ensure noone ever
    #runs on a HT only?
    # potential solution for figuring out
    # the best solution is using a extended cpu mask (url?) in the cpus= line
    # of the xen config. that, coupled with picking specific core types
    # (url: http://dag.wieers.com/blog/is-hyper-threading-enabled-on-a-linux-system), would work, but is extremely complex.
    #
    # I will focus on giving the users multiples of 1core+1ht and stick by the
    # 130 sum then...

get_vms()
{
    xm list | egrep -v 'Name|Domain-0' | awk '{print $1" "$2" "$4}'
}


set_perf()
{
   xm sched-credit -d domain-id -w weight =c cap
}

# xen4.1 / sched-credit2 testers needed:
# the below command is disabled for safety reasons, can crash dom0
# http://lists.xensource.com/archives/html/xen-devel/2011-03/msg01762.html
# i bet theres still no regression test for that.
# our first try, later we should give dom0 256 * cores * total_domUs
#
# or just pin it, if we got lotsa fast cores

default_weight=256
dom0_cores=$(grep -c ^proc /proc/cpuinfo)
dom0_weight=$(( $default_weight * $dom0_cores ))
#xm sched-credit2 -d 0 weight $dom0_weight
#we should employ capping for dom0 too, feel free to move to the main code.
#xm sched-credit2 -d 0 -c 400

echo "$(get_vms)" | while read name domid vcpus ; do
    xm sched-credit -d $domid -c $(( $vcpus * 65  ))
done

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-56686-1-1.html 上篇帖子: Centos5.5安装使用Xen 下篇帖子: 思杰VDI六在xen上创建虚拟模版
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表