Method, device, equipment, storage medium and program for adjusting virtual machine connection number
By dynamically adjusting the upper limit of the number of tracking connections for virtual machines, the problem of insufficient control over the number of tracking connections for virtual machines in the cloud environment is solved, thereby improving the communication performance and resource utilization of the host machine.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-07
AI Technical Summary
In a cloud computing environment, insufficient dynamic control of the number of virtual machine tracking connections affects the communication performance of the host machine.
The maximum preset number of tracking connections is determined based on the host machine's network hardware information and the expected load of the virtual machine. Status detection commands are sent to the virtual machine to analyze the actual tracking connection data and dynamically adjust the upper limit of the number of tracking connections for each virtual machine to match resource requirements.
This improves the host machine's communication performance and resource utilization, avoids the impact of virtual machine tracking changes on communication performance, and ensures that resource allocation matches demand.
Smart Images

Figure CN121462526B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud platform technology, and more specifically, to a method, apparatus, device, storage medium, and program for adjusting the number of virtual machine connections. Background Technology
[0002] In today's booming cloud computing technology landscape, enterprises and service providers widely adopt virtualization technology to optimize resource management and operational efficiency. Virtual machines (VMs), as the basic computing units in a cloud computing environment, require particularly robust resource management. Within cloud platforms, VM communication relies on virtual network architectures, among which Open vSwitch (OVS) is one of the most widely used virtual network switching mechanisms. OVS enables network communication between VMs and connections between VMs and external networks by creating virtual network devices on the host machine. However, with the increasing number of VMs and network traffic, the resources on the host machine used to track and manage the network connection status of VMs—namely, Connection Tracking (CT)—have become a critical bottleneck.
[0003] The number of traced connections refers to the number of network connection states (such as TCP connections, UDP sessions, etc.) used on the host machine to track the network connection status between virtual machines and external networks or other virtual machines. In the OVS architecture, this connection state information is stored in the Connection Tracking Zone (Ct_zone). As virtual machine activity increases, such as large-scale data transfers and frequent network connection establishment and disconnection, CT resources will be heavily consumed, potentially leading to the depletion of CT resources on the host machine and affecting the normal network communication of the virtual machine. For example, in high-concurrency network applications, such as database servers or network edge devices, virtual machines may need to establish network connections with a large number of clients or servers; the rapid consumption of CT resources will directly affect the availability and response time of these services.
[0004] Existing virtual machine management systems typically manage CT resources using a static allocation method, which allocates a fixed upper limit of CT resources when a virtual machine is created. This allocation method is not flexible enough in scenarios where the virtual machine load changes dynamically.
[0005] There is currently no effective solution to the problem of insufficient dynamic control of virtual machine tracking connection count in cloud environments, which affects the communication performance of the host machine. Summary of the Invention
[0006] This application provides a method, apparatus, device, storage medium, and program for adjusting the number of virtual machine connections, in order to at least solve the problem in the related art of insufficient dynamic control of the number of virtual machine connections in a cloud environment, which affects the communication performance of the host machine.
[0007] According to one embodiment of this application, a method for adjusting the number of virtual machine connections is provided, comprising: determining the maximum preset number of tracking connections supported by the host in a cloud environment based on the network hardware information corresponding to the host and the expected load of establishing the virtual machine; when multiple target virtual machines already exist in the cloud environment, sending status detection commands to the multiple target virtual machines respectively; determining the actual tracking connection data corresponding to multiple connection tracking domains associated with the multiple target virtual machines based on the feedback result of the status detection commands; and adjusting the upper limit of the number of tracking connections supported by each of the multiple target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data.
[0008] According to another embodiment of this application, a device for adjusting the number of virtual machine connections is provided, comprising: a first determining module, configured to determine the maximum preset number of tracking connections supported by the host in a cloud environment based on the network hardware information corresponding to the host and the expected load of establishing the virtual machine; a sending module, configured to send status detection instructions to the multiple target virtual machines respectively when multiple target virtual machines already exist in the cloud environment; a second determining module, configured to determine the actual tracking connection data corresponding to multiple connection tracking domains associated with the multiple target virtual machines based on the feedback result of the status detection instructions; and an adjusting module, configured to adjust the upper limit of the number of tracking connections supported by each of the multiple target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data.
[0009] According to yet another embodiment of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0010] According to yet another embodiment of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0011] According to yet another embodiment of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0012] This application determines the maximum preset number of tracking connections that the host machine can support in a cloud environment based on the host machine's hardware information, such as processor performance, memory size, and network interface capabilities, as well as the expected virtual machine load, such as the type of application running and the expected number of concurrent connections. Secondly, in a cloud environment where multiple virtual machines run on the host machine, status detection commands are periodically sent to each virtual machine to collect its current network connection status data. Next, based on the feedback results of the received status detection commands, the actual tracking connection data of the connection tracking domains associated with multiple virtual machines is analyzed, including the current total number of tracking connections and the number of tracking connections for each virtual machine, providing a data foundation for subsequent adjustment strategies. Finally, based on the maximum preset number of tracking connections and the current actual tracking connection data, the upper limit of the number of tracking connections supported by each virtual machine is dynamically adjusted to ensure that resource allocation matches actual needs. By adopting the above technical solution, the problem of insufficient dynamic control of the number of tracking connections of virtual machines in the cloud environment, which affects the communication performance of the host machine, is solved. Subsequently, the maximum preset number of tracking connections and the upper limit of the number of tracking connections of each virtual machine can be flexibly adjusted according to the dynamic changes of the host machine hardware capabilities and virtual machine load, thereby improving resource utilization and reducing the impact of changes in the number of tracking connections of virtual machines on the communication performance of the host machine. Attached Figure Description
[0013] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a hardware structure block diagram of a server device for a method of adjusting the number of virtual machine connections according to an embodiment of this application;
[0015] Figure 2 This is a flowchart of a method for adjusting the number of virtual machine connections according to an embodiment of this application;
[0016] Figure 3 This is a schematic diagram of the architecture of a virtual machine operation management system according to an embodiment of this application;
[0017] Figure 4 This is a structural block diagram of a virtual machine connection number adjustment system according to an embodiment of this application;
[0018] Figure 5 This is a computer system architecture block diagram of an electronic device according to an embodiment of this application;
[0019] In the above figure, 102 is the processor, 104 is the memory, 106 is the transmission device, 108 is the input / output device, 402 is the first determining module, 404 is the sending module, 406 is the second determining module, 408 is the adjustment module, 800 is the computer system, 801 is the CPU, 802 is the ROM, 803 is the RAM, 804 is the bus, 805 is the I / O interface, 806 is the input section, 807 is the output section, 808 is the storage section, 809 is the communication section, 810 is the driver, and 811 is the removable medium. Detailed Implementation
[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0021] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0022] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0023] The methods and embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of a server device for a method of adjusting the number of virtual machine connections according to an embodiment of this application. Figure 1 As shown, the server device may include one or more ( Figure 1Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a central processing unit (CPU), microcontroller unit (MCU), or field-programmable gate array (FPGA)) and a memory 104 for storing data are also shown. The server device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0024] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the virtual machine connection number adjustment method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to server devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0025] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the server device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0026] This embodiment provides a method for adjusting the number of virtual machine connections. Figure 2 This is a flowchart of a method for adjusting the number of virtual machine connections according to an embodiment of this application, as shown below. Figure 2 As shown, the process includes the following steps:
[0027] Step S202: Determine the maximum preset number of tracking connections supported by the host machine in the cloud environment based on the network hardware information corresponding to the host machine and the expected load of establishing the virtual machine.
[0028] Step S204: If multiple target virtual machines already exist in the cloud environment, send status detection commands to each of the multiple target virtual machines respectively;
[0029] Step S206: Determine the actual tracking connection data corresponding to the multiple connection tracking domains associated with the multiple target virtual machines based on the feedback result of the status detection instruction;
[0030] Step S208: Adjust the upper limit of the number of tracking connections supported by each of the multiple target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data.
[0031] In step S202, the maximum number of traced connections that the host machine can support in a cloud environment is first calculated based on the host machine's network hardware information and the expected virtual machine load. The host machine's network hardware information may include, but is not limited to, CPU performance, memory capacity, and network interface bandwidth; these factors collectively determine the host machine's ability to process and maintain network connections. The expected virtual machine load refers to the type of application the virtual machine is expected to run and its potential network communication requirements. For example, if the virtual machine is running a high-concurrency World Wide Web server, the expected number of traced connections will be much higher than that of a virtual machine running a simple workstation.
[0032] Once the maximum preset number of tracking connections is determined, the next step, S204, involves sending status detection commands to each of the multiple target virtual machines already existing in the cloud environment. These commands request each virtual machine to provide its current tracking connection status, i.e., the activity level of network connections associated with the virtual machine. In this way, real-time network communication data from all virtual machines can be continuously monitored and collected, providing a basis for further analysis and decision-making.
[0033] In step S206, based on the received status detection feedback results, the actual tracking connection data of multiple connection tracking domains associated with these target virtual machines are summarized and analyzed. A connection tracking domain (Ct_zone) is a logical area on the host machine used to organize and track the network connection status of one or more virtual machines. Through analysis, the current number of tracking connections for each virtual machine, as well as the overall number of tracking connections for all virtual machines, can be determined, which is crucial for subsequent dynamic adjustments.
[0034] Finally, in step S208, based on the maximum preset number of tracking connections and the actual number of tracking connections, the upper limit of the number of tracking connections supported by each target virtual machine will be adjusted. If the total number of actual tracking connections of all virtual machines is close to or reaches a certain threshold of the preset maximum number of tracking connections (e.g., 90%), it indicates that CT resources are becoming strained. At this time, the upper limit of the number of tracking connections for each virtual machine will be dynamically allocated according to the proportion of the actual number of tracking connections to the total number of connections, ensuring fair allocation of resources and preventing a single virtual machine from excessively consuming CT resources. Conversely, if the total number of actual tracking connections is much lower than the preset maximum value, there is no need to adjust the upper limit of the number of tracking connections; instead, monitoring will continue until the next detection cycle for reassessment.
[0035] Using the methods described above, based on the host machine's hardware information, such as processor performance, memory size, and network interface capabilities, as well as the expected virtual machine load, such as the type of application running and the expected number of concurrent connections, the maximum preset number of tracking connections that the host machine can support in the cloud environment is determined. Secondly, in the cloud environment where multiple virtual machines are running on the host machine, status detection commands are periodically sent to each virtual machine to collect its current network connection status data. Next, based on the feedback results of the received status detection commands, the actual tracking connection data of the connection tracking domains associated with multiple virtual machines is analyzed, including the current total number of tracking connections and the number of tracking connections for each virtual machine, providing a data foundation for subsequent adjustment strategies. Finally, based on the maximum preset number of tracking connections and the current actual tracking connection data, the upper limit of the number of tracking connections supported by each virtual machine is dynamically adjusted to ensure that resource allocation matches actual needs. By adopting the above technical solution, the problem of insufficient dynamic control of the number of tracking connections of virtual machines in the cloud environment, which affects the communication performance of the host machine, is solved. Subsequently, the maximum preset number of tracking connections and the upper limit of the number of tracking connections of each virtual machine can be flexibly adjusted according to the dynamic changes of the host machine hardware capabilities and virtual machine load, thereby improving resource utilization and reducing the impact of changes in the number of tracking connections of virtual machines on the communication performance of the host machine.
[0036] As an optional implementation, adjusting the upper limit of the number of tracking connections supported by each target virtual machine among multiple target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data includes: calculating the total number of actual tracking connections corresponding to multiple target virtual machines based on the actual tracking connection data; determining to adjust the upper limit of the number of tracking connections supported by each target virtual machine among multiple target virtual machines if the total number of actual tracking connections is greater than or equal to the percentage threshold corresponding to the maximum preset number of tracking connections; and determining not to adjust the upper limit of the number of tracking connections supported by each target virtual machine among multiple target virtual machines if the total number of actual tracking connections is less than the percentage threshold corresponding to the maximum preset number of tracking connections.
[0037] Specifically, the system first performs a comprehensive statistical analysis of the network connection status of the target virtual machine cluster, summarizing the total number of actual tracking connections currently occupied by all virtual machines. Then, this total number of actual tracking connections is compared with the preset maximum number of tracking connections, and a decision is made by setting a reasonable percentage threshold (e.g., 90%). When the total number of actual tracking connections reaches or exceeds this threshold, it is determined that CT resources are nearing saturation, triggering a dynamic adjustment of the tracking connection limit for each target virtual machine. The adjustment principle is based on the proportion of each virtual machine's current actual tracking connections to the total number of connections, reallocating its upper limit to achieve effective resource utilization and balanced allocation, avoiding performance bottlenecks caused by individual virtual machines excessively consuming CT resources. Conversely, if the total number of actual tracking connections is far below the set percentage threshold, it indicates that there are still sufficient CT resources available. In this case, the tracking connection limit for each virtual machine will not be automatically adjusted, but monitoring will continue to be performed to react to changes in resource demand. This implementation not only ensures smooth and stable network communication in the cloud environment but also effectively improves the management efficiency of host machine CT resources, avoiding resource waste and unnecessary performance losses, providing strong technical support for large-scale virtual machine deployments.
[0038] As an optional implementation, determining the upper limit of the number of tracking connections supported by each of the plurality of target virtual machines includes: determining the target percentage of the number of sub-connections corresponding to each target virtual machine in the total number of actual tracking connections; and determining the upper limit of the number of target tracking connections to be allocated to each target virtual machine based on the target percentage and the maximum preset number of tracking connections.
[0039] As an optional implementation, after determining the upper limit of the number of target tracking connections to be allocated to each target virtual machine based on the target proportion and the maximum preset number of tracking connections, the method further includes: determining the difference between the upper limit value corresponding to each target virtual machine and the actual number of tracking connections in the connection tracking domain corresponding to each target virtual machine; and generating a target application instruction to adjust the connection tracking domain parameters based on the difference.
[0040] In other words, the above describes two preferred implementation methods designed to more precisely control the upper limit of virtual machine tracking connections in the cloud environment, ensuring the rationality and efficiency of resource allocation.
[0041] The first implementation method involves determining the upper limit of the number of tracking connections supported by the target virtual machine, focusing on how to fairly and reasonably adjust the upper limit of the number of tracking connections for each target virtual machine. First, it is necessary to determine the target percentage of each target virtual machine within its total actual tracking connections. This target percentage can be determined by analyzing historical data, the type of applications running on the virtual machine, and its expected network load, representing the virtual machine's reasonable expected share of CT resources. Then, based on the target percentage and the previously set maximum preset number of tracking connections, the upper limit of the target number of tracking connections that should be allocated to each target virtual machine is calculated. In this way, even under conditions of scarce CT resources, it can be ensured that each virtual machine receives corresponding CT resources according to its target percentage, thereby avoiding imbalances in resource allocation and enhancing overall stability and fairness among virtual machines.
[0042] The second implementation method generates target application instructions to adjust the number of tracking connections. This builds upon the first implementation method by further executing specific resource adjustment operations. After calculating the upper limit of the target tracking connections to be allocated to each target virtual machine based on the maximum preset number of tracking connections and the target percentage, the difference between the current upper limit of tracking connections and the actual number of tracking connections for each target virtual machine is calculated. This difference reflects the adjustment amount of the virtual machine's upper limit of tracking connections. Based on this difference, a series of target application instructions are generated. These instructions directly adjust the parameters of the connection tracking domain where the virtual machine resides to achieve dynamic changes in the upper limit of tracking connections. In this way, changes in CT resources can be responded to in real time without affecting the operation of the virtual machine, achieving dynamic optimization of resource configuration and thus improving the network performance and resource utilization of both the host machine and the virtual machine.
[0043] In summary, by leveraging the synergistic effect of the two implementation methods, a dynamic and intelligent virtual machine tracking connection management mechanism is formed. This mechanism not only monitors CT resource usage in real time but also dynamically adjusts resource allocation strategies based on actual needs. This ensures that in high-load cloud environments, the host machine's CT resources are used efficiently, and each virtual machine receives the necessary network communication performance, while avoiding resource waste and performance bottlenecks. This improves the overall network communication efficiency and the level of intelligent resource management of the cloud platform.
[0044] As an optional implementation, the maximum preset number of tracking connections supported by the host in the cloud environment is determined based on the network hardware information corresponding to the host and the expected load of establishing the virtual machine. This includes: determining the first storage space required to establish the target virtual machine based on the expected load; determining the second storage space provided by the host based on the network hardware information, wherein the first storage space is smaller than the second storage space; dividing the second storage space using the space parameters corresponding to the first storage space to obtain the target number of virtual machines allowed to be established in the cloud environment; and determining the maximum preset number of tracking connections based on the target number.
[0045] Understandably, based on the application type and expected load of the virtual machines, the initial storage space required for each target virtual machine to run is estimated. This initial storage space specifically refers to the storage resources occupied by the virtual machines on the host machine, including the operating system, applications, and data storage, which is fundamental for the normal operation of the virtual machines. Next, based on the host machine's network hardware information, primarily storage hardware specifications, the total amount of secondary storage space that the host machine can provide is determined. It's important to note that the required initial storage space must be less than the capacity of the secondary storage space, ensuring that the host machine has sufficient space to support the operation of multiple virtual machines. Using the initial storage space requirement as a benchmark, the host machine's secondary storage space is rationally divided to calculate the number of target virtual machines that the host machine can support in a cloud environment. This calculation considers not only the physical limitations of storage space but also the expected load on the virtual machines, ensuring that the host machine can still operate stably while supporting multiple virtual machines. After determining the number of target virtual machines the host machine can support, the expected network load of the virtual machines and the host machine's processing power are combined to finally determine the maximum preset number of tracking connections. This value represents the maximum number of tracking connections that the host machine can handle under optimal conditions, and it provides an important reference for dynamically adjusting the maximum number of tracking connections for virtual machines.
[0046] This approach not only considers the actual limitations of hardware resources but also deeply analyzes the expected workload of software applications, enabling fine-grained resource management at both the host and virtual machine levels. Especially in large-scale virtualization environments, this resource planning method based on storage space and expected workload effectively avoids excessive consumption of CT resources, ensures full utilization of the host's network processing capabilities, and guarantees that each virtual machine receives a reasonable allocation of CT resources, maintaining good network communication performance.
[0047] As an optional implementation, before adjusting the upper limit of the number of tracking connections supported by each target virtual machine among multiple target virtual machines based on the maximum preset number of tracking connections and actual tracking connection data, the above method further includes: determining the historical state information corresponding to each virtual machine among multiple target virtual machines, wherein the historical state information includes at least one of the following: the upper limit of the number of connections in different connection tracking domains, the number of sub-actual connections used by each virtual machine, and the resource allocation of each virtual machine on the host machine; estimating the updated state information after adjustment, and determining the information difference between the updated state information and the historical state information; determining the performance changes of the virtual machines and the host machine resource usage based on the information difference; and determining the adjustment strategy based on the performance changes and the host machine resource usage.
[0048] In other words, before adjusting the maximum number of tracking connections for multiple target virtual machines, it is necessary to collect historical status information of these virtual machines. This information covers at least three aspects: the maximum number of connections for different connection tracking domains: recording the maximum number of tracking connections for virtual machines in the past to understand the historical situation of resource allocation; the actual number of sub-connections used by each virtual machine: tracking the actual number of tracking connections consumed by each virtual machine to provide a basis for resource requirements; and the resource allocation of each virtual machine on the host machine: including indicators such as CPU, memory, and disk read / write, to comprehensively reflect the resource usage status of the virtual machines.
[0049] Collecting this information helps build a complete profile of the virtual machine's running status, thereby better understanding historical resource allocation patterns and virtual machine operating characteristics. After obtaining historical status information, based on current actual tracking connection data and the maximum preset number of connections, the updated status information after adjusting the tracking connection limit is estimated, including the new connection limit and expected resource allocation. Subsequently, the differences between the updated status information and historical status information are compared. These differences include, but are not limited to, the magnitude of changes in tracking connections and the trend of resource allocation changes. Through comparative analysis, the potential effects of the adjustment strategy can be preliminarily predicted, such as improved virtual machine performance or increased host machine resource pressure. Based on these information differences, the trend of virtual machine performance changes and the utilization of host machine resources can be further inferred. For example, if the virtual machine's tracking connection limit decreases after adjustment, but resource allocation becomes more balanced, this may mean that the virtual machine's network latency will increase, but the overall performance of the host machine will improve. Conversely, if the tracking connection limit increases and resource allocation is adjusted accordingly, this may benefit the performance of a specific virtual machine, but increase the host machine's resource pressure. Finally, by combining the virtual machine performance change trend and the host machine resource usage, and taking into account the stability of the cloud environment, resource utilization efficiency, and virtual machine operating efficiency, the final tracking connection number adjustment strategy is determined. That is, the formulation of the tracking connection number adjustment strategy needs to take into account multiple objectives. For example, it is necessary to ensure that the host machine will not crash due to resource exhaustion, and also to ensure that the normal operation of the virtual machine is not significantly affected.
[0050] In summary, this approach not only enables dynamic adjustment of the upper limit of virtual machine tracking connections, but also introduces a prediction mechanism based on historical behavior. This makes the adjustment strategy more scientific and reasonable, better adaptable to the ever-changing needs of the cloud environment, thereby improving user experience and the reliability of virtual machine services while ensuring system stability and efficient resource utilization.
[0051] As an optional implementation, when multiple target virtual machines already exist in the cloud environment, before sending status detection commands to each of the multiple target virtual machines, the above method further includes: obtaining the real-time load and network status of the host machine; and calculating the sending cycle of the status detection command in real time based on the real-time load and network status.
[0052] In other words, before sending status detection commands to multiple target virtual machines, the real-time operating status of the host machine is captured. This includes key indicators such as host machine processor utilization, memory usage, disk I / O activity, and network bandwidth usage. Furthermore, the host machine's network conditions need to be monitored, such as network latency, packet loss rate, and connection establishment success rate, to comprehensively understand the host machine's current workload and network health. This data acquisition is typically accomplished through monitoring tools on the host machine or dedicated performance monitoring application programming interfaces (APIs), providing a real-time operational overview. Based on the host machine's real-time load and network conditions, the sending cycle of status detection commands is dynamically calculated. This cycle is not fixed but adaptively adjusted for different workloads and network conditions. When the host machine is heavily loaded or the network conditions are poor, the sending cycle of status detection commands may be extended to reduce the burden on the host machine to handle additional monitoring tasks, while avoiding additional latency and resource consumption caused by frequent command sending during network congestion. Conversely, when the host machine is lightly loaded and the network is stable, the detection cycle can be shortened, increasing the monitoring frequency to ensure that any abnormal changes in the number of virtual machine tracking connections can be captured promptly.
[0053] In summary, by calculating and adjusting the sending cycle of detection commands in real time, this implementation method maximizes the efficiency of intelligent resource scheduling and monitoring. On the one hand, it avoids the instability risks that may be caused by frequent monitoring when the host machine is under heavy load; on the other hand, it ensures that when the host machine resources are sufficient, it can quickly respond to changes in the network environment through intensive monitoring and adjust the upper limit of the number of tracking connections of virtual machines in a timely manner, thus finding a balance between maintaining stability and improving resource utilization efficiency.
[0054] As an optional implementation, when multiple target virtual machines already exist in the cloud environment, before sending status detection instructions to the multiple target virtual machines respectively, the above method further includes: monitoring the network indicators of each of the multiple target virtual machines, wherein the network indicators include at least one of the following: the transmission rate of the target virtual machine, the network latency of the target virtual machine, and the packet loss rate of the target virtual machine; and determining the maximum value or percentage threshold of the number of tracking connections that can be adjusted for each target virtual machine based on the detection results corresponding to the network indicators.
[0055] In simple terms, in an existing cloud environment, the host machine runs multiple target virtual machines, each with different performance characteristics depending on its application type and network requirements. Therefore, before sending status inspection commands to these virtual machines, the network performance metrics of each target virtual machine are monitored in real time. These metrics include at least:
[0056] Target virtual machine transfer rate: measures the speed at which virtual machine data is transferred, usually in Mbps or Gbps.
[0057] Network latency of the target virtual machine: This is the average time from when the target virtual machine sends a data packet to when it receives a response, reflecting the network response speed and efficiency.
[0058] Packet loss rate of the target virtual machine: This measures the percentage of data packets lost by the virtual machine during network communication and is an important indicator of network stability and quality.
[0059] By continuously monitoring these network metrics, real-time feedback on virtual machine network performance can be obtained, providing data support for subsequent adjustments.
[0060] After collecting the network metric detection results, the maximum value or percentage threshold for the number of tracking connections that can be adjusted is determined based on the specific network conditions of each virtual machine. This threshold is not fixed but dynamically adjusted based on real-time changes in network metrics. For example, if the detection results show that the transmission rate of a target virtual machine is close to its theoretical limit, the adjustment limit for the number of tracking connections for that virtual machine may be reduced to avoid a decrease in transmission rate due to excessive connections. Conversely, if a virtual machine has low network latency and packet loss rate, indicating stable network conditions, a larger adjustment range can be allowed for the upper limit of the number of tracking connections for that virtual machine to improve its potential network throughput.
[0061] This approach allows for personalized management of the maximum number of tracking connections for each virtual machine, ensuring that resource allocation considers both overall CT resource utilization and the specific network performance requirements of each virtual machine. This dynamic adjustment strategy based on network metrics helps host machines in cloud environments better balance virtual machine performance optimization with effective CT resource utilization, avoiding resource waste.
[0062] As an optional implementation, after adjusting the upper limit of the number of tracking connections supported by each of the multiple target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data, the above method further includes: after completing multiple adjustments to the upper limit of the number of tracking connections, determining the historical adjustment trend of each target virtual machine, and determining the connection usage trend of each target virtual machine after the adjustment; and determining the target adjustment parameters for the number of tracking connections corresponding to each target virtual machine based on the historical adjustment trend, the connection usage trend, and the resource status of the host machine.
[0063] Optionally, after multiple adjustments to the tracking connection limit for multiple target virtual machines, data analysis is performed to determine the historical adjustment trend for each virtual machine. The historical adjustment trend reflects how the tracking connection limit changes over time, including the frequency, direction (increase or decrease), and magnitude of adjustments. Simultaneously, the connection usage trend after adjustment is also monitored for each virtual machine, i.e., the actual usage of tracking connections under the new limit, including the fluctuation range, average utilization, and peak times. This process identifies which virtual machines show significant improvement in their tracking connection limit adjustments, which may require more frequent or larger-scale adjustments, and whether excessive adjustments have led to resource waste or performance degradation.
[0064] Based on a comprehensive analysis of historical adjustment trends and connection usage trends, combined with the current resource status of the host machine (such as remaining tracking connections, CPU utilization, memory utilization, etc.), the target parameters for future tracking connection adjustments for each target virtual machine can be determined. These target parameters may include:
[0065] The timing of the next adjustment cycle: Based on the usage trends of the virtual machines and the resource status of the host machine, determine when is the most appropriate time to make another adjustment.
[0066] Adjustment direction and magnitude: Determine whether to increase or decrease the maximum number of connections, and the magnitude of the adjustment, to ensure that the adjustment meets the performance requirements of the virtual machine without causing excessive consumption of host resources.
[0067] Personalized thresholds: Set personalized thresholds for each virtual machine, such as the percentage of the highest number of traced connections based on its historical usage, to prevent over-adjustment.
[0068] This approach not only allows for real-time responses to changes in virtual machine network demands but also enables the prediction of potential future trends and the proactive optimization of resource allocation. This method helps maintain the long-term stability of the host machine and the high-performance operation of virtual machines, especially in complex and ever-changing cloud environments, where it effectively improves resource utilization efficiency and network communication quality.
[0069] In summary, through continuous monitoring, historical data analysis, and intelligent decision-making, this implementation method achieves dynamic optimization management of the upper limit of virtual machine tracking connections. It not only improves the intelligence and flexibility of resource allocation, but also prevents resource waste, avoids performance bottlenecks, and ensures that the cloud platform can still provide stable services under high load.
[0070] As an optional implementation, after adjusting the upper limit of the number of tracking connections supported by each of the multiple target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data, the above method further includes: calculating the change in the number of connections used by the target virtual machines before and after the adjustment; and determining whether to increase the amount of target resources allocated to the target virtual machine from the host machine based on the change in the number of connections used.
[0071] As an optional implementation, determining whether to increase the target resource amount allocated to the target virtual machine from the host machine based on the change in connection usage includes: if the change in connection usage is greater than a preset change threshold, determining to increase the target resource amount allocated to the target virtual machine from the host machine; if the change in connection usage is less than or equal to the preset change threshold, keeping the target resource amount allocated to the target virtual machine from the host machine unchanged.
[0072] After adjusting the maximum number of tracked connections, the change in connection usage before and after the adjustment is statistically analyzed. This data is used as a basis to intelligently determine whether to increase the host resources allocated to that virtual machine. This process consists of two parts: 1. Determining the change in connection usage: The actual usage of tracked connections for each target virtual machine before and after the adjustment is recorded, and the change reflecting the trend of the virtual machine's network load is calculated. 2. If the change in connection usage exceeds a preset threshold, it indicates a significant increase in the virtual machine's network demand. The amount of host resources allocated to that virtual machine will be automatically increased to accommodate its higher network load and ensure that the virtual machine's performance is not affected. Conversely, if the change is less than or equal to the preset threshold, it indicates that the virtual machine's network load has not changed significantly or is within a controllable range. In this case, the amount of resources allocated to the target virtual machine from the host will remain unchanged to avoid unnecessary waste of resources.
[0073] Through the above mechanism, dynamic management of virtual machine resource allocation can be achieved, ensuring efficient resource utilization and virtual machine network performance. Especially in cloud environments with intense resource competition, this resource adjustment strategy based on changes in the number of connections can better meet the dynamically changing network needs of virtual machines, while optimizing the allocation of host resources, avoiding over-allocation or under-allocation, and improving the overall operational efficiency and user experience of the cloud platform.
[0074] The entities that perform the above steps can be servers, terminals, cloud platforms, etc., but are not limited to these.
[0075] To better understand the technical solution of this application, the terms involved in the embodiments are explained, but they do not limit this application.
[0076] Network: A network resource on a cloud platform. A network can have multiple subnets.
[0077] Subnet: A type of network resource on a cloud platform, consisting of individual network islands on the platform.
[0078] Port: A network resource on a cloud platform. Multiple ports can be created under a subnet. A port contains IP address information, and the virtual network attached to a port can use the corresponding IP address.
[0079] The Open Virtual Network (OVN) is a distributed controller, primarily consisting of processes like OVN-controller and OVN-northd that perform translation tasks, as well as processes like OVN-nb-db and OVN-sb-db that provide database server services. These processes can exist in a cluster, ensuring high availability.
[0080] Logical_switch_port: The logical switch port in OVN, which corresponds one-to-one with the virtual network interface card of the virtual machine.
[0081] Ct_zone: Connection tracking domain, a logical partition used to manage and track network connection status.
[0082] Tracking connection count: An important monitoring metric in network and virtualization environments, referring to the number of network connections that the system is currently tracking and maintaining.
[0083] To facilitate understanding of the implementation methods of this application, relevant scenarios are explained below, but these explanations do not limit the scope of this application.
[0084] An optional embodiment of this application proposes a method for dynamically limiting the number of virtual machine tracking connections. The main idea is to pre-set a maximum number of tracking connections, and then periodically use the conntrack command to obtain the total number of tracking connections in the current open virtual switch OVS related connection tracking domain Ct_zone. If the actual number of tracking connections exceeds 90% of the preset maximum number of tracking connections, the upper limit of each domain is dynamically adjusted according to the proportion of each domain to the total number of tracking connections.
[0085] It should be noted that the core idea of the above method is to monitor and adjust the number of connections in real time, dynamically allocate resources according to actual needs, and ensure that the performance and resource utilization of virtual machines are optimized. Figure 3 This is a schematic diagram illustrating the dynamic control of virtual machine tracking connection count according to an embodiment of this application, specifically including the following steps:
[0086] Step 1: Preset the maximum number of tracking connections. This value needs to be set according to the actual situation. Setting it too high or too low will affect the performance of the virtual machine.
[0087] Step two involves periodically obtaining the total number of traced connections for the current open virtual switch's related connection tracking domains. This process must ensure real-time performance and accuracy. For example, this can be achieved by periodically using the trace connection command to obtain the total number of traced connections for the current open virtual switch's related connection tracking domains.
[0088] Step 3: Determine if the actual number of tracking connections exceeds 90% of the preset maximum number of tracking connections. If it does, the upper limit of each domain needs to be dynamically adjusted. The percentages mentioned above can be set according to the actual situation; the above is just an example.
[0089] Step 4: Dynamically adjust the upper limit of each domain. This adjustment needs to be made according to the proportion of the current actual number of connections of each domain to the total number.
[0090] After that, the control flow ends (i.e., a Sleep60 stop command is issued), and the upper limit of the number of tracking connections for each domain is set according to the proportion of each domain to the total number.
[0091] As an optional implementation, the process in practical application is as follows: Set the maximum total number of tracked connections N=200,000, the threshold ratio P=90%, and the detection period T=60 seconds. Upon system startup, initialize the initial connection limit of each connection tracking domain Ct_zone (e.g., zone10, zone20, zone30) to 200,000. Perform connection count collection every 60 seconds: obtain the actual connection count S10=25,000 for zone10 via conntrack-L--zone10; obtain the actual connection count S20=75,000 for zone20 via conntrack-L--zone20; obtain the actual connection count S30=80,000 for zone30 via conntrack-L--zone30; calculate the total connection count S=25,000+75,000+80,000=180,000.
[0092] Threshold determination: Threshold = 200000 × 90% = 180000; The actual total number of connections S = 180000 reaches the threshold, triggering dynamic adjustment.
[0093] Dynamic adjustment: Calculate the percentage of each zone: R10 = 25000 / 180000 ≈ 13.89%. R20 = 75000 / 180000 ≈ 41.67%. R30 = 80000 / 180000 ≈ 44.44%.
[0094] New allocation limits: L10 = 200000 × 13.89% ≈ 27780. L20 = 200000 × 41.67% ≈ 83340. L30 = 200000 × 44.44% ≈ 88880.
[0095] Apply the new limit using commands such as ovs-vsctlset Ct_zone10limit=27780.
[0096] In the next detection cycle, data is collected and assessed again. If the total number of connections is still above the threshold, the dynamic adjustment process is repeated. When the actual total number of connections is below the threshold, such as S=150000 (less than 180000), no adjustment is triggered, and the current upper limit of the number of connections for each domain remains unchanged until the next detection cycle when the assessment is re-evaluated.
[0097] By applying the above implementation methods, dynamically allocating the upper limit of the number of connections ensures that resource allocation matches actual needs, avoiding resource idleness and waste. Furthermore, when the total number of connections approaches the upper limit, a proportional allocation mechanism prevents a single domain from excessively consuming resources, ensuring the overall stable operation of the system. In addition, automatic adjustment of the connection limit is achieved without manual intervention, and preset parameters (maximum number of connections, threshold ratio, detection cycle) can be adjusted to adapt to different scenario requirements. This reduces management costs and adapts to large-scale virtualization environments.
[0098] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0099] This embodiment also provides a device for adjusting the number of virtual machine connections. This device is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0100] Figure 4 This is a structural block diagram of a virtual machine connection number adjustment device according to an embodiment of this application, such as... Figure 4 As shown, the device includes:
[0101] The first determining module 402 is used to determine the maximum preset number of tracking connections supported by the host in the cloud environment based on the network hardware information corresponding to the host and the expected load of establishing the virtual machine.
[0102] The sending module 404 is used to send status detection instructions to the multiple target virtual machines respectively when multiple target virtual machines already exist in the cloud environment.
[0103] The second determining module 406 is used to determine the actual tracking connection data corresponding to multiple connection tracking domains associated with the multiple target virtual machines based on the feedback result of the status detection instruction.
[0104] The adjustment module 408 is used to adjust the upper limit of the number of tracking connections supported by each of the multiple target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data.
[0105] Using the aforementioned device, based on the host machine's hardware information, such as processor performance, memory size, and network interface capabilities, as well as the expected virtual machine load, such as the type of application running and the expected number of concurrent connections, the maximum preset number of tracking connections that the host machine can support in the cloud environment is determined. Secondly, in the cloud environment where multiple virtual machines are running on the host machine, status detection commands are periodically sent to each virtual machine to collect the current network connection status data of the virtual machines. Next, based on the feedback results of the received status detection commands, the actual tracking connection data of the connection tracking domains associated with multiple virtual machines is analyzed, including the current total number of tracking connections and the number of tracking connections for each virtual machine, providing a data foundation for subsequent adjustment strategies. Finally, based on the maximum preset number of tracking connections and the current actual tracking connection data, the upper limit of the number of tracking connections supported by each virtual machine is dynamically adjusted to ensure that resource allocation matches actual needs. By adopting the above technical solution, the problem of insufficient dynamic control of the number of tracking connections of virtual machines in the cloud environment, which affects the communication performance of the host machine, is solved. Subsequently, the maximum preset number of tracking connections and the upper limit of the number of tracking connections of each virtual machine can be flexibly adjusted according to the dynamic changes of the host machine hardware capabilities and virtual machine load, thereby improving resource utilization and reducing the impact of changes in the number of tracking connections of virtual machines on the communication performance of the host machine.
[0106] As an optional implementation, the adjustment module is further configured to: count the total number of actual tracking connections corresponding to multiple target virtual machines based on the actual tracking connection data; determine the upper limit of the number of tracking connections supported by each target virtual machine among the multiple target virtual machines if the total number of actual tracking connections is greater than or equal to the percentage threshold corresponding to the maximum preset number of tracking connections; and determine not to adjust the upper limit of the number of tracking connections supported by each target virtual machine among the multiple target virtual machines if the total number of actual tracking connections is less than the percentage threshold corresponding to the maximum preset number of tracking connections.
[0107] As an optional implementation, the adjustment module is further configured to determine the target percentage of the number of sub-connections corresponding to each target virtual machine in the total number of actual tracking connections; and to determine the upper limit of the number of target tracking connections to be allocated to each target virtual machine based on the target percentage and the maximum preset number of tracking connections.
[0108] As an optional implementation, the adjustment module further includes: an instruction unit, configured to, after determining the upper limit of the number of target tracking connections to be allocated to each target virtual machine based on the target proportion and the maximum preset number of tracking connections, determine the difference between the upper limit value corresponding to each target virtual machine and the actual number of tracking connections in the connection tracking domain corresponding to each target virtual machine; and generate a target application instruction to adjust the connection tracking domain parameters based on the difference.
[0109] As an optional implementation, the first determining module is further configured to: determine the first storage space required to establish the target virtual machine based on the expected load; determine the second storage space provided by the host machine based on network hardware information, wherein the first storage space is smaller than the second storage space; divide the second storage space using the space parameters corresponding to the first storage space to obtain the target number of virtual machines allowed to be established in the cloud environment; and determine the maximum preset number of tracking connections based on the target number.
[0110] As an optional implementation, the above apparatus further includes: a third determining module, configured to determine historical state information corresponding to each virtual machine among the multiple target virtual machines before adjusting the upper limit of the number of tracking connections supported by each target virtual machine among the multiple target virtual machines based on the maximum preset number of tracking connections and actual tracking connection data, wherein the historical state information includes at least one of the following: the upper limit of the number of connections in different connection tracking domains, the number of sub-actual connections used by each virtual machine, and the resource allocation of each virtual machine on the host machine; to estimate the updated state information after adjustment and determine the information difference between the updated state information and the historical state information; to determine the performance changes of the virtual machines and the resource usage of the host machine based on the information difference; and to determine the adjustment strategy based on the performance changes and the resource usage of the host machine.
[0111] As an optional implementation, the above apparatus further includes: an acquisition module, used to acquire the real-time load and network status of the host machine before sending status detection commands to the multiple target virtual machines in the case where multiple target virtual machines already exist in the cloud environment; and to calculate the sending cycle of the status detection commands in real time based on the real-time load and network status.
[0112] As an optional implementation, the above apparatus further includes: a fourth determining module, used to monitor the network metrics of each of the multiple target virtual machines before sending status detection instructions to the multiple target virtual machines respectively when multiple target virtual machines already exist in the cloud environment, wherein the network metrics include at least one of the following: the transmission rate of the target virtual machine, the network latency of the target virtual machine, and the packet loss rate of the target virtual machine; and to determine the maximum value or percentage threshold of the number of tracking connections that can be adjusted for each target virtual machine based on the detection results corresponding to the network metrics.
[0113] As an optional implementation, the above-mentioned device further includes: a fifth determining module, used to determine the historical adjustment trend of each target virtual machine and the connection usage trend of each target virtual machine after adjusting the upper limit of the number of tracking connections supported by each target virtual machine among multiple target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data; and to determine the target adjustment parameters of the number of tracking connections corresponding to each target virtual machine after multiple adjustments of the upper limit of the number of tracking connections.
[0114] As an optional implementation, the above-mentioned device further includes: a sixth determining module, used to, after adjusting the upper limit of the number of tracking connections supported by each of the multiple target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data, calculate the change in the number of connections used by the target virtual machines before and after the adjustment; and determine whether to increase the amount of target resources allocated to the target virtual machine from the host machine based on the change in the number of connections used.
[0115] As an optional implementation, the sixth determining module is further configured to determine, when the change in the number of connections is greater than a preset change threshold, to increase the target resource amount allocated to the target virtual machine from the host machine; and to keep the target resource amount allocated to the target virtual machine from the host machine unchanged when the change in the number of connections is less than or equal to the preset change threshold.
[0116] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same target processor; or, the above modules are located in different target processors in any combination.
[0117] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0118] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0119] Embodiments of this application also provide an electronic device, including a target memory and a target processor, wherein the target memory stores a computer program and the target processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0120] Optionally, Figure 5 This is a computer system architecture block diagram of an electronic device according to an embodiment of this application. For example... Figure 5 As shown, the computer system 800 includes a CPU 801 (Central Processing Unit, or CPU for short), which can perform various appropriate actions and processes based on programs stored in ROM 802 (Read-Only Memory, or ROM for short) or programs loaded from storage section 808 into RAM 803 (Random Access Memory, or RAM for short). RAM 803 also stores various programs and data required for system operation. The CPU 801, ROM 802, and RAM 803 are interconnected via bus 804. An I / O interface 805 (Input / Output interface, or I / O interface) is also connected to bus 804.
[0121] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a local area network card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.
[0122] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the central processing unit (CPU801) and the input / output device is connected to the central processing unit (CPU801).
[0123] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0124] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0125] Embodiments of this application also provide a computer program that includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.
[0126] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0127] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0128] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0129] The foregoing has provided a detailed description of a method, apparatus, device, storage medium, and program for adjusting the number of virtual machine connections provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for adjusting the number of virtual machine connections, characterized in that, include: The maximum preset number of tracking connections supported by the host machine in the cloud environment is determined based on the network hardware information of the host machine and the expected load of the virtual machine. If multiple target virtual machines already exist in the cloud environment, a status detection command is sent to each of the multiple target virtual machines; Based on the feedback results of the status detection command, determine the actual tracking connection data corresponding to multiple connection tracking domains that are associated with the multiple target virtual machines; The upper limit of the number of tracking connections supported by each of the multiple target virtual machines is adjusted based on the maximum preset number of tracking connections and the actual tracking connection data. The maximum preset number of tracking connections is determined by dividing the second storage space supported by the host network hardware capabilities into a first storage space corresponding to the expected load of the virtual machine as a constraint parameter, deriving the number of target virtual machines that can be supported, and combining this with the network hardware performance. The sending cycle of the status detection command is dynamically calculated based on the host machine's real-time load, network latency, and packet loss rate. The adjustment of the upper limit of the number of tracking connections supported by each of the plurality of target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data includes: The total number of actual tracked connections corresponding to the multiple target virtual machines is calculated based on the actual tracked connection data. If the total number of actual tracking connections is greater than or equal to the percentage threshold corresponding to the maximum preset number of tracking connections, determine to adjust the upper limit of the number of tracking connections supported by each of the multiple target virtual machines; If the total number of actual tracking connections is less than the percentage threshold corresponding to the maximum preset number of tracking connections, it is determined that the upper limit of the number of tracking connections supported by each of the multiple target virtual machines will not be adjusted. The determination of adjusting the upper limit of the number of tracking connections supported by each of the plurality of target virtual machines includes: Determine the target percentage of the number of sub-connections corresponding to each target virtual machine in the total number of actual tracked connections; The upper limit of the target tracking connection number to be allocated to each target virtual machine is determined based on the target percentage and the maximum preset number of tracking connections. The method further includes, after adjusting the upper limit of the number of tracking connections supported by each of the plurality of target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data: The change in the number of connections to the target virtual machine before and after the statistical adjustment was used. Based on the change in the number of connections, determine whether to increase the amount of target resources allocated to the target virtual machine from the host machine.
2. The method for adjusting the number of virtual machine connections according to claim 1, characterized in that, After determining the upper limit of the number of target tracking connections to be allocated to each target virtual machine based on the target proportion and the maximum preset number of tracking connections, the method further includes: Determine the difference between the online value corresponding to each target virtual machine and the actual number of tracked connections in the corresponding connection tracking domain of each target virtual machine; Based on the difference, a target application instruction is generated to adjust the connection tracking domain parameters.
3. The method for adjusting the number of virtual machine connections according to claim 1, characterized in that, The maximum preset number of tracking connections supported by the host machine in the cloud environment is determined based on the network hardware information of the host machine and the expected load of the virtual machine, including: The expected workload determines the first storage space required to build the target virtual machine; The second storage space provided by the host machine is determined based on the network hardware information, wherein the first storage space is smaller than the second storage space; The second storage space is divided using the space parameters corresponding to the first storage space to obtain the target number of virtual machines that can be built in the cloud environment; The maximum preset number of tracking connections is determined based on the target number.
4. The method for adjusting the number of virtual machine connections according to claim 1, characterized in that, Before adjusting the upper limit of the number of tracking connections supported by each of the plurality of target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data, the method further includes: Determine the historical state information corresponding to each of the plurality of target virtual machines, wherein the historical state information includes at least one of the following: the upper limit of the number of connections in different connection tracking domains, the number of sub-actual connections used by each virtual machine, and the resource allocation of each virtual machine on the host machine; Estimate the adjusted updated status information and determine the information differences between the updated status information and the historical status information; Based on the aforementioned information differences, determine the performance changes of the virtual machine and the host machine resource usage; The adjustment strategy is determined based on the aforementioned performance changes and host resource usage.
5. The method for adjusting the number of virtual machine connections according to claim 1, characterized in that, In the case where multiple target virtual machines already exist in the cloud environment, before sending status detection instructions to each of the multiple target virtual machines, the method further includes: Monitor the network metrics of each of the plurality of target virtual machines, wherein the network metrics include at least one of the following: the transmission rate of the target virtual machine, the network latency of the target virtual machine, and the packet loss rate of the target virtual machine; Based on the detection results corresponding to the network metrics, determine the maximum value or percentage threshold for adjusting the number of tracking connections allowed for each target virtual machine.
6. The method for adjusting the number of virtual machine connections according to claim 1, characterized in that, After adjusting the upper limit of the number of tracking connections supported by each of the plurality of target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data, the method further includes: After completing multiple adjustments to the maximum number of tracking connections, determine the historical adjustment trend of each target virtual machine and the connection usage trend of each target virtual machine after the adjustment. The target adjustment parameters for the number of tracking connections corresponding to each target virtual machine are determined based on the historical adjustment trend, the connection usage trend, and the host machine's resource status.
7. The method for adjusting the number of virtual machine connections according to claim 1, characterized in that, Determining whether to increase the target resource allocation from the host machine for the target virtual machine based on the change in the number of connections includes: If the change in the number of connections exceeds a preset change threshold, it is determined to increase the amount of target resources allocated to the target virtual machine from the host machine. If the change in the number of connections is less than or equal to a preset change threshold, the amount of target resources allocated to the target virtual machine from the host machine remains unchanged.
8. A device for adjusting the number of virtual machine connections, characterized in that, include: The first determining module is used to determine the maximum preset number of tracking connections supported by the host in the cloud environment based on the network hardware information corresponding to the host and the expected load of establishing the virtual machine. The sending module is used to send status detection commands to the multiple target virtual machines respectively when multiple target virtual machines already exist in the cloud environment; The second determining module is used to determine the actual tracking connection data corresponding to multiple connection tracking domains associated with the multiple target virtual machines based on the feedback result of the status detection instruction. The adjustment module is used to adjust the upper limit of the number of tracking connections supported by each of the multiple target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data. The maximum preset number of tracking connections is determined by dividing the second storage space supported by the host network hardware capabilities into a first storage space corresponding to the expected load of the virtual machine as a constraint parameter, deriving the number of target virtual machines that can be supported, and combining this with the network hardware performance. The sending cycle of the status detection command is dynamically calculated based on the host machine's real-time load, network latency, and packet loss rate. The adjustment module is further configured to: count the total number of actual tracking connections corresponding to the plurality of target virtual machines based on the actual tracking connection data; determine to adjust the upper limit of the number of tracking connections supported by each of the plurality of target virtual machines when the total number of actual tracking connections is greater than or equal to the percentage threshold corresponding to the maximum preset number of tracking connections; and determine not to adjust the upper limit of the number of tracking connections supported by each of the plurality of target virtual machines when the total number of actual tracking connections is less than the percentage threshold corresponding to the maximum preset number of tracking connections. The adjustment module is further configured to determine the target percentage of the number of sub-connections corresponding to each target virtual machine in the total number of actual tracking connections; and to determine the upper limit of the number of target tracking connections to be allocated to each target virtual machine based on the target percentage and the maximum preset number of tracking connections. The device further includes a sixth determining module, configured to, after adjusting the upper limit of the number of tracking connections supported by each of the plurality of target virtual machines based on the maximum preset number of tracking connections and the actual tracking connection data, calculate the change in the number of connections used by the target virtual machines before and after the adjustment; and determine whether to increase the amount of target resources allocated to the target virtual machine from the host machine based on the change in the number of connections used.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the virtual machine connection number adjustment method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the virtual machine connection number adjustment method as described in any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the virtual machine connection number adjustment method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Service resource dispatching method and device
CN104486255A
Tracking connection number control method and device of virtual machine, equipment and medium
CN120929194A