首页 技术 正文
技术 2022年11月14日
0 收藏 809 点赞 2,702 浏览 1995 个字

ubuntu下kvm的磁盘io性能优化步骤

1、virsh shutdown wcltest2

2、virsh edit wcltest2

<driver name='qemu' type='qcow2'/>
<source file='/kvm-data/kvm/wcltest2_os_disk.qcow2'/>
<backingStore/>
<target dev='hda' bus='ide'/>
<alias name='ide0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>

 磁盘优化:

<driver name='qemu' type='qcow2' cache='none' io='native'/>
<target dev='vda' bus='virtio'/>
同时删除
<address type='drive' controller='0' bus='0' target='0' unit='0'/>

3、ubuntu下安装sysbench1.0

wget https://github.com/akopytov/sysbench/archive/1.0.zip -O "sysbench-1.0.zip"
unzip sysbench-1.0.zip
apt-get install automake -y
apt-get install libtool -y
./autogen.sh
./configure --without-mysql
备注( --without-mysql 不编译测试mysql的相关环境)
make
make install

4、io测试随机读写

sysbench --test=fileio --num-threads=50 --file-total-size=2G --file-test-mode=rndrw prepare  准备测试
sysbench --test=fileio --num-threads=50 --file-total-size=2G --file-test-mode=rndrw run 开始测试
sysbench --test=fileio --num-threads=50 --file-total-size=2G --file-test-mode=rndrw cleanup 清除测试文件

物理机执行结果:

File operations:
reads/s: 469.90
writes/s: 312.81
fsyncs/s: 1000.35Throughput:
read, MiB/s: 7.34
written, MiB/s: 4.89General statistics:
total time: 10.1041s
total number of events: 18024Latency (ms):
min: 0.00
avg: 27.86
max: 1047.11
95th percentile: 153.02
sum: 502103.21Threads fairness:
events (avg/stddev): 360.4800/49.51
execution time (avg/stddev): 10.0421/0.03

 kvm优化前执行结果:File operations:

    reads/s:                      243.34
writes/s: 162.23
fsyncs/s: 513.40Throughput:
read, MiB/s: 3.80
written, MiB/s: 2.53General statistics:
total time: 10.1048s
total number of events: 9290Latency (ms):
min: 0.00
avg: 54.13
max: 769.09
95th percentile: 297.92
sum: 502877.36Threads fairness:
events (avg/stddev): 185.8000/65.60
execution time (avg/stddev): 10.0575/0.02

 kvm优化后结果:

File operations:
reads/s: 438.57
writes/s: 289.51
fsyncs/s: 911.55Throughput:
read, MiB/s: 6.85
written, MiB/s: 4.52General statistics:
total time: 10.1056s
total number of events: 16577Latency (ms):
min: 0.01
avg: 30.30
max: 311.64
95th percentile: 123.28
sum: 502289.90Threads fairness:
events (avg/stddev): 331.5400/28.37
execution time (avg/stddev): 10.0458/0.02

 结论:

kvm优化的io随机读写性能达到接近物理机的磁盘io性能

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,120
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,592
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,437
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,208
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,844
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,929