CN106775942A - Solid-state disk cache management system and method that a kind of cloud application is oriented to - Google Patents
Solid-state disk cache management system and method that a kind of cloud application is oriented to Download PDFInfo
- Publication number
- CN106775942A CN106775942A CN201611127232.9A CN201611127232A CN106775942A CN 106775942 A CN106775942 A CN 106775942A CN 201611127232 A CN201611127232 A CN 201611127232A CN 106775942 A CN106775942 A CN 106775942A
- Authority
- CN
- China
- Prior art keywords
- module
- virtual machine
- decision
- cloud application
- making
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 230000005012 migration Effects 0.000 claims abstract description 22
- 238000013508 migration Methods 0.000 claims abstract description 22
- 238000012544 monitoring process Methods 0.000 claims description 80
- 238000004458 analytical method Methods 0.000 claims description 59
- 238000007726 management method Methods 0.000 claims description 30
- 230000003993 interaction Effects 0.000 claims description 19
- 230000004044 response Effects 0.000 claims description 11
- 230000035772 mutation Effects 0.000 claims description 9
- 230000008859 change Effects 0.000 claims description 6
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000005457 optimization Methods 0.000 claims description 4
- 230000002085 persistent effect Effects 0.000 claims description 4
- 230000005540 biological transmission Effects 0.000 claims description 3
- 230000006399 behavior Effects 0.000 claims 3
- 239000003795 chemical substances by application Substances 0.000 claims 3
- 239000011800 void material Substances 0.000 claims 2
- 241001269238 Data Species 0.000 claims 1
- 230000006978 adaptation Effects 0.000 claims 1
- 238000000465 moulding Methods 0.000 claims 1
- 230000008569 process Effects 0.000 abstract description 12
- 238000013507 mapping Methods 0.000 abstract 1
- 230000003044 adaptive effect Effects 0.000 description 18
- 239000007787 solid Substances 0.000 description 13
- 238000010276 construction Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 238000013468 resource allocation Methods 0.000 description 2
- 238000013403 standard screening design Methods 0.000 description 2
- 230000008901 benefit Effects 0.000 description 1
- 238000007596 consolidation process Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
本发明涉及一种云应用导向的固态盘缓存管理系统及方法,其核心思想是从云应用的视角切入,使用多层网络模型刻画虚拟机与固态盘之间的映射关系,并进一步确定每个虚拟机获得的最佳的固态盘缓存大小。当云应用的工作负载发生变化时,系统会自动触发调整过程,执行虚拟机动态迁移以及缓存容量更改,从而提升云应用的性能,提高固态盘的利用率。
The present invention relates to a cloud application-oriented solid-state disk cache management system and method. Its core idea is to cut in from the perspective of cloud applications, use a multi-layer network model to describe the mapping relationship between virtual machines and solid-state disks, and further determine each The optimal SSD cache size for the virtual machine. When the workload of cloud applications changes, the system will automatically trigger the adjustment process to perform virtual machine dynamic migration and cache capacity changes, thereby improving the performance of cloud applications and improving the utilization of solid-state disks.
Description
技术领域technical field
本发明涉及一种云应用导向的固态盘缓存管理系统及方法,尤其涉及一种基于多层网络的固态盘缓存分配和缓存导向的虚拟机动态迁移方法。属于软件技术领域。The present invention relates to a cloud application-oriented solid-state disk cache management system and method, in particular to a multi-layer network-based solid-state disk cache allocation and cache-oriented virtual machine dynamic migration method. It belongs to the field of software technology.
背景技术Background technique
虚拟化技术目前得到了广泛应用。借助虚拟化技术,一台物理服务器上可以聚合(Consolidation)多台虚拟机,从而有效提升硬件资源利用率。虚拟化服务器(Hypervisor)上通常部署基于磁介质的机械硬盘(Hard Disk Drive,HDD),或通过iSCSI等协议连接到后端的大容量共享存储,用作保存虚拟机镜像。在这一架构中,虚拟化服务器的IO性能直接影响了虚拟机本身的性能。Virtualization technology has been widely used at present. With the help of virtualization technology, multiple virtual machines can be aggregated (Consolidation) on one physical server, thereby effectively improving the utilization rate of hardware resources. A hard disk drive (HDD) based on magnetic media is usually deployed on a virtualization server (Hypervisor), or a large-capacity shared storage connected to the backend through a protocol such as iSCSI, and used to store virtual machine images. In this architecture, the IO performance of the virtualized server directly affects the performance of the virtual machine itself.
固态盘(Solid State Disk,SSD)作为一种快速的非易失性介质,通常部署在Hypervisor上,用作后端虚拟机镜像存储的读写缓存。虚拟机的IO请求会先经过缓存,若缓存命中,则缓存数据会立刻返回,不会进一步触发针对后端HDD或共享存储的相对速度较慢的读写操作,从而有效提升IO性能。一台Hypervisor上部署的固态盘缓存是由这台Hypervisor上承载的所有虚拟机共享的,因此,合理使用固态盘缓存资源至关重要。Solid State Disk (SSD), as a fast non-volatile medium, is usually deployed on the Hypervisor and used as a read-write cache for back-end virtual machine image storage. The IO request of the virtual machine will first go through the cache. If the cache hits, the cached data will be returned immediately, and will not further trigger relatively slow read and write operations for the back-end HDD or shared storage, thereby effectively improving IO performance. The SSD cache deployed on a Hypervisor is shared by all virtual machines hosted on the Hypervisor. Therefore, it is very important to use SSD cache resources reasonably.
云应用是虚拟化环境下的主要服务模式。一个典型云应用通常由多台虚拟机组成,这些虚拟机上部署了不同的组件,互相之间存在关联,并共同对外提供服务。虚拟化环境下一种典型的云应用场景是基于Web的事务型云应用。这一类云应用通常由前端负载均衡器、服务中间件以及后端数据库或持久化存储组成,通常提供了基于HTTP(S)协议的接口供用户通过浏览器访问,或开放了诸如RESTful风格的API供第三方开放平台应用接入。这类应用同样可以连接复杂的后端事务处理逻辑,如社交网络图谱、大数据分析等。对于这一类应用而言,平均响应时间是最关键的指标,直接影响到最终用户的体验,而优化响应时间需要从应用的角度通盘考虑,无法直接从应用集群中确定优化目标和手段。Cloud applications are the main service model in a virtualized environment. A typical cloud application usually consists of multiple virtual machines. Different components are deployed on these virtual machines, which are related to each other and jointly provide external services. A typical cloud application scenario in a virtualized environment is a web-based transactional cloud application. This type of cloud application usually consists of a front-end load balancer, service middleware, and a back-end database or persistent storage. It usually provides an interface based on the HTTP(S) protocol for users to access through a browser, or opens such as a RESTful style The API is for third-party open platform applications to access. Such applications can also be connected to complex back-end transaction processing logic, such as social network graphs, big data analysis, etc. For this type of application, the average response time is the most critical indicator, which directly affects the experience of end users. Optimizing the response time requires overall consideration from the perspective of the application, and it is impossible to directly determine the optimization goal and means from the application cluster.
另外,云应用本身的负载是动态变化的,用户对云应用的使用具备一定的模式,体现到虚拟机上可能表现为截然不同的IO负载表现,在进行固态盘缓存资源管理时,也需要具备自适应能力,可以感知到云应用的负载模式变化并触发固态盘资源的新一轮调整,以保证应用性能最优。In addition, the load of the cloud application itself changes dynamically. Users have a certain mode of using the cloud application, which may be reflected in the virtual machine. It may appear as a completely different IO load performance. When performing SSD cache resource management, it is also necessary to have Self-adaptive capability, which can sense changes in the load pattern of cloud applications and trigger a new round of adjustments to SSD resources to ensure optimal application performance.
然而,目前主流的固态盘缓存资源管理方法通常从虚拟机和缓存本身的角度考虑,主要解决固态盘缓存的资源分配问题,目标是尽可能合理地将固态盘缓存分配给所有虚拟机,并达到性能最优。这类工作关注的指标是缓存的Miss率以及相关导出指标,如从虚拟机中观察到的IO响应时间、IO带宽等。缓存Miss率作为缓存最关键的指标,直接反映了缓存的使用状况,也和最终使用缓存的客户端(即虚拟机)的平均IO响应时间密切相关,因此降低缓存Miss率是提高IO性能的一个直观有效的手段。但值得注意的是,单纯从底层IO指标切入忽略了上层工作负载对底层存储设备的性能影响,实际调整效果和理论模型计算结果存在一定的差距。However, the current mainstream SSD cache resource management methods are usually considered from the perspective of the virtual machine and the cache itself, and mainly solve the resource allocation problem of the SSD cache. The goal is to allocate the SSD cache to all virtual machines as reasonably as possible, and achieve Best performance. The indicators that this type of work focuses on are the cache miss rate and related export indicators, such as the IO response time and IO bandwidth observed from the virtual machine. As the most critical indicator of the cache, the cache miss rate directly reflects the usage status of the cache, and is also closely related to the average IO response time of the client (that is, the virtual machine) that finally uses the cache. Therefore, reducing the cache miss rate is a key to improving IO performance. Intuitive and effective means. However, it is worth noting that simply starting from the underlying IO indicators ignores the impact of upper-layer workloads on the performance of the underlying storage devices, and there is a certain gap between the actual adjustment effect and the calculation results of the theoretical model.
此外,这类缓存资源管理方法将虚拟机作为独立的单位看待,独立进行调整,没有考虑到从属于同一个云应用的虚拟机之间具有的天然关联,也没有从应用的视角评价应用整体平均响应时间。从属于同一个云应用的不同虚拟机可能具有不同的优先级和IO负载,并可能承担不同事务的处理。对不同的虚拟机进行缓存容量调整会对应用的平均响应时间造成不同的影响。这可能导致在进行固态盘缓存资源管理时尽管从各个独立的虚拟机角度看可以达到最优的Miss率、IO响应时间或IO带宽,但从应用视角看不能达到最优性能。In addition, this type of cache resource management method regards the virtual machine as an independent unit and adjusts it independently, without taking into account the natural correlation between virtual machines belonging to the same cloud application, and does not evaluate the overall average value of the application from the perspective of the application. Response time. Different virtual machines belonging to the same cloud application may have different priorities and IO loads, and may undertake different transaction processing. Adjusting the cache capacity of different virtual machines will have different effects on the average response time of the application. This may lead to the fact that although the optimal miss rate, IO response time, or IO bandwidth can be achieved from the perspective of each independent virtual machine during SSD cache resource management, the optimal performance cannot be achieved from the application perspective.
固态盘在作为缓存资源使用时,除了具有缓存的特性之外,同样也具有存储介质的特性,即它的服务能力,如带宽和每秒IO操作数(Input/Output Operations PerSecond,IOPS),是存在上限的。当多台虚拟机同时使用一个固态盘缓存,且虚拟机上都运行了高IO负载的应用时,可能导致对固态盘缓存的服务能力的需求超过其供给,从而产生资源争用,最终引起IO请求在固态盘一端排队,导致固态盘缓存的平均延迟远高于理想值,降低了缓存的效果。When a solid-state disk is used as a cache resource, in addition to the characteristics of a cache, it also has the characteristics of a storage medium, that is, its service capabilities, such as bandwidth and IO operations per second (Input/Output Operations PerSecond, IOPS), are There is an upper limit. When multiple virtual machines use a solid-state disk cache at the same time, and applications with high IO load are running on the virtual machines, the demand for the service capacity of the solid-state disk cache may exceed its supply, resulting in resource contention and eventually causing IO Requests are queued on the SSD side, causing the average latency of the SSD cache to be much higher than ideal, reducing the effectiveness of the cache.
因此,在进行缓存资源管理时,除了需要考虑固态盘缓存容量的分配,也需要从集群的角度考虑虚拟机的放置,以最大限度地利用固态盘的服务能力,并尽可能避免资源争用。需要结合云应用的特点,为应用内的虚拟机选择适当的Hypervisor,并进一步根据虚拟机对固态盘缓存的需求以及对应用性能的影响程度确定固态盘缓存在同一Hypervisor上承载的虚拟机上的具体分配。现有工作并没有很好地将虚拟机的放置与固态盘资源分配相结合。Therefore, when managing cache resources, in addition to the allocation of SSD cache capacity, it is also necessary to consider the placement of virtual machines from the perspective of the cluster to maximize the use of SSD service capabilities and avoid resource contention as much as possible. It is necessary to combine the characteristics of cloud applications to select an appropriate Hypervisor for the virtual machine in the application, and further determine the SSD cache on the virtual machine hosted on the same Hypervisor based on the virtual machine's demand for SSD cache and the degree of impact on application performance. Specific allocation. Existing work does not well combine virtual machine placement with SSD resource allocation.
目前尚未有相关文献报导。There is no relevant literature report yet.
发明内容Contents of the invention
本发明的目的在于:针对现有技术的不足,提出一种云应用导向的固态盘缓存管理方法及系统,本发明当云应用的工作负载发生变化时,会自动触发调整过程,执行虚拟机动态迁移以及缓存容量更改,从而提升了云应用的性能,提高了固态盘的利用率。The purpose of the present invention is to propose a cloud application-oriented solid-state disk cache management method and system for the deficiencies of the prior art. When the workload of the cloud application changes, the present invention will automatically trigger the adjustment process and perform virtual machine dynamic Migration and cache capacity changes, thereby improving the performance of cloud applications and improving the utilization of SSDs.
本发明技术解决方案:一种云应用导向的固态盘缓存管理方法和系统,如图1所示,主要由控制模块、监测模块、分析模块和决策模块组成。各模块的主要职责、交互模式和实现如下:The technical solution of the present invention: a cloud application-oriented solid-state disk cache management method and system, as shown in Figure 1, mainly consists of a control module, a monitoring module, an analysis module and a decision-making module. The main responsibilities, interaction modes and implementation of each module are as follows:
控制模块:用于协调监测模块、分析模块、决策模块和执行模块的工作,与各模块进行交互并收集结果,基于自适应闭环实现固态盘缓存管理。在一个完整的闭环执行过程中,控制模块首先与监测模块进行交互,依赖监测模块持续监测云应用的工作负载以及虚拟机间的依赖关系,并收集云应用状态和性能数据供后续分析使用;之后与分析模块进行交互,将云应用状态和性能数据传递给分析模块,并收集生成的多层网络模型的相关信息;之后与决策模块进行交互,传入多层网络模型并依赖决策模块完成固态盘缓存管理决策,如虚拟机放置方案的计算以及进一步的Hypervisor上缓存分配方案的计算;最后与执行模块进行交互,传递具体的固态盘缓存管理决策,由执行模块完成具体的虚拟机的在线迁移以及缓存容量的动态调整。控制模块还负责在检测到云应用工作负载发生突变时触发新一轮的闭环执行;Control module: used to coordinate the work of the monitoring module, analysis module, decision-making module and execution module, interact with each module and collect results, and realize SSD cache management based on adaptive closed-loop. In a complete closed-loop execution process, the control module first interacts with the monitoring module, and the dependency monitoring module continuously monitors the workload of cloud applications and the dependencies between virtual machines, and collects cloud application status and performance data for subsequent analysis; Interact with the analysis module, pass cloud application status and performance data to the analysis module, and collect relevant information about the generated multi-layer network model; then interact with the decision-making module, pass in the multi-layer network model and rely on the decision-making module to complete the solid-state disk Cache management decisions, such as the calculation of the virtual machine placement plan and the further calculation of the cache allocation plan on the Hypervisor; finally interact with the execution module to pass the specific SSD cache management decision, and the execution module completes the online migration of the specific virtual machine and Dynamic adjustment of cache capacity. The control module is also responsible for triggering a new round of closed-loop execution when a sudden change in the cloud application workload is detected;
监测模块:包括部署在Hypervisor上的监测模块和部署在虚拟机上的监测模块;部署在Hypervisor上的监测模块负责监测Hypervisor、固态盘以及缓存的相关信息,相关信息包括Hypervisor的空闲CPU和内存资源;固态盘的最大带宽和IOPS、当前使用的带宽和IOPS;缓存的使用率、读写次数和命中率;部署在虚拟机上的监测模块负责监测虚拟机上部署的云应用组件的相关信息和虚拟机的IO性能,云应用组件的相关信息包括云应用在应对当前工作负载时各事务所占比例及在各组件上的执行时间,组件间的网络交互和依赖关系;虚拟机的IO性能包括已使用的带宽和IOPS,以及由此计算得到的虚拟机的IO负载状况,即已使用的IO资源占可用资源的比例;监测模块会持续监测这些信息,并在闭环执行过程中接收控制模块的请求,返回相应的云应用状态及性能数据供后续分析、决策使用;控制模块在自适应闭环的执行过程中,会首先与监测模块进行交互,以获取必要信息供后续分析模块、决策模块和执行模块使用;Monitoring module: including the monitoring module deployed on the Hypervisor and the monitoring module deployed on the virtual machine; the monitoring module deployed on the Hypervisor is responsible for monitoring the relevant information of the Hypervisor, SSD and cache, and the relevant information includes the idle CPU and memory resources of the Hypervisor ; The maximum bandwidth and IOPS of the SSD, the currently used bandwidth and IOPS; the usage rate of the cache, the number of reads and writes, and the hit rate; the monitoring module deployed on the virtual machine is responsible for monitoring the relevant information and information of the cloud application components deployed on the virtual machine The IO performance of the virtual machine, the relevant information of cloud application components include the proportion of each transaction in the cloud application when dealing with the current workload and the execution time on each component, the network interaction and dependencies between components; the IO performance of the virtual machine includes The used bandwidth and IOPS, as well as the calculated IO load status of the virtual machine, that is, the ratio of the used IO resources to the available resources; the monitoring module will continuously monitor these information, and receive the control module's information during the closed-loop execution process Request, return the corresponding cloud application status and performance data for subsequent analysis and decision-making; during the execution of the adaptive closed-loop, the control module will first interact with the monitoring module to obtain necessary information for the subsequent analysis module, decision-making module and execution module usage;
分析模块:用于接收监测模块传递的信息,并构建多层网络模型;多层网络模型包括资源需求端和资源供给端,以及用于匹配的多个决策层;通过分析部署在虚拟机中监测模块传回的云应用组件的网络交互情况和虚拟机IO性能,构建出虚拟机之间的依赖关系图,并进一步遍历出集群中所有虚拟机的依赖关系的所有强连通分量,从而刻画云应用的边界;再结合依赖关系图和虚拟机的IO负载状况构建出虚拟机对固态盘缓存的需求,完成资源需求端的构建;之后,分析模块会组装需要调用的决策模块并适配后端的资源供给端,完成多层网络模型的构建;控制模块在自适应闭环的执行过程中,会将从监测模块处收集得到的云应用的相关信息和虚拟机IO性能信息传递给分析模块,并接收分析模块计算得到的多层网络模型的拓扑结构和其中选取的决策层,供后续与决策模块交互时使用;Analysis module: used to receive the information transmitted by the monitoring module and build a multi-layer network model; the multi-layer network model includes resource demand end and resource supply end, as well as multiple decision-making layers for matching; through analysis deployment in virtual machine monitoring The network interaction of cloud application components and virtual machine IO performance returned by the module builds a dependency graph between virtual machines, and further traverses all strongly connected components of the dependencies of all virtual machines in the cluster to describe cloud applications The boundary of the virtual machine; combined with the dependency graph and the IO load status of the virtual machine, the virtual machine's demand for the SSD cache is constructed, and the construction of the resource demand side is completed; after that, the analysis module will assemble the decision-making module that needs to be called and adapt to the resource supply of the backend end, to complete the construction of a multi-layer network model; during the execution of the self-adaptive closed-loop, the control module will pass the relevant information of the cloud application and the IO performance information of the virtual machine collected from the monitoring module to the analysis module, and receive the analysis module The calculated topological structure of the multi-layer network model and the selected decision-making layer are used for subsequent interaction with the decision-making module;
决策模块:用于匹配多层网络模型中的供给端和需求端,实现资源供给和需求的最优化匹配;决策模块基于特定算法以实现资源管理的目标,表现为多层网络中的决策层;目前包含两个默认的决策层,第一决策层采用二分图匹配算法计算虚拟机的放置方案;第二决策层采用网络流中的最小花费最大流算法计算每一个Hypervisor上虚拟机的应被分配的最优缓存大小;实施时可以根据需求不同扩展出更多决策层;在比实行控制模块在接收到分析模块传回的多层网络模型之后,会调用其中指定的决策层,以完成相应的资源管理方案的计算,在调用完模型中选取的所有决策层之后即完成了资源需求端和资源供给端的匹配,并生成了最终的资源管理方案,包括虚拟机的放置方案和缓存分配方案;Decision-making module: used to match the supply side and demand side in the multi-layer network model to achieve the optimal matching of resource supply and demand; the decision-making module is based on a specific algorithm to achieve the goal of resource management, which is represented as the decision-making layer in the multi-layer network; At present, there are two default decision-making layers. The first decision-making layer uses the bipartite graph matching algorithm to calculate the placement plan of the virtual machine; the second decision-making layer uses the minimum cost maximum flow algorithm in the network flow to calculate the allocation of virtual machines on each hypervisor. The optimal cache size; during implementation, more decision-making layers can be expanded according to different requirements; after the implementation control module receives the multi-layer network model returned by the analysis module, it will call the specified decision-making layer to complete the corresponding The calculation of the resource management plan completes the matching of the resource demand end and the resource supply end after invoking all the decision-making layers selected in the model, and generates the final resource management plan, including the placement plan of the virtual machine and the cache allocation plan;
执行模块:部署在Hypervisor上;执行模块接受决策模块计算得到的虚拟机放置方案和每个Hypervisor上的虚拟机的固态盘缓存大小,执行具体的虚拟机的动态迁移和缓存容量调整操作;控制模块在自适应闭环的执行过程中,会最后与执行模块进行交互,传入由决策模块生成的资源管理方案,将其应用到虚拟机上;此外,当控制模块触发了新一轮自适应闭环执行时,执行模块也会计算最少步骤的虚拟机动态迁移方案以及对虚拟机上工作负载影响最小的缓存容量调整方案,并进行调整;最终完成云应用导向的固态盘缓存管理。Execution module: deployed on the Hypervisor; the execution module accepts the virtual machine placement plan calculated by the decision-making module and the SSD cache size of the virtual machine on each Hypervisor, and performs specific virtual machine dynamic migration and cache capacity adjustment operations; the control module In the execution process of the adaptive closed-loop, it will interact with the execution module at the end, pass in the resource management plan generated by the decision-making module, and apply it to the virtual machine; in addition, when the control module triggers a new round of adaptive closed-loop execution At the same time, the execution module will also calculate the virtual machine dynamic migration plan with the least steps and the cache capacity adjustment plan that has the least impact on the workload on the virtual machine, and make adjustments; finally complete the cloud application-oriented SSD cache management.
所述控制模块的具体实现如下:The concrete realization of described control module is as follows:
(1)构建自适应闭环机制:自适应闭环包括监测、分析、决策和执行四个步骤组成,四个主要步骤分别由监测模块、分析模块、决策模块和执行模块具体完成。自适应闭环是云应用导向的固态盘缓存管理方法的核心控制流程。(1) Build an adaptive closed-loop mechanism: the adaptive closed-loop consists of four steps: monitoring, analysis, decision-making, and execution. The four main steps are completed by the monitoring module, analysis module, decision-making module, and execution module. Adaptive closed-loop is the core control process of the cloud application-oriented SSD cache management method.
(2)在此基础上,构建通信协议,规定控制模块与监测模块、分析模块、决策模块和执行模块之间的信息传递格式和交互方式;(2) On this basis, build a communication protocol to specify the information transmission format and interaction mode between the control module and the monitoring module, analysis module, decision-making module and execution module;
(3)基于通信协议实现与监测模块、分析模块、决策模块和执行模块的交互,完成自适应闭环的执行;(3) Realize the interaction with the monitoring module, analysis module, decision-making module and execution module based on the communication protocol, and complete the execution of the adaptive closed-loop;
3.1调用监控模块持续监测云应用信息和虚拟机、Hypervisor的性能信息;3.1 Call the monitoring module to continuously monitor cloud application information and performance information of virtual machines and Hypervisors;
3.2调用分析模块,传入云应用信息和性能信息,构建由资源需求端、资源供给端和多个决策层构成的多层网络模型;3.2 Call the analysis module, import cloud application information and performance information, and build a multi-layer network model consisting of resource demand end, resource supply end and multiple decision-making layers;
3.3根据构建出的多层网络模型中选择的决策层,调用具体的决策模块完成资源供需匹配,产生资源管理决策(包括缓存分配和虚拟机迁移);3.3 According to the decision-making layer selected in the constructed multi-layer network model, call the specific decision-making module to complete resource supply and demand matching, and generate resource management decisions (including cache allocation and virtual machine migration);
3.4遵照决策模块产生的缓存分配和虚拟机迁移决策,调用执行模块完成具体的缓存分配操作和虚拟机迁移操作;3.4 According to the cache allocation and virtual machine migration decision generated by the decision-making module, call the execution module to complete the specific cache allocation operation and virtual machine migration operation;
(4)构建自适应闭环的持续触发机制,在监测到云应用负载发生突变(云应用的访问模式改变,依赖关系改变,承载云应用的虚拟机拓扑发生改变)时触发新一轮的自适应闭环执行;(4) Build an adaptive closed-loop continuous triggering mechanism to trigger a new round of self-adaptation when a sudden change in cloud application load is detected (changes in the access mode of cloud applications, changes in dependencies, changes in the topology of virtual machines carrying cloud applications) Closed-loop execution;
所述监测模块的具体实现如下:The specific implementation of the monitoring module is as follows:
(1)在目标云应用中进行程序插装,从而获得细粒度的性能信息;(1) Perform program instrumentation in the target cloud application to obtain fine-grained performance information;
1.1对于不同类型的云应用,选取需要进行程序插装的云应用功能模块;1.1 For different types of cloud applications, select the cloud application function modules that need to be program-inserted;
1.2对虚拟机上部署的这些云应用功能模块进行程序插装,写入监测代码。主要插装点是网络交互操作(如HTTP(S)、TCP、UDP连接等)以及持久化操作(如数据库操作等);1.2 Perform program instrumentation on these cloud application function modules deployed on the virtual machine, and write monitoring code. The main insertion points are network interactive operations (such as HTTP(S), TCP, UDP connections, etc.) and persistent operations (such as database operations, etc.);
1.3监测代码通过输出日志的方式传递消息;1.3 The monitoring code transmits messages by outputting logs;
(2)在程序插装的基础上,收集监测代码输出的日志,计算获得云应用在处理用户请求时在各模块上的执行时间以及组成云应用的各模块之间的网络交互和依赖关系;(2) On the basis of program instrumentation, collect and monitor code output logs, calculate and obtain the execution time of each module of the cloud application when processing user requests, and the network interaction and dependency relationship between the various modules that make up the cloud application;
(3)在虚拟机和Hypervisor上部署代理(Agent)模块;(3) deploy agent (Agent) module on virtual machine and Hypervisor;
3.1部署在虚拟机上的代理模块用于监测虚拟机的IO性能信息,包括带宽和IOPS;3.1 The agent module deployed on the virtual machine is used to monitor the IO performance information of the virtual machine, including bandwidth and IOPS;
3.2部署在Hypervisor上的代理模块用于监测缓存相关信息,包括缓存用量和读写命中率。3.2 The proxy module deployed on the Hypervisor is used to monitor cache related information, including cache usage and read/write hit rate.
(4)监测模块与代理模块进行交互,收集相关性能数据;(4) The monitoring module interacts with the agent module to collect relevant performance data;
(5)整理监测代码和代理模块输出的云应用各模块的执行时间、网络交互和依赖关系,以及虚拟机和Hypervisor的性能信息,作为监测模块的输出。(5) Organize the execution time, network interaction and dependencies of each module of the cloud application output by the monitoring code and the agent module, as well as the performance information of the virtual machine and the Hypervisor, as the output of the monitoring module.
所述分析模块的具体实现如下:The specific implementation of the analysis module is as follows:
(1)接受控制模块传入的信息,生成资源需求端:(1) Accept the information passed in by the control module, and generate the resource demand end:
1.1由控制模块传入云应用的拓扑、应用组件之间的关联以及依赖信息;1.1 The topology of the cloud application, the association between application components and the dependency information are transmitted by the control module;
1.2由控制模块传入虚拟机的IO负载信息;1.2 The IO load information transmitted to the virtual machine by the control module;
1.3通过计算云应用各组件的网络交互,构建出虚拟机之间的依赖关系图,并进一步找出其中的强连通分量,以刻画出云应用的边界;1.3 By calculating the network interaction of each component of the cloud application, build a dependency graph between virtual machines, and further find out the strongly connected components in it to describe the boundary of the cloud application;
1.4通过计算云应用各组件间的网络和IO负载,刻画云应用各组件间的IO依赖程度;1.4 By calculating the network and IO load between the components of the cloud application, describe the IO dependency between the components of the cloud application;
1.5由云应用各组件的IO负载和对其他组件的IO依赖程度,刻画出云应用对固态盘缓存的需求;1.5 From the IO load of each component of the cloud application and the IO dependence on other components, describe the demand of the cloud application for the SSD cache;
(2)接受控制模块传入的信息,生成资源供给端:(2) Accept the incoming information from the control module and generate the resource supply end:
2.1接受控制模块传入的Hypervisor的资源信息,主要包括CPU的性能、内存容量和网络带宽2.1 Accept the Hypervisor resource information from the control module, mainly including CPU performance, memory capacity and network bandwidth
2.2接受控制模块传入的固态盘的资源信息,包括固态盘的容量、带宽和IOPS2.2 Accept the resource information of the solid state disk from the control module, including the capacity, bandwidth and IOPS of the solid state disk
2.3以一个统一评分量化CPU、内存、网络和固态盘的资源,构建资源供给端;2.3 Quantify the resources of CPU, memory, network and solid-state disk with a unified score, and build a resource supply end;
(3)根据资源需求端和资源供给端的匹配需求,确定需要使用的决策模块,构建多层决策层;(3) Determine the decision-making modules to be used according to the matching requirements of the resource demand side and the resource supply side, and build a multi-layer decision-making layer;
(4)将资源供给端、资源需求端和多层决策层组合成多层网络模型,供决策模块使用;(4) Combining the resource supply end, resource demand end and multi-layer decision-making layer into a multi-layer network model for use by the decision-making module;
所述决策模块的具体实现如下:The concrete realization of described decision-making module is as follows:
(1)由控制模块传入量化后的资源供给端和资源需求端;(1) The quantified resource supply end and resource demand end are passed in from the control module;
(2)由控制模块传入需要组合的决策层的信息;(2) The information of the decision-making layer that needs to be combined is passed in by the control module;
(3)调用具体决策层完成资源供给端和资源需求端的匹配,并生成调整方案,主要包括虚拟机缓存容量分配方案和虚拟机放置方案;(3) Call the specific decision-making layer to complete the matching of the resource supply end and the resource demand end, and generate an adjustment plan, mainly including the virtual machine cache capacity allocation plan and the virtual machine placement plan;
(4)将调整方案发回控制模块,供执行模块使用;(4) Send the adjustment plan back to the control module for use by the execution module;
所述执行模块的具体实现如下:The specific implementation of the execution module is as follows:
(1)由控制模块传入固态盘缓存分配方案和虚拟机放置方案;(1) The solid state disk cache allocation scheme and the virtual machine placement scheme are imported by the control module;
(2)安全移除现有虚拟机缓存;(2) Safely remove the existing virtual machine cache;
(3)从当前集群的虚拟机放置出发,计算虚拟机迁移操作集合;(3) Starting from the virtual machine placement of the current cluster, calculate the virtual machine migration operation set;
(4)依照尽可能降低服务质量违约的原则,进行虚拟机迁移;(4) Perform virtual machine migration in accordance with the principle of minimizing service quality violations;
(5)在目标虚拟机上按照固态盘缓存分配方案重新配置缓存;(5) Reconfigure the cache according to the solid state disk cache allocation scheme on the target virtual machine;
一种云应用导向的固态盘缓存管理方法,实现步骤如下:A cloud application-oriented solid state disk cache management method, the implementation steps are as follows:
(1)在目标应用中进行程序插装(Instrumentation),从而支持监测模块对云应用进行细粒度的监测;针对具体的应用类型和虚拟机上承载的云应用模块,对HTTP(S)访问操作以及数据库和持久化存储的访问操作进行插装,插装代码会通过输出日志的方式给出操作的执行时间和访问目标。(1) Perform program instrumentation (Instrumentation) in the target application, so as to support the monitoring module to carry out fine-grained monitoring of cloud applications; for specific application types and cloud application modules carried on virtual machines, HTTP(S) access operations As well as the access operations of the database and persistent storage, the instrumentation code will output the execution time and access target of the operation in the form of logs.
(2)控制模块开始一次完整的自适应闭环执行。控制模块首先与监测模块进行交互,监测模块在获得第(1)步插装代码输出的日志基础上,分析得到云应用在应对用户请求时在各个模块上的执行时间以及具体的网络交互流程和网络访问目标,并返回给控制模块。(2) The control module starts a complete adaptive closed-loop execution. The control module first interacts with the monitoring module. Based on the logs output by the instrumentation code in step (1), the monitoring module analyzes and obtains the execution time of the cloud application on each module when responding to user requests, as well as the specific network interaction process and The network accesses the target and returns to the control module.
控制模块与监测模块进行交互,监测模块调用部署在Hypervisor和虚拟机上的代理(Agent)模块,进行性能监测。部署在虚拟机上的Agent模块会监测磁盘IO操作的执行时间,平均响应时间和带宽,以及IO负载。部署在Hypervisor上的Agent模块会监测各虚拟机对应的缓存使用状况、固态盘状况和CPU、内存、网络资源使用状况。缓存使用状况包括缓存命中率、使用率、读写操作次数等。固态盘状况包括的带宽、IOPS和平均响应时间。CPU、内存、网络资源使用状况包括当前已用和空闲的CPU时间、已用和空闲的内存容量,以及已用和空闲的网络带宽。这些性能数据最终返回给控制模块。The control module interacts with the monitoring module, and the monitoring module calls the agent (Agent) module deployed on the Hypervisor and the virtual machine to perform performance monitoring. The Agent module deployed on the virtual machine will monitor the execution time of the disk IO operation, the average response time and bandwidth, and the IO load. The Agent module deployed on the Hypervisor will monitor the cache usage status, solid state disk status, and CPU, memory, and network resource usage status corresponding to each virtual machine. Cache usage status includes cache hit rate, usage rate, read and write operations, etc. SSD status includes bandwidth, IOPS, and average response time. The CPU, memory, and network resource usage status includes the currently used and idle CPU time, used and idle memory capacity, and used and idle network bandwidth. These performance data are finally returned to the control module.
(3)在获得第(2)、(3)步由监测模块返回的云应用信息和性能信息之后,控制模块将这些信息传递给分析模块。分析模块会执行多层网络模型的构建。(3) After obtaining the cloud application information and performance information returned by the monitoring module in steps (2) and (3), the control module transmits these information to the analysis module. The analysis module performs the construction of a multi-layer network model.
首先是构建资源需求端。分析模块得到性能信息之后,结合云应用中虚拟机对其他虚拟机的IO依赖关系、对应虚拟机的IO负载和随机访问频率计算得到虚拟机对固态盘缓存的需求。分析模块得到云应用信息之后,将构成云应用的虚拟机之间的依赖关系和网络交互转化为虚拟机的依赖图。依赖图中的节点代表了构成云应用的独立模块,节点与虚拟机一一对应。有向边上的权重代表之前计算得到的虚拟机对固态盘缓存的需求。云应用在执行特定工作负载时的状况可映射为依赖关系图的子图。The first is to build the resource demand side. After the analysis module obtains the performance information, it combines the IO dependence of the virtual machine on other virtual machines in the cloud application, the IO load of the corresponding virtual machine, and the random access frequency to calculate the demand for the SSD cache of the virtual machine. After the analysis module obtains the cloud application information, it converts the dependency relationship and network interaction between the virtual machines constituting the cloud application into a dependency graph of the virtual machine. Nodes in the dependency graph represent independent modules that constitute cloud applications, and nodes correspond to virtual machines one-to-one. The weight on the directed edge represents the previously calculated demand of the virtual machine for the SSD cache. The state of a cloud application while executing a specific workload can be mapped as a subgraph of the dependency graph.
其次是构建资源供给端。分析模块得到性能信息之后,将Hypervisor的CPU、内存和网络和固态盘资源进行量化,构建统一的资源供给模型。CPU资源以CPU时间为指标进行量化,内存资源以容量为指标进行量化,网络资源以带宽为指标进行量化,固态盘资源以IOPS和容量为指标进行量化。The second is to build a resource supply side. After the analysis module obtains the performance information, it quantifies the CPU, memory, network and SSD resources of the Hypervisor to build a unified resource supply model. CPU resources are quantified by CPU time, memory resources are quantified by capacity, network resources are quantified by bandwidth, and SSD resources are quantified by IOPS and capacity.
最后,分析模块根据云应用的当前工作负载状况,确定调整所需的决策模块,并确定决策模块的应用顺序,构建为多层决策层。Finally, the analysis module determines the decision-making modules required for adjustment according to the current workload status of the cloud application, and determines the application sequence of the decision-making modules, which is constructed as a multi-layer decision-making layer.
分析模块将构建完成的由资源供给端、资源需求端和多层决策层组成的多层网络模型返回给控制模块。The analysis module returns the completed multi-layer network model composed of resource supply end, resource demand end and multi-layer decision-making layer to the control module.
(4)控制模块根据多层网络模型中的决策层顺序调用相应的决策模块,将整个多层网络模型传递给决策模块,由决策模块根据不同策略实现资源供需的匹配,最后导出固态盘资源的调整方案,包括对虚拟机的固态盘缓存容量进行调整,以及对虚拟机的放置进行调整。决策模块将调整方案发回给控制模块。(4) The control module calls the corresponding decision-making module according to the order of the decision-making layers in the multi-layer network model, and passes the entire multi-layer network model to the decision-making module. The adjustment plan includes adjusting the cache capacity of the solid state disk of the virtual machine and adjusting the placement of the virtual machine. The decision module sends the adjustment plan back to the control module.
在进行虚拟机放置方案的决策时,决策模块将其转化为特定约束条件下的二分图匹配,即在满足供给端的最大服务能力(CPU、内存、网络和固态盘资源)的前提下均衡分布所有虚拟机。决策模块使用二分图匹配算法实现资源的供需匹配。When making a decision on the virtual machine placement plan, the decision-making module converts it into a bipartite graph matching under specific constraints, that is, under the premise of satisfying the maximum service capacity (CPU, memory, network and SSD resources) of the supply side, all virtual machine. The decision-making module uses a bipartite graph matching algorithm to match the supply and demand of resources.
在进行虚拟机的固态盘缓存分配决策时,决策模块将其转化为子图上的最小花费最优(最大)流问题,即在满足固态盘缓存容量限制的条件下优先将固态盘缓存分配给高性价比的虚拟机。决策模块根据传入的云应用的相关信息分析当前工作负载模式下不同虚拟机的价值,将其映射到虚拟机依赖图上的流量,从而使用最小花费最大流算法确定每台虚拟机应当获得的固态盘缓存比例,完成固态盘缓存分配决策。When making the SSD cache allocation decision of the virtual machine, the decision-making module converts it into the minimum cost optimal (maximum) flow problem on the subgraph, that is, the SSD cache is preferentially allocated to Cost-effective virtual machines. The decision-making module analyzes the value of different virtual machines under the current workload mode according to the relevant information of the incoming cloud application, maps it to the flow on the virtual machine dependency graph, and uses the minimum cost maximum flow algorithm to determine the value that each virtual machine should obtain SSD cache ratio, to complete the SSD cache allocation decision.
(5)控制模块得到调整方案后,将其传递给执行模块,并调用执行模块完成具体调整方案的执行。执行模块首先安全移除当前的虚拟机所使用的固态盘缓存,然后根据当前的虚拟机放置方案和传入的目标放置方案计算优化的虚拟机动态迁移顺序,接着遵循尽可能降低服务质量违约的原则执行虚拟机动态迁移,最后在目标虚拟机上按照传入的缓存分配方案进行缓存分配。(5) After the control module obtains the adjustment plan, it transmits it to the execution module, and calls the execution module to complete the execution of the specific adjustment plan. The execution module first safely removes the SSD cache used by the current virtual machine, then calculates the optimized live migration sequence of virtual machines according to the current virtual machine placement scheme and the incoming target placement scheme, and then follows the principle of minimizing service quality violations The principle is to perform virtual machine dynamic migration, and finally perform cache allocation on the target virtual machine according to the incoming cache allocation scheme.
(6)步骤(2)~(5)构成了一次完整的自适应闭环执行。控制模块持续调用监测模块,在监测到云应用工作负载发生突变时按照步骤(2)~(5)的顺序触发新一轮的自适应闭环执行。云应用工作负载突变主要表现为工作负载的组成模式(各请求所占比例)发生突变,以及工作负载的强度(各节点上的IO操作强度)发生突变。(6) Steps (2)-(5) constitute a complete adaptive closed-loop execution. The control module continuously invokes the monitoring module, and triggers a new round of adaptive closed-loop execution in the order of steps (2) to (5) when a sudden change in the workload of the cloud application is detected. The mutation of cloud application workload mainly manifests as mutation of workload composition mode (proportion of each request) and workload intensity (IO operation intensity on each node).
此外,控制模块设定了阈值,以定期触发自适应闭环调整,即步骤(2)~(6)的执行。In addition, the control module sets a threshold to periodically trigger the adaptive closed-loop adjustment, that is, the execution of steps (2)-(6).
本发明与现有技术相比的优点在于:The advantage of the present invention compared with prior art is:
(1)本发明考虑到了组成应用的虚拟机之间的关联关系。虚拟机之间由于从属于同一个应用而天然具有一定的关联,但由于相关技术将虚拟机作为独立的单位来考虑,这些关联关系被割裂或忽略了。(1) The present invention takes into account the relationship between the virtual machines that make up the application. Virtual machines are naturally related to each other because they belong to the same application, but because related technologies consider virtual machines as independent units, these relationships are separated or ignored.
(2)使用多层网络模型刻画虚拟机之间的关联。现有相关技术没有提取出一个具有足够表达能力的抽象模型。(2) Use a multi-layer network model to describe the relationship between virtual machines. The existing related art does not extract an abstract model with sufficient expressive power.
(3)引入了软件定义固态盘缓存的概念。系统可以动态地根据工作负载及用户需求,从固态盘缓存分配和固态盘带宽管理两方面控制固态盘缓存的使用,实现需求和供给的平衡。(3) The concept of software-defined SSD cache is introduced. The system can dynamically control the use of SSD cache from the two aspects of SSD cache allocation and SSD bandwidth management according to workload and user needs, so as to achieve a balance between demand and supply.
附图说明Description of drawings
图1是本发明的系统架构图;Fig. 1 is a system architecture diagram of the present invention;
图2是本发明的实施流程图;Fig. 2 is the implementation flowchart of the present invention;
图3是监测模块的运行流程图;Fig. 3 is the operation flowchart of monitoring module;
图4是分析模块的运行流程图;Fig. 4 is the operation flowchart of analysis module;
图5是决策模块的运行流程图;Fig. 5 is the operation flowchart of decision-making module;
图6是执行模块的运行流程图。Fig. 6 is a flow chart of the execution module.
具体实施方式detailed description
以下结合具体实施例和附图对本发明作更详细的说明。The present invention will be described in more detail below in conjunction with specific embodiments and accompanying drawings.
本发明提出一种云应用感知的固态盘缓存管理方法及系统。这一系统主要由控制模块、监测模块、分析模块、决策模块和执行模块组成,其主要部署模式如图1所示。控制模块部署在独立的虚拟机或物理机上,协调监测模块、分析模块、决策模块和执行模块,完成自适应闭环的执行,并在监测到云应用工作负载发生突变时触发新一轮的自适应闭环执行。监测模块部署在Hypervisor和虚拟机上,用于收集Hypervisor和虚拟机的性能信息,包括Hypervisor的CPU、内存、网络和固态盘的资源信息,以及虚拟机的IO负载状况。分析模块部署在独立的虚拟机或物理机上,用于接受监测模块生成的信息,并构建多层网络模型。决策模块部署在独立的虚拟机或物理机上,通过执行具体的算法(二分图匹配和最小费用最大流),完成资源的供需匹配,并生成虚拟机放置方案和缓存容量的调整方案。执行模块部署在Hypervisor上,用于从生成的虚拟机放置方案中计算出虚拟机动态迁移顺序,并执行具体的虚拟机动态迁移和缓存分配操作。The present invention proposes a cloud application-aware solid state disk cache management method and system. This system is mainly composed of control module, monitoring module, analysis module, decision-making module and execution module, and its main deployment mode is shown in Figure 1. The control module is deployed on an independent virtual machine or physical machine, coordinates the monitoring module, analysis module, decision-making module and execution module to complete the execution of the adaptive closed-loop, and triggers a new round of self-adaptation when a sudden change in the cloud application workload is detected Closed-loop execution. The monitoring module is deployed on the Hypervisor and the virtual machine, and is used to collect the performance information of the Hypervisor and the virtual machine, including the resource information of the Hypervisor's CPU, memory, network and solid state disk, and the IO load status of the virtual machine. The analysis module is deployed on an independent virtual machine or physical machine to receive the information generated by the monitoring module and build a multi-layer network model. The decision-making module is deployed on an independent virtual machine or physical machine. By executing specific algorithms (bipartite graph matching and minimum cost maximum flow), the resource supply and demand matching is completed, and a virtual machine placement plan and a cache capacity adjustment plan are generated. The execution module is deployed on the Hypervisor, and is used to calculate the dynamic migration order of the virtual machines from the generated virtual machine placement scheme, and execute specific virtual machine dynamic migration and cache allocation operations.
下面以一个实例阐述具体步骤,如图2所示。本发明实例的目标云应用基于Java语言构建,Web前端应用服务器为Apache Tomcat,承载服务中间件的应用服务器也为ApacheTomcat,后端数据库服务器为MySQL。此外,承载这些组件的虚拟机为Linux操作系统。物理机集群由物理Hypervisor组成,每个Hypervisor连接至同一个共享存储,并部署了独立的固态盘。每个Hypervisor承载了多台虚拟机,且虚拟机集群上部署了多个云应用,从属于云应用的虚拟机可能位于不同的Hypervisor上。The specific steps are described below with an example, as shown in FIG. 2 . The target cloud application of the example of the present invention is based on the Java language construction, the Web front-end application server is Apache Tomcat, the application server carrying the service middleware is also Apache Tomcat, and the back-end database server is MySQL. In addition, the virtual machine hosting these components is a Linux operating system. A physical machine cluster consists of physical Hypervisors, each of which is connected to the same shared storage and deployed with independent SSDs. Each Hypervisor hosts multiple virtual machines, and multiple cloud applications are deployed on the virtual machine cluster, and the virtual machines belonging to the cloud applications may be located on different Hypervisors.
针对这一实例的具体步骤如下:The specific steps for this example are as follows:
(1)在目标应用中进行程序插装。对基于Java和Apache Tomcat的云应用而言,主要针对Servlet进行插装,从而获得云应用可以接受的所有请求类型;进一步地,对Servlet中调用HTTP请求和JDBC连接的部分进行插装,从而获得云应用不同组件之间的调用链和依赖程度,以及云应用对后端数据库的访问;最后,针对文件操作进行插装,以获得程序执行过程中读写文件的相关信息。插装代码会通过输出日志到文本文件的方式给出操作的执行时间和访问目标。(1) Perform program instrumentation in the target application. For cloud applications based on Java and Apache Tomcat, the Servlet is mainly instrumented to obtain all request types that the cloud application can accept; further, the part of the Servlet that invokes HTTP requests and JDBC connections is instrumented to obtain The call chain and dependency between different components of the cloud application, as well as the access of the cloud application to the back-end database; finally, the file operation is instrumented to obtain relevant information about reading and writing files during program execution. The instrumentation code will output the log to a text file to give the execution time and access target of the operation.
(2)控制模块开始一次完整的自适应闭环执行。控制模块首先与监测模块进行交互,监测模块的执行流程如图3所示。在获得第(1)步插装代码输出的日志基础上,分析得到云应用在应对用户请求时在各个模块上的执行时间以及具体的网络交互流程和网络访问目标,并返回给控制模块。(2) The control module starts a complete adaptive closed-loop execution. The control module first interacts with the monitoring module, and the execution flow of the monitoring module is shown in Figure 3. Based on the logs output by the plug-in code in step (1), analyze the execution time of the cloud application on each module when responding to user requests, as well as the specific network interaction process and network access target, and return it to the control module.
在本实例中,云应用的工作负载可以刻画为在特定时间段内,用户对云应用发起的Web请求的集合。在感知到了云应用可以接受的所有请求类型之后,监测模块在云应用应对特定工作负载时监测应用组件处理各类请求时在各个组件上分别花费的时间;由于已监测到了应用组件的文件操作,因此可以进一步将这些时间切分为IO时间和非IO时间,并将IO时间切分为顺序读写操作和随机读写操作的IO时间,最终得到云应用在应对用户请求时在各个模块上的执行时间。In this example, the workload of the cloud application can be characterized as a collection of web requests initiated by users to the cloud application within a specific period of time. After sensing all the request types that the cloud application can accept, the monitoring module monitors the time spent on each component when the cloud application is dealing with a specific workload; since the file operations of the application components have been monitored, Therefore, these times can be further divided into IO time and non-IO time, and the IO time can be divided into IO time of sequential read and write operations and random read and write operations, and finally get the cloud application on each module when responding to user requests execution time.
为了进一步监测得到网络交互流程和网络访问目标,监测模块会监测虚拟机上的进程,在Linux环境下通过ps命令配合自带的/proc文件系统实现。对于特别关心的进程,如java和mysqld,会进一步分析其命令行参数,从而获得Apache Tomcat和MySQL的实例位置,并由此获得配置文件和相关配置参数,主要包括Apache Tomcat打开端口信息,以及MySQL的数据库文件位置信息和端口信息。这些信息与插装代码返回的日志相匹配,可以得到网络访问信息。In order to further monitor the network interaction process and network access target, the monitoring module will monitor the process on the virtual machine, and realize it through the ps command and the built-in /proc file system in the Linux environment. For processes of special concern, such as java and mysqld, its command line parameters will be further analyzed to obtain the instance locations of Apache Tomcat and MySQL, and thus obtain configuration files and related configuration parameters, mainly including Apache Tomcat open port information, and MySQL The database file location information and port information. This information is matched with the logs returned by the instrumentation code, and network access information can be obtained.
监测虚拟机和Hypervisor的相关资源的使用状况时,主要借助Linux环境下的sysstat工具包实现。CPU监测通过mpstat命令实现;内存监测直接访问了Linux自带的/proc文件系统;磁盘监测通过iostat命令实现;网络连接监测通过netstat命令实现,网络流量监测通过Linux内核的API实现。When monitoring the usage status of virtual machines and Hypervisor-related resources, it is mainly implemented with the help of the sysstat toolkit in the Linux environment. CPU monitoring is implemented through the mpstat command; memory monitoring directly accesses the /proc file system that comes with Linux; disk monitoring is implemented through the iostat command; network connection monitoring is implemented through the netstat command, and network traffic monitoring is implemented through the Linux kernel API.
监测虚拟机的缓存使用状况时,主要通过在Hypervisor上监测绑定到虚拟机的固态盘缓存的状态实现。固态盘缓存基于Linux的dm-cache实现,通过调用dm-cache的具体方法得到固态盘缓存状态,主要监测缓存使用率、命中率以及固态盘的使用率。When monitoring the cache usage status of the virtual machine, it is mainly realized by monitoring the status of the solid-state disk cache bound to the virtual machine on the Hypervisor. Solid state disk cache is implemented based on dm-cache of Linux. By calling the specific method of dm-cache, the solid state disk cache status is obtained, and the cache utilization rate, hit rate and solid state disk utilization rate are mainly monitored.
(3)在获得第(2)、(3)步由监测模块返回的云应用信息和性能信息之后,控制模块将这些信息传递给分析模块。分析模块会执行多层网络模型的构建,其具体执行流程如图4所示。(3) After obtaining the cloud application information and performance information returned by the monitoring module in steps (2) and (3), the control module transmits these information to the analysis module. The analysis module will execute the construction of a multi-layer network model, and its specific execution process is shown in Figure 4.
首先是构建资源需求端。分析模块得到性能信息之后,结合云应用中虚拟机对其他虚拟机的IO依赖关系、对应虚拟机的IO负载和随机访问频率计算得到虚拟机对固态盘缓存的需求。分析模块得到云应用信息之后,将构成云应用的虚拟机之间的依赖关系和网络交互转化为虚拟机的依赖图。依赖图中的节点代表了构成云应用的独立模块,节点与虚拟机一一对应。有向边上的权重代表之前计算得到的虚拟机对固态盘缓存的需求。云应用在执行特定工作负载时的状况可映射为依赖关系图的子图。The first is to build the resource demand side. After the analysis module obtains the performance information, it combines the IO dependence of the virtual machine on other virtual machines in the cloud application, the IO load of the corresponding virtual machine, and the random access frequency to calculate the demand for the SSD cache of the virtual machine. After the analysis module obtains the cloud application information, it converts the dependency relationship and network interaction between the virtual machines constituting the cloud application into a dependency graph of the virtual machine. Nodes in the dependency graph represent independent modules that constitute cloud applications, and nodes correspond to virtual machines one-to-one. The weight on the directed edge represents the previously calculated demand of the virtual machine for the SSD cache. The state of a cloud application while executing a specific workload can be mapped as a subgraph of the dependency graph.
在本示例中,根据监测到的云应用边界(即云应用中包含的所有虚拟机),以及虚拟机之间建立的网络连接,构建出云应用的依赖关系图。之后精化云应用的依赖关系图,刻画出各组件的重要程度。最终形成的云应用依赖关系图包括组件间的依赖和它们对其他组件IO能力的依赖,从而形成多层网络模型的需求端。In this example, according to the monitored cloud application boundary (that is, all virtual machines included in the cloud application) and the network connections established between the virtual machines, a dependency graph of the cloud application is constructed. Afterwards, the dependency diagram of the cloud application is refined to describe the importance of each component. The final cloud application dependency graph includes dependencies between components and their dependencies on IO capabilities of other components, thus forming the demand side of the multi-layer network model.
其次是构建资源供给端。分析模块得到性能信息之后,将Hypervisor的CPU、内存和网络和固态盘资源进行量化,构建统一的资源供给模型。CPU资源以CPU时间为指标进行量化,内存资源以容量为指标进行量化,网络资源以带宽为指标进行量化,固态盘资源以IOPS和容量为指标进行量化。The second is to build a resource supply side. After the analysis module obtains the performance information, it quantifies the CPU, memory, network and SSD resources of the Hypervisor to build a unified resource supply model. CPU resources are quantified by CPU time, memory resources are quantified by capacity, network resources are quantified by bandwidth, and SSD resources are quantified by IOPS and capacity.
在本实例中,构建资源供给端时用到了根据物理集群的部署关系,结合Hypervisor上监测到的物理机和固态盘缓存的资源使用情况和最大资源供给能力构建出资源供给端。In this example, the resource provider is constructed based on the deployment relationship of the physical cluster, combined with the resource usage and maximum resource supply capacity of the physical machine and SSD cache monitored on the Hypervisor.
最后,分析模块根据云应用的当前工作负载状况,确定调整所需的决策模块,并确定决策模块的应用顺序,构建为多层决策层。在本实例中,分析模块配置资源需求端和资源供给端的供需关系,配合策略层的动态插拔机制,配置虚拟机放置方案优化和固态盘缓存容量分配优化这两层策略层,最终完成多层网络模型的构建。Finally, the analysis module determines the decision-making modules required for adjustment according to the current workload status of the cloud application, and determines the application sequence of the decision-making modules, which is constructed as a multi-layer decision-making layer. In this example, the analysis module configures the supply and demand relationship between the resource demand side and the resource supply side, cooperates with the dynamic plug-in mechanism of the policy layer, configures the two-layer strategy layer of optimization of virtual machine placement scheme and optimization of SSD cache capacity allocation, and finally completes the multi-layer Construction of network models.
分析模块将构建完成的由资源供给端、资源需求端和多层决策层组成的多层网络模型返回给控制模块。The analysis module returns the completed multi-layer network model composed of resource supply end, resource demand end and multi-layer decision-making layer to the control module.
(4)控制模块根据多层网络模型中的决策层顺序调用相应的决策模块,决策模块的执行流程如图5所示。控制模块将整个多层网络模型传递给决策模块,由决策模块根据不同策略实现资源供需的匹配,最后导出固态盘资源的调整方案,包括对虚拟机的固态盘缓存容量进行调整,以及对虚拟机的放置进行调整。决策模块将调整方案发回给控制模块。(4) The control module calls the corresponding decision-making module according to the order of the decision-making layers in the multi-layer network model. The execution flow of the decision-making module is shown in Figure 5. The control module passes the entire multi-layer network model to the decision-making module, and the decision-making module realizes the matching of resource supply and demand according to different strategies, and finally derives an adjustment plan for solid-state disk resources, including adjusting the virtual machine's solid-state disk cache capacity and adjusting the virtual machine to adjust the placement. The decision module sends the adjustment plan back to the control module.
在进行虚拟机放置方案的决策时,决策模块将其转化为特定约束条件下的二分图匹配,即在满足供给端的最大服务能力(CPU、内存、网络和固态盘资源)的前提下均衡分布所有虚拟机。决策模块使用二分图匹配算法实现资源的供需匹配。When making a decision on the virtual machine placement plan, the decision-making module converts it into a bipartite graph matching under specific constraints, that is, under the premise of satisfying the maximum service capacity (CPU, memory, network and SSD resources) of the supply side, all virtual machine. The decision-making module uses a bipartite graph matching algorithm to match the supply and demand of resources.
在进行虚拟机的固态盘缓存分配决策时,决策模块将其转化为子图上的最小花费最优(最大)流问题,即在满足固态盘缓存容量限制的条件下优先将固态盘缓存分配给高性价比的虚拟机。决策模块根据传入的云应用的相关信息分析当前工作负载模式下不同虚拟机的价值,将其映射到虚拟机依赖图上的流量,从而使用最小花费最大流算法确定每台虚拟机应当获得的固态盘缓存比例,完成固态盘缓存分配决策。When making the SSD cache allocation decision of the virtual machine, the decision-making module converts it into the minimum cost optimal (maximum) flow problem on the subgraph, that is, the SSD cache is preferentially allocated to Cost-effective virtual machines. The decision-making module analyzes the value of different virtual machines under the current workload mode according to the relevant information of the incoming cloud application, maps it to the flow on the virtual machine dependency graph, and uses the minimum cost maximum flow algorithm to determine the value that each virtual machine should obtain SSD cache ratio, to complete the SSD cache allocation decision.
(5)控制模块得到调整方案后,将其传递给执行模块,并调用执行模块完成具体调整方案的执行,执行模块的执行流程如图6所示。执行模块首先安全移除当前的虚拟机所使用的固态盘缓存,然后根据当前的虚拟机放置方案和传入的目标放置方案计算优化的虚拟机动态迁移顺序,接着遵循尽可能降低服务质量违约的原则执行虚拟机动态迁移,最后在目标虚拟机上按照传入的缓存分配方案进行缓存分配。(5) After the control module obtains the adjustment plan, it passes it to the execution module, and calls the execution module to complete the execution of the specific adjustment plan. The execution flow of the execution module is shown in Figure 6. The execution module first safely removes the SSD cache used by the current virtual machine, then calculates the optimized live migration sequence of virtual machines according to the current virtual machine placement scheme and the incoming target placement scheme, and then follows the principle of minimizing service quality violations The principle is to perform virtual machine dynamic migration, and finally perform cache allocation on the target virtual machine according to the incoming cache allocation scheme.
(6)步骤(2)~(5)构成了一次完整的自适应闭环执行。控制模块持续调用监测模块,在监测到云应用工作负载发生突变时按照步骤(2)~(5)的顺序触发新一轮的自适应闭环执行。云应用工作负载突变主要表现为工作负载的组成模式(各请求所占比例)发生突变,以及工作负载的强度(各节点上的IO操作强度)发生突变。(6) Steps (2)-(5) constitute a complete adaptive closed-loop execution. The control module continuously invokes the monitoring module, and triggers a new round of adaptive closed-loop execution in the order of steps (2) to (5) when a sudden change in the workload of the cloud application is detected. The mutation of cloud application workload mainly manifests as mutation of workload composition mode (proportion of each request) and workload intensity (IO operation intensity on each node).
此外,控制模块设定了阈值,以定期触发自适应闭环调整,即步骤(2)~(6)的执行。In addition, the control module sets a threshold to periodically trigger the adaptive closed-loop adjustment, that is, the execution of steps (2)-(6).
尽管为说明目的公开了本发明的具体实施例和附图,其目的在于帮助理解本发明的内容并据以实施,但是本领域的技术人员可以理解:在不脱离本发明及所附的权利要求的精神和范围内,各种替换、变化和修改都是可能的。因此,本发明不应局限于最佳实施例和附图所公开的内容。Although specific embodiments and drawings of the present invention are disclosed for the purpose of illustration, the purpose is to help understand the content of the present invention and implement it accordingly, but those skilled in the art can understand that: without departing from the present invention and the appended claims Various substitutions, changes and modifications are possible within the spirit and scope of . Therefore, the present invention should not be limited to what is disclosed in the preferred embodiments and drawings.
Claims (2)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611127232.9A CN106775942B (en) | 2016-12-09 | 2016-12-09 | A cloud application-oriented solid-state disk cache management system and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611127232.9A CN106775942B (en) | 2016-12-09 | 2016-12-09 | A cloud application-oriented solid-state disk cache management system and method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106775942A true CN106775942A (en) | 2017-05-31 |
CN106775942B CN106775942B (en) | 2020-06-16 |
Family
ID=58882022
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611127232.9A Active CN106775942B (en) | 2016-12-09 | 2016-12-09 | A cloud application-oriented solid-state disk cache management system and method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106775942B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110795221A (en) * | 2019-04-19 | 2020-02-14 | 成都海光集成电路设计有限公司 | Cache management method, cache controller, processor and storage medium |
US10824562B2 (en) | 2018-01-09 | 2020-11-03 | Hossein Asadi | Reconfigurable caching |
US12026535B2 (en) | 2021-09-27 | 2024-07-02 | UiPath, Inc. | System and computer-implemented method for controlling a robot of a virtual machine |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6345241B1 (en) * | 1999-02-19 | 2002-02-05 | International Business Machines Corporation | Method and apparatus for simulation of data in a virtual environment using a queued direct input-output device |
CN102385532A (en) * | 2011-12-02 | 2012-03-21 | 浪潮集团有限公司 | Method for improving cloud application property via non-transparent CACHE |
US20130155083A1 (en) * | 2011-11-29 | 2013-06-20 | James McKenzie | Methods and systems for maintaining state in a virtual machine when disconnected from graphics hardware |
CN103870312A (en) * | 2012-12-12 | 2014-06-18 | 华为技术有限公司 | Method and device for establishing storage cache shared by virtual machines |
CN104050014A (en) * | 2014-05-23 | 2014-09-17 | 上海爱数软件有限公司 | Efficient storage management method based on virtualization platform |
CN102662725B (en) * | 2012-03-15 | 2015-01-28 | 中国科学院软件研究所 | Event-driven high concurrent process virtual machine realization method |
US20150254000A1 (en) * | 2014-03-07 | 2015-09-10 | Vmware, Inc. | Configuring cache for i/o operations of virtual machines |
CN105323282A (en) * | 2014-07-28 | 2016-02-10 | 神州数码信息系统有限公司 | Enterprise application deployment and management system for multiple tenants |
CN105718280A (en) * | 2015-06-24 | 2016-06-29 | 乐视云计算有限公司 | Method and management platform for accelerating IO of virtual machine |
CN103026347B (en) * | 2010-05-27 | 2016-08-03 | 思科技术公司 | Virutal machine memory in multicore architecture divides |
CN105868020A (en) * | 2015-02-09 | 2016-08-17 | 国际商业机器公司 | Method for running virtual manager scheduler and virtual manager scheduler unit |
CN103457775B (en) * | 2013-09-05 | 2016-09-14 | 中国科学院软件研究所 | A kind of high available virtual machine pond management system of based role |
-
2016
- 2016-12-09 CN CN201611127232.9A patent/CN106775942B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6345241B1 (en) * | 1999-02-19 | 2002-02-05 | International Business Machines Corporation | Method and apparatus for simulation of data in a virtual environment using a queued direct input-output device |
CN103026347B (en) * | 2010-05-27 | 2016-08-03 | 思科技术公司 | Virutal machine memory in multicore architecture divides |
US20130155083A1 (en) * | 2011-11-29 | 2013-06-20 | James McKenzie | Methods and systems for maintaining state in a virtual machine when disconnected from graphics hardware |
CN102385532A (en) * | 2011-12-02 | 2012-03-21 | 浪潮集团有限公司 | Method for improving cloud application property via non-transparent CACHE |
CN102662725B (en) * | 2012-03-15 | 2015-01-28 | 中国科学院软件研究所 | Event-driven high concurrent process virtual machine realization method |
CN103870312A (en) * | 2012-12-12 | 2014-06-18 | 华为技术有限公司 | Method and device for establishing storage cache shared by virtual machines |
CN103457775B (en) * | 2013-09-05 | 2016-09-14 | 中国科学院软件研究所 | A kind of high available virtual machine pond management system of based role |
US20150254000A1 (en) * | 2014-03-07 | 2015-09-10 | Vmware, Inc. | Configuring cache for i/o operations of virtual machines |
CN104050014A (en) * | 2014-05-23 | 2014-09-17 | 上海爱数软件有限公司 | Efficient storage management method based on virtualization platform |
CN105323282A (en) * | 2014-07-28 | 2016-02-10 | 神州数码信息系统有限公司 | Enterprise application deployment and management system for multiple tenants |
CN105868020A (en) * | 2015-02-09 | 2016-08-17 | 国际商业机器公司 | Method for running virtual manager scheduler and virtual manager scheduler unit |
CN105718280A (en) * | 2015-06-24 | 2016-06-29 | 乐视云计算有限公司 | Method and management platform for accelerating IO of virtual machine |
Non-Patent Citations (2)
Title |
---|
吴恒,等;: "一种收益敏感的虚拟资源按需提供方法", 《软件学报》 * |
唐震,等;: "虚拟化环境下面向多目标优化的自适应SSD缓存系统", 《软件学报》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10824562B2 (en) | 2018-01-09 | 2020-11-03 | Hossein Asadi | Reconfigurable caching |
CN110795221A (en) * | 2019-04-19 | 2020-02-14 | 成都海光集成电路设计有限公司 | Cache management method, cache controller, processor and storage medium |
US12026535B2 (en) | 2021-09-27 | 2024-07-02 | UiPath, Inc. | System and computer-implemented method for controlling a robot of a virtual machine |
US12277430B2 (en) | 2021-09-27 | 2025-04-15 | UiPath, Inc. | System and computer-implemented method for controlling a robot of a virtual machine |
Also Published As
Publication number | Publication date |
---|---|
CN106775942B (en) | 2020-06-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Jindal et al. | Function delivery network: Extending serverless computing for heterogeneous platforms | |
US8429097B1 (en) | Resource isolation using reinforcement learning and domain-specific constraints | |
US8429096B1 (en) | Resource isolation through reinforcement learning | |
CN102404399B (en) | Fuzzy dynamic allocation method for cloud storage resource | |
CN104092756B (en) | A kind of resource dynamic distributing method of the cloud storage system based on DHT mechanism | |
CN104239227B (en) | A kind of virtualization storage managing device, local virtual memory management unit and method | |
Redekopp et al. | Optimizations and analysis of bsp graph processing models on public clouds | |
CN107196865A (en) | A kind of adaptive threshold overload moving method of Load-aware | |
US12229094B2 (en) | Proxy-based database scaling | |
CN111737168B (en) | A cache system, cache processing method, device, equipment and medium | |
CN113835616B (en) | Application data management method, system and computer device | |
CN110321331A (en) | The object storage system of storage address is determined using multistage hash function | |
CN105579999A (en) | log analysis | |
CN104765644B (en) | Resource collaboration Evolution System and method based on intellectual Agent | |
CN109951320A (en) | An extensible multi-level monitoring framework for cloud platform and its monitoring method | |
CN106775942A (en) | Solid-state disk cache management system and method that a kind of cloud application is oriented to | |
Estro et al. | Desperately seeking... optimal {Multi-Tier} cache configurations | |
US11592989B1 (en) | Dynamically modifying block-storage volumes using forecasted metrics | |
US11340940B2 (en) | Workload assessment and configuration simulator | |
CN117492866A (en) | A loading method and system for game maps | |
WO2016122595A1 (en) | Chunk monitoring | |
CN119415273A (en) | Reasoning service management method, device, medium and computer program product | |
Wang et al. | Provision of storage QoS in distributed file systems for clouds | |
CN118069345A (en) | Partition server equalization processing method and device, storage medium and computer equipment | |
Raindel et al. | Replicate and bundle (rnb)--a mechanism for relieving bottlenecks in data centers |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |