CN104503821A - Method for calculating virtual disc IO (input/output) speed - Google Patents

Method for calculating virtual disc IO (input/output) speed Download PDF

Info

Publication number
CN104503821A
CN104503821A CN201410758099.1A CN201410758099A CN104503821A CN 104503821 A CN104503821 A CN 104503821A CN 201410758099 A CN201410758099 A CN 201410758099A CN 104503821 A CN104503821 A CN 104503821A
Authority
CN
China
Prior art keywords
sector
block device
data item
speed
read
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410758099.1A
Other languages
Chinese (zh)
Inventor
张雪梅
杨松
莫展鹏
季统凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
G Cloud Technology Co Ltd
Original Assignee
G Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by G Cloud Technology Co Ltd filed Critical G Cloud Technology Co Ltd
Priority to CN201410758099.1A priority Critical patent/CN104503821A/en
Publication of CN104503821A publication Critical patent/CN104503821A/en
Pending legal-status Critical Current

Links

Abstract

The invention relates to the technical field of cloud computing, in particular to a method for calculating a virtual disc IO (input/output) speed. According to the method, firstly, the mirror equipment number of a virtual disc is obtained from a host machine; then, a block equipment catalog in a host machine operating system is traversed, the equipment numbers of all block equipment are checked, and block equipment with the same mirror equipment number as the virtual disc is found out; then, the read sector accumulated time number data item r1 and the write sector accumulated time number data item w1 of the block equipment at the moment are obtained; then, after 1 second, the read sector accumulated time number data item r2 and the write sector time number data item w2 of the block equipment at the moment are obtained again; finally, the virtual disc read speed (r2-r1*512/1024) and the write speed (w2-w1)*512/1024 of the virtual disc are calculated according to the sector size of 512 bytes. The method solves the problem of virtual machine performance consumption due to the use of physical disc IO monitoring software for monitoring the virtual machine disc IO read and write speed and other problems, and can be used for calculating the virtual disc IO speed in the cloud computing environment.

Description

