A cgroup-based IO control optimization method

By dynamically adjusting cgroup parameters through a central control server, the inflexible I/O priority policy issue in the Linux system is resolved, rational resource allocation and QoS control are achieved, I/O efficiency and bandwidth utilization are improved, latency is optimized, and the needs of multi-tasking systems are met.

CN119690347BActive Publication Date: 2025-10-10BEIJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411772793.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-10-10
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

The I/O priority strategy in existing Linux systems is not flexible, complex, and imprecise enough, resulting in irrational resource allocation, affecting system performance and stability. In particular, critical tasks are not responsive enough under high load environments. In addition, the priority control of different file systems is incompatible, making it difficult to meet the needs of multi-tasking systems.

Method used

Through the central control server, remote servers are continuously monitored, the IOPS, BPS, and latency parameters of the cgroup are dynamically adjusted, and personalized cgroup configurations are created to achieve precise resource allocation and QoS control. α and β are dynamically adjusted to adapt to changes in network conditions to ensure that the system runs in the best state.

Benefits of technology

It improves IO efficiency, optimizes latency and bandwidth utilization, provides flexible QoS control, meets the needs of different applications and users, and improves the adaptability and scalability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690347B_ABST
    Figure CN119690347B_ABST
Patent Text Reader

Abstract

The application discloses an IO control optimization method based on cgroup and belongs to the technical field of server storage, and is realized by a system composed of a central control server and remote servers and comprises the following steps: S1, data collection; S2, QoS parameter calculation; S3, cgroup configuration; S4, dynamic adjustment; the time delay and bandwidth variation of each remote server are obtained by continuously monitoring the central control server, alpha and beta are updated, and steps S1 to S3 are cyclically iterated, the resource allocation of the cgroup is dynamically adjusted, and it is ensured that the system always operates in an optimal state. The application provides a scheme for optimizing resources according to the characteristics of remote servers and network conditions, configures and manages the storage engine services in different regions through a unified central control server according to the actual conditions, meets the performance optimization standard, continuously adjusts and optimizes parameters and formulas according to requirements, and has good robustness and scalability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of server storage, and particularly relates to an IO control optimization method based on cgroup. BACKGROUND

[0002] In the Linux system, there are currently various I / O priority policies. Among them, for the CFQ (Completely Fair Queuing I / O Scheduler), the way it tries to allocate I / O resources fairly to each process may cause insufficiently rapid response to critical tasks in some cases. Because in a high-load environment, all processes perform I / O operations according to time slice rotation, even critical tasks in an emergency may need to wait for the end of the time slice of other processes to obtain I / O resources. Moreover, adjusting parameters such as queue length and time slice size requires deep understanding and experience of the system, otherwise it may lead to performance degradation instead of optimization.

[0003] Blkio Cgroups (Block Device I / O Control Groups) may bring certain complexity in use. Configuring and managing Cgroups requires good understanding of system architecture and underlying technology, which may have a certain learning curve for ordinary users or administrators. Moreover, different versions of Cgroups may have compatibility problems, and a lot of adjustments and tests may be needed when upgrading or migrating the system.

[0004] The mechanism of automatically promoting I / O priority in the Linux kernel may not be accurate and controllable enough. The judgment standard of the kernel for automatically promoting priority according to certain conditions may not fully meet the needs of actual applications, and such automatic promotion may affect the performance of other tasks. In addition, automatic promotion of priority may lead to unpredictable behavior, increasing the complexity and maintenance difficulty of the system.

[0005] Priority control at the file system level often has limitations. Different file systems provide different priority control options and functions, and may not be compatible with the priority policies of other system components. At the same time, priority control at the file system level can usually only be set for specific files or directories, which may not be flexible and comprehensive enough for complex multi-task systems.

[0006] In view of the above-mentioned shortcomings of the I / O throttling measures in the Linux system, how to provide an I / O throttling scheduling measure with simple configuration, flexible use, reasonable resource allocation, and effective optimization control is a problem that needs to be solved by those skilled in the art. SUMMARY

[0007] The present application aims to provide an IO control optimization method based on cgroup to solve the problems in the background art.

[0008] To achieve the above objectives, the present invention provides a cgroup-based IO control optimization method, which is implemented by a system consisting of a central control server and remote servers, and specifically includes the following steps:

[0009] S1. Data Collection: Continuously monitor each remote server using a central control server and periodically send test data packets to each remote server. After the remote server sends back a response data packet, the latency and bandwidth are calculated.

[0010] S2, QoS parameter calculation: Based on the data obtained in S1, adjust the basic QoS parameter values ​​and calculate the parameter values ​​of the cgroup corresponding to each remote server. QoS parameters include IOPS, BPS, and latency.

[0011] S3. Configure cgroup: Create a corresponding cgroup for each remote server and accurately write the parameter values ​​obtained in S2 into the control file of the corresponding cgroup;

[0012] S4. Dynamic adjustment: Based on the latency and bandwidth changes of each remote server continuously monitored by the central control server, α and β are updated and steps S1 to S3 are iterated repeatedly to dynamically adjust the resource allocation of the cgroup to ensure that the system always runs in the optimal state.

[0013] Preferably, the specific steps of S2 are as follows:

[0014] S21. Set basic IOPS, BPS, and latency values ​​for the system, and set latency thresholds and bandwidth thresholds.

[0015] S22: Based on the latency and bandwidth collected in S1, the system determines an adjustment plan for IOPS, BPS, and latency values ​​by comparing them with the set latency threshold and bandwidth threshold respectively.

[0016] S23. For the IOPS of the remote server corresponding to the cgroup, set the adjustment coefficient to α, for the BPS of the remote server corresponding to the cgroup, set the adjustment coefficient to β, and calculate the IOPS value of each remote server corresponding to the cgroup IOPS cgroup and the value of BPS cgroup .

[0017] Preferably, in S22, the IOPS adjustment formula is:

[0018] IOPS a =IOPS b ×(1-(u / L max ))×(w / B min );

[0019] Where, IOPS a and IOPS b are the adjusted IOPS and basic IOPS respectively, u is the latency, w is the bandwidth, L max is the maximum delay threshold, B min is the minimum bandwidth threshold;

[0020] The adjustment formula for BPS is:

[0021] BPS a =BPS b ×(1-(u / L max ))×(w / B min );

[0022] Where, BPS a and BPS b They are the adjusted BPS and basic BPS respectively;

[0023] The latency adjustment formula is:

[0024] latency a =latency b +k×u;

[0025] Where latency a and latency b are the adjusted latency and basic latency respectively, and k is the adjustment coefficient.

[0026] Preferably, in S23, IOPS cgroup The calculation formula is:

[0027]

[0028] BPS cgroup The calculation formula is:

[0029]

[0030] Where n is the total number of all remote servers, I total and B total They are the total IOPS and BPS resources in the system respectively.

[0031] Preferably, in S3, the IOPS obtained in S2 is cgroup The value is converted into a suitable format and written into the control file of the corresponding cgroup. The BPS obtained for S2 cgroup Value, determine the appropriate number of bytes and units, and write it to the control file of the corresponding cgroup.

[0032] Preferably, the specific steps of updating α and β in S4 are:

[0033] 1) Based on the new latency and bandwidth data obtained by the central control server, perform S23 to obtain the expected IOPS and expected BPS values ​​of the remote server;

[0034] 2) Calculate the deviation ratio between the expected IOPS and expected BPS values ​​obtained and the actual IOPS and actual BPS values ​​of the remote server obtained in the previous step S23, and adjust α and β.

[0035] Preferably, the adjustment rule for the IOPS adjustment coefficient α is:

[0036] When diff IOPS >0, α u =α i -γ×diff IOPS ;

[0037] When diff IOPS <0, α u =α i +γ×diff IOPS ;

[0038] Where, diff IOPS Indicates the deviation ratio of IOPS, α u and α i are the updated α and initial α respectively, and γ is the step size.

[0039] Preferably, the adjustment rule for the adjustment coefficient β of BPS is:

[0040] When diff BPS >0, β u =β i -γ×diff BPS ;

[0041] When diff BPS <0, β u =β i +γ×diff BPS ;

[0042] Where, diff BPS Indicates the deviation ratio of BPS, β u and β i are the updated β and initial β respectively.

[0043] The steps on the server side are:

[0044] 1) The data collection request arrives at the central control server and begins measuring the key parameters of the remote server;

[0045] 2) The central control server analyzes and processes the collected data and forwards the specific resource adjustment configuration to the cgroup management module of the remote server;

[0046] 3) The cgroup management module generates a resource configuration list: This includes configuration information for dynamically adjusting cgroup I / O parameters based on actual latency and bandwidth deficiencies or excesses;

[0047] 4) The central control server and remote servers call the cgroup management module setting API, set cgroup parameters according to the resource configuration list, and implement flow control of resources such as data transmission.

[0048] Therefore, the present invention provides an IO control optimization method based on cgroup, which has the following beneficial effects:

[0049] (1) Effectively improve IO efficiency: In large-scale storage systems, storage engine services in different regions often face the problem of poor data transmission efficiency due to differences in distance, bandwidth, and latency. This solution uses a central control server to accurately measure the latency and bandwidth of each remote server and dynamically adjust the IOPS. cgroup , BPS cgroup We create a corresponding cgroup for each remote server and configure detailed parameters based on latency and resource usage. This personalized resource allocation avoids resource waste and misallocation, ensuring that each storage engine service operates optimally, significantly improving overall I / O efficiency. Both data reads and writes are completed faster, meeting user demands for efficient storage and access.

[0050] (2) Effectively improve IO bandwidth utilization: As the scale of storage systems continues to expand, the demand for bandwidth resources is increasing. Traditional storage systems often cannot fully utilize bandwidth resources, resulting in some bandwidth being idle, and insufficient bandwidth may occur at critical times. This solution monitors the latency and bandwidth changes of remote servers in real time, and dynamically adjusts the data transmission rate according to actual conditions, so that bandwidth resources can be more reasonably allocated and utilized. When the bandwidth of a remote server is high, its data transmission volume is appropriately increased to give full play to the high bandwidth advantage; when the bandwidth is low, the data transmission strategy is adjusted in time to avoid affecting system performance due to insufficient bandwidth. As a result, the IO bandwidth utilization of the entire storage system is greatly improved, providing a strong guarantee for the stable operation of the system and efficient service.

[0051] (3) Effective latency optimization: In distributed storage systems, latency is one of the key factors affecting system performance. High latency not only causes slow data transmission, but also affects system response speed and user experience. This solution accurately calculates the latency of remote servers and dynamically adjusts the parameters of cgroups according to the latency situation, effectively reducing the latency of data transmission. For example, when a remote server is found to have high latency, the system automatically adjusts its data transmission strategy to reduce unnecessary waiting time and data transmission volume, thereby reducing latency. At the same time, through continuous monitoring and dynamic adjustment, the system can adapt to network condition changes in a timely manner, ensuring that latency remains at a low level.

[0052] (4) Facilitating QoS control: In large-scale storage systems, different applications and users may have different quality of service requirements for storage services. Some applications require high-priority data transmission, while others can accept lower transmission speed. This solution creates corresponding cgroups for each remote server and performs fine-grained parameter configuration, allowing system administrators to easily control QoS. Different IOPS, BPS, and latency values can be allocated to different cgroups according to different application requirements and user priorities, enabling differentiated management of storage service quality. This flexible QoS control method improves the adaptability and scalability of the system, better meeting the needs of different users and applications.

[0053] The technical solutions of the present application will be further described in detail below through the accompanying drawings and examples. BRIEF DESCRIPTION OF DRAWINGS

[0054] Figure 1 A flowchart of the cgroup-based IO control optimization method of the present application. DETAILED DESCRIPTION

[0055] The technical solutions of the present application will be further described in detail below through the accompanying drawings and examples.

[0056] To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all embodiments.

[0057] EMBODIMENT

[0058] As shown in the drawings, Figure 1 The present application provides a cgroup-based IO control optimization method, implemented through a system composed of a central control server and remote servers, with the following steps:

[0059] S1, data collection: the central control server continuously monitors each remote server and periodically sends test data packets to each remote server, and after the remote server returns the response data packet, the time delay and bandwidth are calculated; specifically:

[0060] The central control server periodically sends test data packets to each remote server and accurately records the sending time. The remote server immediately returns a response after receiving the test data packet. The central control server calculates the time delay according to the difference between the sending time and the receiving time. The time delay reflects the time consumed by data transmission in the network, and is one of the important indicators for evaluating network conditions. At the same time, the central control server monitors the total amount of data transmission with the remote server within a period of time, and calculates the bandwidth by dividing the total amount by the transmission time.

[0061] S2, QoS calculation: according to the data obtained in S1, the basic set QoS parameter value is adjusted, and the parameter value of the cgroup corresponding to each remote server is calculated, and the QoS parameters include IOPS, BPS and latency; specifically:

[0062] S21, set the basic IOPS, BPS and latency values for the system, and set the time delay threshold and bandwidth threshold;

[0063] S22, compare the time delay and bandwidth collected in S1 with the set time delay threshold and bandwidth threshold respectively, and determine the adjustment scheme of IOPS, BPS and latency value in the system;

[0064] The specific adjustment scheme is: if the time delay u is higher than the threshold, reduce IOPS and BPS by a certain proportion, and appropriately increase the record value of latency, so as to facilitate subsequent dynamic adjustment and reflect the influence of network delay on data transmission. If the bandwidth w is lower than the threshold, IOPS and BPS are also reduced by a certain proportion to adapt to lower bandwidth and ensure the stability of data transmission in the system under low bandwidth.

[0065] The adjustment formula of IOPS is:

[0066] IOPS a =IOPS b ×(1-(u / L max ))×(w / B min );

[0067] In the formula, IOPS a and IOPS b are the adjusted IOPS and basic IOPS respectively, u and w are the time delay and bandwidth collected in S1, L max and B min are the maximum time delay threshold and the minimum bandwidth threshold respectively;

[0068] The adjustment formula for BPS is:

[0069] BPS a =BPS b ×(1-(u / L max ))×(w / B min );

[0070] Where, BPS a and BPS b They are the adjusted BPS and basic BPS respectively;

[0071] The latency adjustment formula is:

[0072] latency a =latency b +k×u;

[0073] Where latency a and latency b are the adjusted latency and basic latency respectively, and k is the adjustment coefficient, which is determined according to the actual situation to ensure that the data transmission parameters are dynamically adjusted according to the network status.

[0074] S23. For the IOPS of the remote server corresponding to the cgroup, set the adjustment coefficient to α, and for the BPS of the remote server corresponding to the cgroup, set the adjustment coefficient to β. Considering the coexistence of multiple servers and the limited total resources, calculate the IOPS value of each remote server corresponding to the cgroup IOPS cgroup and the value of BPS cgroup .

[0075] IOPS cgroup The calculation formula is:

[0076]

[0077] Where n is the total number of all remote servers, I total is the total IOPS resource in the system. This formula shows that when the bandwidth of the remote server is higher and the latency is lower, the IOPS that the corresponding cgroup can obtain is cgroup The higher the bandwidth, the more efficient it is. At the same time, by allocating limited IOPS resources based on the weight of server bandwidth in the total bandwidth, the rational allocation of system resources is ensured.

[0078] BPS cgroup The calculation formula is:

[0079]

[0080] Where B total is the total BPS resource in the system. Similarly, this formula enables the cgroup corresponding to the server with high bandwidth and low latency to obtain higher BPS cgroup , and allocates the limited total BPS resources according to bandwidth weight, ensuring the stability and efficiency of the system.

[0081] Through the above formula, the I / O performance parameters of the corresponding cgroup can be dynamically adjusted according to the network conditions of different remote servers, achieving reasonable resource allocation and efficient operation of the system.

[0082] S3. Configure cgroup: Create a corresponding cgroup for each remote server and accurately write the parameter values ​​obtained in S2 into the control file of the corresponding cgroup; specifically:

[0083] Create a corresponding cgroup for each remote server. This can be achieved by modifying the relevant parameters in the " / sys / fs / cgroup / mygroup / io.max" file. First, determine the requirements and performance targets of the remote server corresponding to the cgroup, and then use the IOPS obtained by S2. cgroup The value is converted to the format and written to the file. For example, if the adjusted IOPS cgroup If the value is 1000, you can set "max=<maximum IOPS>" to "max=1000". When setting this value, ensure that it is within a reasonable range. It should not be too high, causing overallocation of system resources, nor too low, impacting normal server operation. Also, consider the overall system load and the needs of other cgroups to ensure proper resource allocation.

[0084] For setting BPS cgroup , by modifying the " / sys / fs / cgroup / mygroup / io.max" file. The BPS obtained for S2 cgroup value, determine the appropriate number of bytes and units. For example, if the adjusted BPS cgroup If the value is 512KB / s, you can set it to "max=524288B". cgroup When cgroup To avoid imbalance of system performance due to excessive focus on a certain indicator. In addition, the characteristics of different storage engines and data transmission modes must be considered to ensure that the set BPS cgroup The value can meet the actual needs.

[0085] Once configured, the system can precisely control the data transmission rate based on the remote server's latency and bandwidth. This prevents congestion and performance degradation caused by excessive data transmission during poor network conditions. At the same time, it can fully utilize bandwidth resources during good network conditions, improving overall system efficiency. Through detailed configuration of each cgroup, you can achieve personalized management of different remote servers, ensuring stable operation of the entire system.

[0086] S4. Dynamic Adjustment: Based on the latency and bandwidth changes of each remote server continuously monitored by the central control server, α and β are updated and steps S1 to S3 are iterated repeatedly to dynamically adjust the resource allocation of the cgroup to ensure that the system always runs in the optimal state. Specifically:

[0087] The central control server continuously monitors the latency and bandwidth changes of each remote server. Periodically, it recalculates QoS parameters based on the new latency and bandwidth values, updates α and β in S2, and iterates through S1-S3, updating the corresponding cgroup configuration and dynamically adjusting cgroup resource allocation to ensure the system always operates optimally.

[0088] 1) Based on the new latency and bandwidth data obtained by the central control server, perform S23 to obtain the expected IOPS and expected BPS values ​​of the remote server;

[0089] 2) Calculate the deviation ratio between the expected IOPS and expected BPS values ​​obtained and the actual IOPS and actual BPS values ​​of the remote server obtained in the previous step S23, and adjust α and β.

[0090] The adjustment method for the IOPS adjustment coefficient α is:

[0091] First, calculate the IOPS deviation ratio:

[0092]

[0093] Where, IOPS cgroup is the expected IOPS value, IOPS actual is the actual IOPS value of the remote server obtained in the previous step S23;

[0094] Then the adjustment coefficient α is updated according to the deviation ratio:

[0095] When diff IOPS >0, α u =α i -γ×diff IOPS ;

[0096] When diff IOPS<0, α u =α i +γ×diff IOPS ;

[0097] Where, α u and α i are the updated α and initial α respectively, and γ is the step size.

[0098] The adjustment method for the BPS adjustment coefficient β is:

[0099] First, calculate the deviation ratio of BPS:

[0100]

[0101] Where, BPS cgroup is the expected BPS value, BPS actual is the actual BPS value of the remote server obtained in the previous step S23;

[0102] Then the adjustment coefficient β is updated according to the deviation ratio:

[0103] When diff BPS >0, β u =β i -γ×diff BPS ;

[0104] When diff BPS <0, β u =β i +γ×diff BPS ;

[0105] Where, β u and β i are the updated β and initial β respectively.

[0106] By continuously updating the adjustment coefficient based on actual IOPS and BPS values, you can dynamically adjust the cgroup's resource allocation to more closely match the expected resource allocation, thereby improving system performance and stability. If the γ step size is set too large, the adjustment will be too drastic, causing system instability during the adjustment process. For example, IOPS and BPS may fluctuate significantly in a short period of time, affecting normal system operation. Conversely, if the γ step size is set too small, the adjustment may be very slow, and it will take a long time for the system to reach the ideal resource allocation state. The preferred setting for γ is 32.

[0107] The steps on the server side are:

[0108] 1) The data collection request arrives at the central control server and begins measuring the key parameters of the remote server;

[0109] 2) The central control server analyzes and processes the collected data and forwards the specific resource adjustment configuration to the cgroup management module of the remote server;

[0110] 3) The cgroup management module generates a resource configuration list: This includes configuration information for dynamically adjusting cgroup I / O parameters based on actual latency and bandwidth deficiencies or excesses;

[0111] 4) The central control server and remote servers call the cgroup management module setting API, set cgroup parameters according to the resource configuration list, and implement flow control of resources such as data transmission.

[0112] The implementation method for adjusting the cgroup I / O parameter configuration is as follows: This solution adopts an egress traffic strategy for data transmission, uses cgroup resource allocation and a dynamic feedback mechanism to schedule the QoS and order of data transmission, and by reasonably restricting resources, it is more accurate and effective than simply adjusting resource indicators, and can be applied to different remote servers.

[0113] Therefore, the present invention provides an IO control optimization method based on cgroup, which can effectively improve IO efficiency: in large-scale storage systems, storage engine services in different regions often face the problem of poor data transmission efficiency due to differences in distance, bandwidth and latency. This solution uses a central control server to accurately measure the latency and bandwidth of each remote server, and dynamically adjusts IOPS based on S4. cgroup , BPS cgroup We create a corresponding cgroup for each remote server and configure detailed parameters based on latency and resource usage. This personalized resource allocation avoids resource waste and misallocation, ensuring that each storage engine service operates optimally, significantly improving overall I / O efficiency. Both data reads and writes are completed faster, meeting user demands for efficient storage and access.

[0114] Effectively improve IO bandwidth utilization: As the scale of storage systems continues to expand, the demand for bandwidth resources is increasing. Traditional storage systems often cannot fully utilize bandwidth resources, resulting in some bandwidth being idle, and insufficient bandwidth may occur at critical times. This solution monitors the latency and bandwidth changes of remote servers in real time, and dynamically adjusts the data transmission rate according to actual conditions, so that bandwidth resources can be more reasonably allocated and utilized. When the bandwidth of a remote server is high, its data transmission volume is appropriately increased to give full play to the advantages of high bandwidth; when the bandwidth is low, the data transmission strategy is adjusted in time to avoid affecting system performance due to insufficient bandwidth. As a result, the IO bandwidth utilization of the entire storage system is greatly improved, providing a strong guarantee for stable system operation and efficient service.

[0115] Effectively optimize latency: In distributed storage systems, latency is a key factor affecting system performance. High latency not only slows data transmission but also impacts system responsiveness and user experience. This solution effectively reduces data transmission latency by accurately calculating remote server latency and dynamically adjusting control group parameters based on latency. For example, if a remote server experiences high latency, the system automatically adjusts its data transmission strategy to reduce unnecessary waiting time and data transmission volume, thereby reducing latency. Furthermore, through continuous monitoring and dynamic adjustments, the system can promptly adapt to changes in network conditions, ensuring that latency remains low.

[0116] Facilitates QoS control: In large-scale storage systems, different applications and users may have different requirements for the quality of storage services. Some applications require high-priority data transmission, while others can tolerate lower transmission speeds. This solution enables system administrators to easily control QoS by creating a corresponding cgroup for each remote server and configuring its parameters in detail. Different cgroups can be assigned different IOPS, BPS, and latency values ​​based on different application requirements and user priorities, enabling differentiated management of storage service quality. This flexible QoS control approach improves the system's adaptability and scalability, better meeting the needs of different users and applications.

