博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
KVM虚拟机绑定物理CPU进行性能调优
阅读量:4230 次
发布时间:2019-05-26

本文共 760 字,大约阅读时间需要 2 分钟。

使用KVM虚拟化,当虚拟机的vcpu不是很多时,可以通过绑定物理cpu的方式提到虚拟机的性能。实验证明Host整体性能大约能提高5%,单台虚拟机性能最高提高10%。
实验数据(数据来自同事,Thanks Jack):
纵坐标表示虚拟机编译2.6.32内核花费的时间,可以看到绑定cpu后性能有一定提高。
PS:前提是虚拟cpu总个数不多于物理cpu总个数。
绑定方法:
虚拟机的虚拟cpu有1个,实体机物理cpu有8个,可以通过以下方式绑定cpu,绑定的动作不一定要在虚机启动时,可以在任何时候:
绑定前:
[root@ci13sjcmp03 ~]# virsh vcpuinfo 1
VCPU:           0                            <--------虚拟cup0
CPU:            1                            <--------物理cpu1
State:          running 
CPU time:       1.3s
CPU Affinity:   yyyyyyyy                     <-------虚拟cpu与物理cpu对应关系位图, 'y'表示虚拟cpu0能绑定到物理cpu1, '-'表示虚拟cpu0不能绑定到其他cpu
绑定命令:
[root@ci13sjcmp03 ~]# virsh  vcpupin 1  0 1  <-------将domain 1的cpu0绑定到物理cpu1
绑定后:
[root@ci13sjcmp03 ~]# virsh vcpuinfo 1
VCPU:           0                            <--------虚拟cup0
CPU:            1                            <--------物理cpu1
State:          running 
CPU time:       1.3s
CPU Affinity:   -y------                     <-------虚拟cpu与物理cpu对应关系位图, 'y'表示虚拟cpu0能绑定到物理cpu1, '-'表示虚拟cpu0不能绑定到其他cpu
你可能感兴趣的文章
Advances In Uml And Xml-based Software Evolution
查看>>
Successful Software Reengineering
查看>>
Wireless Network Hacks & Mods For Dummies
查看>>
Programming INDIGO
查看>>
System Analysis, Design, and Development: Concepts, Principles, and Practices
查看>>
How to Run Successful Projects in Web Time
查看>>
Sams Teach Yourself SQL Server(TM) 2005 Express in 24 Hours
查看>>
Beginning Apache Struts: From Novice to Professional
查看>>
Expert Spring MVC and Web Flow (Expert)
查看>>
A Developer's Guide to SQL Server 2005
查看>>
Active Directory Cookbook, 2nd Edition
查看>>
Designing and Developing Scalable IP Networks
查看>>
Bluetooth Demystified
查看>>
SWT (Developer's Notebook)
查看>>
Java 2: The Complete Reference, Fifth Edition
查看>>
Java Programming on Linux
查看>>
Microsoft Access VBA Programming for the Absolute Beginner, Second Edition
查看>>
Content Networking: Architecture, Protocols, and Practice
查看>>
Managing Agile Projects
查看>>
Creating a Digital Home Entertainment System with Windows Media Center
查看>>