A kind of method calculating virtual disk IO speed
Technical field
The present invention relates to field of cloud computer technology, particularly a kind of method calculating virtual disk IO speed.
Background technology
In cloud computing environment, in host, the speed of physical disk only represents the general performance of all virtual disk IO, a disk monitored condition for independent virtual machine cannot be embodied, when causing all magnetic disk of virtual machine IO hydraulic performance declines in physical disk IO load too high, the mode that time-out physical disk IO read-write etc. can not be adopted to affect business continuance processes.Therefore, need to calculate the disk I/O speed of independent virtual machine.Not having the special software for virtual disk IO speed monitoring at present, is also use the software of physical disk IO monitoring to realize usually.Main implementation method is as follows:
1, in virtual machine, the IO Survey Software such as iostat are installed, obtain the instantaneous read or write speed of disk;
2, in virtual machine, oracle listener is installed, the value of timing acquisition read or write speed, and is sent to outside by the mode such as network, virtual serial port;
3, run a service routine in virtual machine outside, collect the data that in each virtual machine, oracle listener sends.
This implementation calculating virtual disk IO speed can bring following problem:
One is that versatility is not strong, and can cause loss to the performance of virtual machine.Need in virtual machine, install extra monitoring software, the adaptive different monitoring software of operating system needs that virtual machine is different, the operation of monitoring software can cause certain loss to the performance of virtual machine.
Two is that to obtain the real-time of virtual disk IO speed data not strong.Data need to be transmitted by network, virtual serial port etc., need to be collected by the poll of oracle listener simultaneously, the virtual disk IO speed data obtained are had certain delayed.
Three is take host resource, by realizing at the software of virtual machine outside operation service produces physical disk I/O monitoring, inherently taking host computational resource, storage resources, affecting host resource to virtual machine Optimized Supply.
In order to avoid because of monitor mode not general, monitoring virtual disk IO speed is to the loss of virtual machine self performance, the problems such as disk I/O speed data real-time is low, the consume of host resource, need the virtual disk IO speed calculation method that a kind of high real-time low-loss is general.
Summary of the invention
The technical matters that the present invention solves is the method for the calculating virtual disk IO speed providing a kind of high real-time low-loss general; Solve the limitation usually using physical disk IO monitoring software monitoring virtual disk IO speed; To the loss that virtual machine performance causes; Obtain virtual disk IO speed data real-time not strong; The challenges such as the host resource expended by outer monitoring program monitoring virtual disk IO speed.
The technical scheme that the present invention solves the problems of the technologies described above is:
Described method comprises the steps:
Step 1: the mirroring device number obtaining virtual disk in host;
Step 2: the block device catalogue in traversal host operating system, checks the device number of all block devices, finds and the mirroring device of virtual disk number identical block device;
Step 3: read the statistics file found in block device catalogue, therefrom obtains this block device at that time and reads sector cumulative number data item r1 and write sector cumulative number data item w1;
Step 4: be separated by for 1 second, reads the statistics file in block device catalogue again, obtains this block device at that time and reads sector cumulative number data item r2 and write sector cumulative number data item w2;
Step 5: according to the data got, calculate the read rate of this virtual disk according to sector-size 512 byte for (r2-r1) * 512/1024, writing rate is (w2-w1) * 512/1024.
Described block device catalogue refers to that the catalogue of block device file deposited specially by host, and each block device takies a sub-directory, has file to preserve the unique device number of equipment under sub-directory;
Statistics file in described block device catalogue refer to operating system record from os starting to the statistical information that this equipment current is accumulative, comprise read-write number of times, access time etc.;
This block device described is read sector cumulative number and writes sector cumulative number data item to refer to a data item in statistics file.
The present invention is that the calculating of virtual disk IO speed brings useful effect, and one is this process full automation, without the need to manual intervention; Two are methods of the present invention is a kind of general methods, does not need to install any monitoring software in VME operating system, can not cause any loss to the performance of virtual machine; Three is methods of the present invention is a kind of real-time methods, and because all calculating is all complete in virtual machine outside, do not need to carry out data conversion and transmission, all results all do not postpone; The inventive method, by reading the statistics file on host in block device catalogue, obtains block device and reads sector cumulative number data item and write sector cumulative number data item, do not take host computational resource.Virtual disk IO speed calculation method provided by the invention, the virtual disk IO speed in cloud computing environment that is applicable to calculates, and it provides more comprehensive simple and effective account form, automatically can adapt to main flow cloud operating system.
Accompanying drawing explanation
Below in conjunction with accompanying drawing, the present invention is further described:
Fig. 1 is the inventive method process flow diagram.
Embodiment
As shown in Figure 1, first by finding the mirroring device number of corresponding virtual disk on host, input command xenstore-ls such as, has following output, and virtual machine image device number is " fd:0 "
tapdisk-params=″tapdisk:vhd:/home/snapl″
physical-device=″fd:0″
Secondly the block device catalogue in traversal host operating system, check the device number of all block devices, find and the mirroring device of virtual disk number identical block device, check/sys/block/ under device number, such as tda's is that 253:0 follows fd:0 equal so the equipment of virtual machine image on host is tda, and main code is as follows:
#cat /sys/block/tda/dev
253:0
Then by performing script, read the statistics file in block device catalogue, therefrom obtain this block device at that time read sector cumulative number data item and write sector cumulative number data item, after program sleep 1s, obtain in the same way and read sector cumulative number data item, write sector cumulative number data item, virtual disk IO read rate is calculated by formula int (list1 [3]) * 512/1024-int (list [3]) * 512/1024, int (list1 [7]) * 512/1024-int (list [7]) * 512/1024 calculates virtual disk IO writing rate, code is as follows:
./monitor_io.py-d tda output read-write is as follows:
the write 0kB/s
the read 0KB/s
Sample script code is as follows:

Claims (2)

1. calculate a method for virtual disk IO speed, it is characterized in that:
Described method comprises the steps:
Step 1: the mirroring device number obtaining virtual disk in host;
Step 2: the block device catalogue in traversal host operating system, check the device number of all block devices, find and the mirroring device of virtual disk number identical block device:
Step 3: read and find statistics file in block device catalogue, therefrom obtains this block device at that time and reads sector cumulative number according to item r1 with write sector cumulative number data item w1;
Step 4: be separated by for 1 second, reads the statistics file in block device catalogue again, obtains this block device at that time and reads sector cumulative number data item r2 and write sector cumulative number data item w2;
Step 5: according to the data got, calculate the read rate of this virtual disk according to sector-size 512 byte for (r2-r1) * 512/1024, writing rate is (w2-w1) * 512/1024.
2. the method for described calculating virtual disk IO speed is required according to right 1, it is characterized in that: described block device catalogue refers to that the catalogue of block device file deposited specially by host, each block device takies a sub-directory, has file to preserve the unique device number of equipment under sub-directory;
Statistics file in described block device catalogue refer to operating system record from os starting to the statistical information that this equipment current is accumulative, comprise read-write number of times, access time etc.;
This block device described is read sector cumulative number and writes sector cumulative number data item to refer to a data item in statistics file.
CN201410758099.1A 2014-12-11 2014-12-11 Method for calculating virtual disc IO (input/output) speed Pending CN104503821A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410758099.1A CN104503821A (en) 2014-12-11 2014-12-11 Method for calculating virtual disc IO (input/output) speed

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410758099.1A CN104503821A (en) 2014-12-11 2014-12-11 Method for calculating virtual disc IO (input/output) speed

Publications (1)

Publication Number Publication Date
CN104503821A true CN104503821A (en) 2015-04-08

Family

ID=52945222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410758099.1A Pending CN104503821A (en) 2014-12-11 2014-12-11 Method for calculating virtual disc IO (input/output) speed

Country Status (1)

Country Link
CN (1) CN104503821A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105353985A (en) * 2015-11-03 2016-02-24 国云科技股份有限公司 Method for improving reading speed of virtual machine temporary file

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030131207A1 (en) * 2002-01-09 2003-07-10 Hiroshi Arakawa Virtualized volume snapshot formation method
CN102194010A (en) * 2011-06-16 2011-09-21 华中科技大学 Zero-copy defragmentation method for virtual file system fragments
CN102201049A (en) * 2010-03-25 2011-09-28 佳能株式会社 Information processing apparatus and data processing method thereof
CN103186349A (en) * 2011-12-27 2013-07-03 杭州信核数据科技有限公司 Block-level distributed storage system and data reading-writing method thereof
CN103473064A (en) * 2013-09-18 2013-12-25 国云科技股份有限公司 Method for monitoring use conditions of magnetic disk of virtual machine in host machine
CN103593226A (en) * 2013-11-04 2014-02-19 国云科技股份有限公司 Method for improving IO performance of disc of virtual machine
CN104009885A (en) * 2014-05-22 2014-08-27 北京大学 Virtual machine simultaneous-locating detection method based on hidden channel under cloud environment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030131207A1 (en) * 2002-01-09 2003-07-10 Hiroshi Arakawa Virtualized volume snapshot formation method
CN102201049A (en) * 2010-03-25 2011-09-28 佳能株式会社 Information processing apparatus and data processing method thereof
CN102194010A (en) * 2011-06-16 2011-09-21 华中科技大学 Zero-copy defragmentation method for virtual file system fragments
CN103186349A (en) * 2011-12-27 2013-07-03 杭州信核数据科技有限公司 Block-level distributed storage system and data reading-writing method thereof
CN103473064A (en) * 2013-09-18 2013-12-25 国云科技股份有限公司 Method for monitoring use conditions of magnetic disk of virtual machine in host machine
CN103593226A (en) * 2013-11-04 2014-02-19 国云科技股份有限公司 Method for improving IO performance of disc of virtual machine
CN104009885A (en) * 2014-05-22 2014-08-27 北京大学 Virtual machine simultaneous-locating detection method based on hidden channel under cloud environment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ZJGSU_LINUX: "Documentation/block/stat", 《HTTP://BLOG.CSDN.NET/U012036443/ARTICLE/DETAILS/12888777》 *
沈玉良等: "一种基于虚拟机的高效磁盘I/O特征分析方法", 《软件学报》 *
輕微&花花: "通过xenstore探索亚马逊EC2", 《HTTP://WWW.TUICOOL.COM/ARTICLES/RFIUJE》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105353985A (en) * 2015-11-03 2016-02-24 国云科技股份有限公司 Method for improving reading speed of virtual machine temporary file

Similar Documents

Publication Publication Date Title
US9594650B2 (en) Storage system and a method used by the storage system
US9569457B2 (en) Data processing method and apparatus for distributed systems
US9377964B2 (en) Systems and methods for improving snapshot performance
JP2016537703A (en) Improving backup system performance
CN104239166A (en) Method for realizing file backup for running virtual machine
US10540095B1 (en) Efficient garbage collection for stable data
CN102929769B (en) Virtual machine internal-data acquisition method based on agency service
US9342390B2 (en) Cluster management in a shared nothing cluster
EP3408734A1 (en) Placing workloads in a multi-array system
EP3414652A1 (en) Compressing data in dependence upon characteristics of a storage system
US11868625B2 (en) Alert tracking in storage
CN113364877B (en) Data processing method, device, electronic equipment and medium
US8515919B1 (en) Techniques for optimizing data migration
US10049023B1 (en) Optimizing application recovery in unmanaged clusters
US10235062B1 (en) Selection of computer resources to perform file operations in a power-efficient manner
CN103500108A (en) System memory access method, node processor and multi-processor system
US9753943B1 (en) Techniques for distributing access to filesystems through multipe filesystem management nodes
CN104503821A (en) Method for calculating virtual disc IO (input/output) speed
US10949102B2 (en) Leveraging snapshot for time series pattern analysis prediction
JP5692355B2 (en) Computer system, control system, control method and control program
US10162566B2 (en) Accumulating application-level statistics in a storage system
CN110532150B (en) Case management method and device, storage medium and processor
CN104317530A (en) Design of data capture method in remote disaster recovery technology
CN105631053B (en) Data integration and distribution method and data integration and distribution device for database
CN104050074A (en) Method and device for asynchronously recording log in system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150408

WD01 Invention patent application deemed withdrawn after publication