[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solutions of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A cgroup-based IO control optimization method is implemented by a system consisting of a central control server and a remote server, characterized in that: The following steps are involved: S1. Data Collection: Continuously monitor each remote server using a central control server and periodically send test data packets to each remote server. After the remote server sends back a response data packet, the latency and bandwidth are calculated. S2. QoS parameter calculation: Based on the data obtained in S1, adjust the basic QoS parameters and calculate the parameter values ​​of the cgroup corresponding to each remote server. QoS parameters include IOPS, BPS, and latency. The specific steps are as follows: S21. Set basic IOPS, BPS, and latency values ​​for the system, and set latency thresholds and bandwidth thresholds. S22: Based on the latency and bandwidth collected in S1, the system determines an adjustment plan for IOPS, BPS, and latency values ​​by comparing them with the set latency threshold and bandwidth threshold respectively. The IOPS adjustment formula is: IOPS a =IOPS b ×(1-(u / L max ))×(w / B min ); Where, IOPS a and IOPS b are the adjusted IOPS and basic IOPS respectively, u is the latency, w is the bandwidth, L max is the maximum delay threshold, B min is the minimum bandwidth threshold; The adjustment formula for BPS is: BPS a =BPS b ×(1-(u / L max ))×(w / B min ); Where, BPS a and BPS b They are the adjusted BPS and basic BPS respectively; The latency adjustment formula is: latency a =latency b +k×u; Where latency a and latency b are the adjusted latency and basic latency respectively, and k is the adjustment coefficient; S23. For the IOPS of the remote server corresponding to the cgroup, set the adjustment coefficient to α, for the BPS of the remote server corresponding to the cgroup, set the adjustment coefficient to β, and calculate the IOPS value of each remote server corresponding to the cgroup IOPS cgroup and the value of BPS cgroup IOPS cgroup The calculation formula is: BPS cgroup The calculation formula is: Where n is the total number of all remote servers, I total and B total They are the total IOPS and BPS resources in the system respectively; S3. Configure cgroup: Create a corresponding cgroup for each remote server and accurately write the parameter values ​​obtained in S2 into the control file of the corresponding cgroup; S4, Dynamic Adjustment: Based on the latency and bandwidth changes of each remote server continuously monitored by the central control server, α and β are updated and steps S1 to S3 are iterated repeatedly to dynamically adjust the cgroup resource allocation to ensure that the system always runs in the optimal state. The specific steps for updating α and β are: 1) Based on the new latency and bandwidth data obtained by the central control server, perform S23 to obtain the expected IOPS and expected BPS values ​​of the remote server; 2) Calculate the deviation ratio between the expected IOPS and expected BPS values ​​obtained and the actual IOPS and actual BPS values ​​of the remote server obtained in the previous step S23, and adjust α and β; The adjustment rule for the IOPS adjustment coefficient α is: When diff IOPS > 0, α u = α i - γ × diff IOPS ; When diff IOPS < 0, α u = α i + γ × diff IOPS ; Where, diff IOPS Indicates the deviation ratio of IOPS, α u and α i are the updated α and initial α respectively, and γ is the step size; The adjustment rule for the BPS adjustment coefficient β is: When diff BPS > 0, β u = β i - γ × diff BPS ; When diff BPS < 0, β u = β i + γ × diff BPS ; Where, diff BPS Indicates the deviation ratio of BPS, β u and β i are the updated β and initial β respectively.

2. The cgroup-based IO control optimization method according to claim 1, characterized in that: In the S3, the IOPS obtained in S2 cgroup The value is converted into a suitable format and written into the control file of the corresponding cgroup. The BPS obtained for S2 cgroup Value, determine the appropriate number of bytes and units, and write it to the control file of the corresponding cgroup.

Citation Information

Patent Citations

  • Network measurement control system and network measurement control method

    JP2002016599A

  • Method, system, and device for allocating resources in a server

    US20170201574A1