Resource adjustment method and device, server and storage medium
By monitoring the disk IO request processing time in a distributed storage system, determining the read and write resource target adjustment information, and sending it to the server cluster, the problem of unreasonable token resource adjustment in traditional technology is solved, and system performance and resource utilization efficiency are improved.
Patent Information
- Application Number
- CN202311768124.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2025-06-24
AI Technical Summary
In traditional technology, the adjustment of token resources is unreasonable, which leads to the inability to effectively match the IO request processing capabilities of the storage system, resulting in IO blockage, resource waste and performance reduction.
By monitoring the processing time of the IO request received by the disk within the preset sampling period, the disk's read and write resource target adjustment information is determined, and sent to the server cluster for adjusting the token resource.
This method can more accurately consider disk processing capabilities, improve the rationality and accuracy of token resource adjustment, thereby reducing IO blockage and optimizing system performance.
Smart Images

Figure CN120196422A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of distributed server clusters, and particularly to a resource adjustment method, apparatus, server, and storage medium. Background Art
[0002] When the input / output (IO) requests received by a distributed storage system exceed the processing capacity of the storage system, IO blocking will occur, thereby wasting system resources and network bandwidth and reducing the performance of the system. Therefore, for IO requests of different service types, a token bucket mechanism is introduced to limit the number of IO requests received by the storage system.
[0003] In the traditional technology, for IO requests of different service types, the token resources of the token buckets corresponding to each service type are adjusted by adopting a fixed ratio allocation method.
[0004] However, there is a problem of unreasonable adjustment of token resources in the traditional technology. Summary of the Invention
[0005] Based on this, it is necessary to provide a resource adjustment method, apparatus, server, and storage medium that can reasonably adjust token resources for the above technical problems.
[0006] In a first aspect, the present application provides a resource adjustment method, including:
[0007] Determine target adjustment information of the read / write resources of the disk according to the processing time of a first IO request and the processing time of a second IO request received by the disk of the first server within a preset sampling period; the first IO request is an IO request generated by the second server itself, and the second IO request is an IO request input by a user received by the second server; the second server is a server in the server cluster for receiving IO requests input by users;
[0008] Send the target adjustment information of the read / write resources of the disk to the second server, so that the second server determines adjustment information of the token resources corresponding to a third IO request based on the target adjustment information; the third IO request is an IO request generated by the second server itself.
[0009] In one embodiment, the determining the target adjustment information of the read / write resources of the disk according to the processing time of a first IO request and the processing time of a second IO request received by the disk of the first server within a preset sampling period includes:
[0010] Determine the initial adjustment information of the read / write resources of the disk according to the sum of the processing time of the first IO request and the time; wherein, the sum of the time is the sum of the processing time of the first IO request and the processing time of the second IO request;
[0011] Determine the target adjustment information of the read / write resources of the disk according to the sum of the time, the period value of the preset sampling period, and the initial adjustment information.
[0012] In one embodiment, the initial adjustment information includes an initial adjustment direction and an initial adjustment step size; the step of determining the initial adjustment information of the read / write resources of the disk according to the sum of the processing time of the first IO request and the time includes:
[0013] Determine the proportion of the processing time of the first IO request in the sum of the time according to the processing time of the first IO request and the sum of the time;
[0014] Determine the initial adjustment direction according to the proportion of the processing time and a preset proportion threshold;
[0015] Determine the ratio between the proportion of the processing time and the difference in proportion as the initial adjustment step size of the read / write resources of the disk; the difference in proportion is the difference between the proportion of the processing time and the proportion threshold.
[0016] In one embodiment, the step of determining the initial adjustment direction according to the proportion of the processing time and a preset proportion threshold includes:
[0017] If the proportion of the processing time is greater than the proportion threshold, determine the initial adjustment direction as the first adjustment direction;
[0018] If the proportion of the processing time is less than the proportion threshold, determine the initial adjustment direction as the second adjustment direction; wherein, the second adjustment direction is opposite to the first adjustment direction.
[0019] In one embodiment, the step of determining the target adjustment information of the read / write resources of the disk according to the sum of the time, the period value of the preset sampling period, and the initial adjustment information includes:
[0020] Determine the disk utilization rate of the disk within the preset sampling period according to the ratio between the sum of the time and the period value;
[0021] Determine the status information of the disk within the preset sampling period according to the disk utilization rate;
[0022] Determine the target adjustment information according to the status information and the initial adjustment information.
[0023] In one embodiment, determining the target adjustment information according to the status information and the initial adjustment information includes:
[0024] If it is determined according to the disk utilization rate that the disk is in the running state within the preset sampling period, then determine the initial adjustment direction and the initial adjustment step size as the target adjustment information;
[0025] If it is determined according to the disk utilization rate that the disk is in the idle state within the preset sampling period, then determine the target adjustment information according to the preset disk utilization rate, the cycle value, the time, and the initial adjustment information.
[0026] In one embodiment, determining the target adjustment information according to the preset disk utilization rate, the cycle value, the time, and the initial adjustment information includes:
[0027] Determine the target adjustment step size according to the preset disk utilization rate, the cycle value, the time, and the initial adjustment step size;
[0028] Determine the target adjustment direction according to the initial adjustment direction.
[0029] In one embodiment, determining the target adjustment direction according to the initial adjustment direction includes:
[0030] If the initial adjustment direction is the first adjustment direction, then determine the second adjustment direction as the target adjustment direction;
[0031] If the initial adjustment direction is the second adjustment direction, then determine the initial adjustment direction as the target adjustment direction.
[0032] In one embodiment, determining the target adjustment step size according to the preset disk rate and the initial adjustment step size includes:
[0033] Obtain the utilization time of the disk within the preset sampling period according to the preset disk utilization rate and the cycle value;
[0034] Determine the candidate adjustment step size of the read / write resources of the disk as the ratio of the time difference to the sum of the times; wherein, the time difference is the difference between the utilization time and the sum of the times;
[0035] If the candidate adjustment step size is greater than the initial adjustment step size, then determine the candidate adjustment step size as the target adjustment step size; if the candidate adjustment step size is less than or equal to the initial adjustment step size, then determine the initial adjustment step size as the target adjustment step size.
[0036] In a second aspect, the present application further provides a resource adjustment device, including:
[0037] A first determination module, configured to determine target adjustment information of the read-write resources of the disk according to the processing time of a first IO request and the processing time of a second IO request received by the disk of the first server within a preset sampling period; the first IO request is an IO request generated by the second server itself, and the second IO request is an IO request input by the user received by the second server; the second server is a server in the server cluster for receiving IO requests input by the user.
[0038] A sending module, configured to send the target adjustment information of the read-write resources of the disk to the second server, so that the second server determines adjustment information of token resources corresponding to a third IO request based on the target adjustment information; the third IO request is an IO request generated by the second server itself.
[0039] In a third aspect, the present application further provides a server, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0040] Determine target adjustment information of the read-write resources of the disk according to the processing time of a first IO request and the processing time of a second IO request received by the disk of the first server within a preset sampling period; the first IO request is an IO request generated by the second server itself, and the second IO request is an IO request input by the user received by the second server; the second server is a server in the server cluster for receiving IO requests input by the user.
[0041] Send the target adjustment information of the read-write resources of the disk to the second server, so that the second server determines adjustment information of token resources corresponding to a third IO request based on the target adjustment information; the third IO request is an IO request generated by the second server itself.
[0042] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0043] Determine target adjustment information of the read-write resources of the disk according to the processing time of a first IO request and the processing time of a second IO request received by the disk of the first server within a preset sampling period; the first IO request is an IO request generated by the second server itself, and the second IO request is an IO request input by the user received by the second server; the second server is a server in the server cluster for receiving IO requests input by the user.
[0044] Send the target adjustment information of the read / write resources of the disk to the second server, so that the second server determines the adjustment information of the token resources corresponding to the third IO request based on the target adjustment information; the third IO request is an IO request generated by the second server itself.
[0045] In a fifth aspect, the present application further provides a computer program product, including a computer program, which when executed by a processor implements the following steps:
[0046] Determine the target adjustment information of the read / write resources of the disk according to the processing time of the first IO request and the processing time of the second IO request received by the disk of the first server within a preset sampling period; the first IO request is an IO request generated by the second server itself, and the second IO request is an IO request input by the user received by the second server; the second server is a server in the server cluster for receiving IO requests input by the user;
[0047] Send the target adjustment information of the read / write resources of the disk to the second server, so that the second server determines the adjustment information of the token resources corresponding to the third IO request based on the target adjustment information; the third IO request is an IO request generated by the second server itself.
[0048] In the above resource adjustment method, device, server and storage medium, the first server receives the first IO request input by the user sent by the second server and the second IO request generated by the second server. The first server determines the target adjustment information of the read / write resources of the disk according to the processing time of the first IO request and the processing time of the second IO request received by the disk within a preset sampling period, and sends the target adjustment information of the read / write resources of the disk to the second server, so that the second server determines the adjustment information of the token resources corresponding to the third IO request according to the target adjustment information. Compared with the prior art in which the token resources are adjusted by a fixed ratio allocation method, the adjustment information of the token resources is calculated periodically, which is more matched with the processing capacity of the storage system for IO requests, thereby improving the rationality of adjusting the token resources. The target adjustment information of the read / write resources of the disk determined according to the processing time of the first IO request and the processing time of the second IO request received by the disk within a preset sampling period fully considers the processing capacity of the disk, so that the target adjustment information of the read / write resources of the disk has a high accuracy. Further, the adjustment information of the token resources corresponding to the third IO request determined by the target adjustment information of the read / write resources of the disk is also more accurate. Description of the Drawings
[0049] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the accompanying drawings required for the description of the embodiments or related technologies. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other accompanying drawings can be obtained based on these drawings without creative efforts.
[0050] Figure 1 Schematic diagram of introducing the token bucket mechanism into the distributed storage system;
[0051] Figure 2 Application environment diagram of the resource adjustment method in one embodiment;
[0052] Figure 3 Flow schematic diagram of the resource adjustment method in one embodiment;
[0053] Figure 4 Flow schematic diagram of the resource adjustment method in another embodiment;
[0054] Figure 5 Flow schematic diagram of the resource adjustment method in another embodiment;
[0055] Figure 6 Flow schematic diagram of the resource adjustment method in another embodiment;
[0056] Figure 7 Flow schematic diagram of the resource adjustment method in another embodiment;
[0057] Figure 8 Flow schematic diagram of the resource adjustment method in another embodiment;
[0058] Figure 9 Flow schematic diagram of the resource adjustment method in another embodiment;
[0059] Figure 10 Structural block diagram of the resource adjustment device in one embodiment;
[0060] Figure 11 Structural block diagram of the resource adjustment device in another embodiment;
[0061] Figure 12 Internal structure diagram of a computer device in one embodiment. Detailed implementation manners
[0062] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0063] AsFigure 1 As shown in the figure, the distributed server cluster includes multiple first servers and multiple second servers. Among them, the second server is used to receive the IO requests sent by users or generate the IO requests corresponding to background services. The first server is the server that processes the IO requests sent by the second server. The first server includes multiple disks. The second server can determine the disk corresponding to the IO request according to the information carried in the IO request, and send the IO request to the first server corresponding to the disk. The first server distributes the IO request to the disk corresponding to the IO request, and performs read or write operations within the disk. If the IO requests in the distributed storage system exceed the processing capacity of the distributed storage system, IO blocking will occur. IO blocking will lead to timeout retransmission, wasting the resources of the distributed storage system and network bandwidth, and reducing the performance of the distributed storage system. Therefore, the mechanism of the token bucket can be introduced to limit the number of IO requests accessing the distributed storage system. The second server periodically allocates token resources to the token bucket according to the IO processing capacity of the first server. After the IO request obtains the token resources, the second server sends the IO request to the first server. If there are no remaining token resources in the token bucket and the IO request cannot obtain the token resources, it needs to be added to the linked list to wait. When the token resources are injected into the token bucket in the next cycle, the first server distributes the token resources to the IO requests in the linked list. However, since different service types correspond to different token buckets, and the priority of the IO requests sent by users is higher than that of the IO requests of background tasks, the traditional technology uses a fixed ratio allocation method to adjust the token resources of the token buckets corresponding to each service type, resulting in unreasonable adjustment of token resources. For example, when the token resources required for the IO requests input by users are low, it is impossible to allocate a higher proportion of token resources to the token bucket corresponding to the IO requests of background tasks; or when the performance of the distributed storage system deteriorates, it is impossible to allocate a higher proportion of token resources to the token bucket corresponding to the IO requests input by users, resulting in the IO requests sent by users not being processed in time; or if the hardware of the distributed storage system is upgraded, the preset fixed ratio does not match the new configuration of the distributed storage system. Therefore, this application provides a resource adjustment method for the token resources corresponding to the IO requests of background tasks.
[0064] The resource adjustment method provided by the embodiments of this application can be applied to an application environment as shown in Figure 2 the figure. Among them, the first server 102 communicates with the second server 104 through the network. The first server 102 sends the target adjustment information of the read / write resources of the disk to the second server 104. Both the first server 102 and the second server 104 can be implemented as independent servers or server clusters composed of multiple servers.
[0065] In one embodiment, as shown in Figure 3 As shown, a resource adjustment method is provided. Taking the first server applied in Figure 2 as an example for illustration, the above method includes:
[0066] S201. Determine the target adjustment information of the read-write resources of the disk according to the processing time of the first IO request and the processing time of the second IO request received by the disk of the first server within a preset sampling period. The first IO request is an IO request generated by the second server itself, and the second IO request is an IO request input by the user received by the second server. The second server is the server in the server cluster for receiving the IO requests input by the user.
[0067] Among them, the storage systems in the server cluster can form a distributed storage system. The first server is the server in the server cluster for processing IO requests, and the second server is the server in the server cluster for receiving the IO requests input by the user and sending the received IO requests input by the user and the IO requests generated by the second server itself to the first server. In this embodiment, the first IO request is an IO request generated by the second server based on the background tasks of the distributed storage system. Exemplarily, the background tasks of the distributed storage system include background repair tasks and background defragmentation tasks. The second IO request is an IO request input by the user received by the second server. In this embodiment, the processing time of the first IO request is the difference between the moment when the first IO request is sent to the disk and the moment when the processing of the first IO request is completed. The processing time of the second IO request is the difference between the moment when the second IO request is sent to the disk and the moment when the processing of the second IO request is completed. The target adjustment information of the read-write resources of the disk is the adjustment information for adjusting the read-write resources of the disk corresponding to the first IO request.
[0068] In this embodiment, the first server includes multiple disks, and each disk processes the received IO requests. For example, each disk performs read operations or write operations according to the IO requests. The IO requests received by each disk can be the first IO request or the second IO request. That is to say, the IO requests processed by the disks of the first server within a preset sampling period include the first IO request and the second IO request. Therefore, in this embodiment, the first server determines the target adjustment information of the read-write resources of the disk by collecting the processing time of the first IO request and the processing time of the second IO request received by each disk within a preset sampling period. Exemplarily, the period value of the preset sampling period can be 1ms, 2ms, etc.
[0069] Optionally, the processing time difference between the second IO request and the first IO request can be calculated. When the time difference is greater than or less than a preset time difference threshold, the target adjustment information can be determined according to the time difference and the time difference threshold; when the time difference is equal to the preset time difference threshold, it can be determined that the current disk read / write resources are not adjusted, that is, the target adjustment information is determined to be empty.
[0070] S202, send the target adjustment information of the disk read / write resources to the second server, so that the second server determines the adjustment information of the token resources corresponding to the third IO request based on the target adjustment information; the third IO request is an IO request generated by the second server itself.
[0071] Among them, the third IO request is an IO request generated by the second server.
[0072] It can be understood that there are multiple first servers in the distributed server cluster, and each server can send the target adjustment information determined by itself to the second server. The second server can determine the adjustment information of the token resources corresponding to the third IO request generated by itself based on the target adjustment information sent by each first server.
[0073] In this embodiment, the second server receives the target adjustment information of the read / write resources of multiple disks sent by multiple first servers, and the second server determines the adjustment information of the token resources corresponding to the third IO request from the multiple target adjustment information that is applicable to all disks. Optionally, the second server may determine the adjustment information of the token resources corresponding to the third IO request based on the target adjustment information, and then determine whether to adjust the token resources according to the adjustment information of the token resources corresponding to the third IO request based on the consumption of the token resources corresponding to the third IO request within a preset sampling period. Exemplarily, the adjustment information of the token resources may include a token adjustment direction and a token adjustment step. When the token adjustment direction is downward, it is determined whether the token resources after adjustment according to the adjustment information are less than the consumption resources of the token resources corresponding to the third IO request within a preset sampling period. If the token resources after adjustment according to the adjustment information are less than or equal to the consumption resources within a preset sampling period, it is determined not to adjust the token resources corresponding to the third IO request according to the adjustment information of the token resources. If the token resources after adjustment according to the adjustment information are greater than the consumption resources within a preset sampling period, it is determined to adjust the token resources corresponding to the third IO request according to the adjustment information of the token resources. When the adjustment direction of the token resources is upward, it is determined whether the consumption resources of the token resources corresponding to the third IO request within a preset sampling period are greater than a preset resource threshold. If the consumption resources are greater than or equal to the preset resource threshold, it is determined to adjust the token resources corresponding to the third IO request according to the adjustment information of the token resources. If the consumption resources are less than the preset resource threshold, the token resources corresponding to the third IO request are not adjusted according to the adjustment information of the token resources.
[0074] For the above resource adjustment method, the first server receives the first IO request input by the user and the second IO request generated by the second server sent by the second server. The first server determines the target adjustment information of the read / write resources of the disk according to the processing time of the first IO request and the processing time of the second IO request received by the disk within a preset sampling period, and sends the target adjustment information of the read / write resources of the disk to the second server, so that the second server determines the adjustment information of the token resources corresponding to the third IO request according to the target adjustment information. Compared with the prior art in which the token resources are adjusted by a fixed ratio allocation method, calculating the adjustment information of the token resources periodically is more matched with the processing capacity of the storage system for IO requests, thereby improving the rationality of adjusting the token resources. The target adjustment information of the read / write resources of the disk determined according to the processing time of the first IO request and the processing time of the second IO request received by the disk within a preset sampling period fully considers the processing capacity of the disk, making the target adjustment information of the read / write resources of the disk highly accurate. Further, the adjustment information of the token resources corresponding to the third IO request determined through the target adjustment information of the read / write resources of the disk is also more accurate.
[0075] In the scenario of determining the target adjustment information of the disk read-write resources based on the processing time of the first IO request and the processing time of the second IO request received by the disk of the first server within a preset sampling period, the time sum of the processing time of the first IO request and the processing time of the second IO request can be calculated first, and then the target adjustment information of the disk read-write resources can be determined according to the time sum and the period value of the preset sampling period. In one embodiment, as Figure 4 shown, S201 above includes:
[0076] S301, determining the initial adjustment information of the disk read-write resources according to the processing time of the first IO request and the time sum; wherein, the time sum is the sum of the processing time of the first IO request and the processing time of the second IO request.
[0077] In this embodiment, the processing time of the first IO request is added to the processing time of the second IO request to obtain the time sum of the processing time of the first IO request and the processing time of the second IO request. Further, the initial adjustment information of the disk read-write resources can be determined according to the difference or ratio between the processing time of the first IO request and the time sum.
[0078] Optionally, the first difference between the processing time of the first IO request and the time sum can be calculated, the corresponding relationship between the first difference and the adjustment information can be stored in advance, and the adjustment information corresponding to the first difference can be determined as the initial adjustment information of the disk read-write resources.
[0079] S302, determining the target adjustment information of the disk read-write resources according to the time sum, the period value of the preset sampling period, and the initial adjustment information.
[0080] Optionally, it can be determined whether to determine the initial adjustment information as the target adjustment information of the disk read-write resources according to the difference between the time sum and the period value of the preset sampling period. Exemplarily, when the difference between the time sum and the period value is less than the preset period difference threshold, the initial adjustment information is determined as the target adjustment information of the disk read-write resources. When the difference between the time sum and the period value is greater than or equal to the preset period value threshold, the initial adjustment information can be updated according to the preset adjustment coefficient. For example, the product of the adjustment coefficient and the initial adjustment step length in the initial adjustment information is used as the updated initial adjustment step length, and the updated initial adjustment information is determined as the target adjustment information.
[0081] As another alternative implementation, the initial adjustment information can be further calculated according to the time sum and the cycle value to determine the target adjustment information of the read / write resources of the disk. Exemplarily, the ratio of the time sum to the cycle value can be calculated, and the product of the initial adjustment step size in the initial adjustment information and this ratio is determined as the target adjustment information.
[0082] In this embodiment, the time sum of the processing time of the first IO request and the processing time of the second IO request is calculated, so as to further determine the target adjustment information of the read / write resources of the disk based on the processing time of the first IO request and the time sum. Determining the target adjustment information according to the processing time of various IO requests makes the determined target adjustment information more matching the processing requirements of the first IO request and improves the rationality of the target adjustment information.
[0083] In the scenario of determining the initial adjustment information of the read / write resources of the disk according to the processing time of the first IO request and the time sum, the proportion of the processing time of the first IO request can be calculated according to the processing time of the first IO request and the time sum, so as to determine the initial adjustment information of the read / write resources of the disk according to the processing time proportion and a preset proportion threshold. In one embodiment, as Figure 5 shown, the initial adjustment information includes an initial adjustment direction and an initial adjustment step size, and the above S301 includes:
[0084] S401, determine the proportion of the processing time of the first IO request according to the processing time of the first IO request and the time sum.
[0085] The proportion of the processing time of the first IO request is used to represent the proportion of the processing time of the first IO request in the total processing time for the disk to process the first IO request and the second IO request.
[0086] In this embodiment, the ratio of the processing time of the first IO request to the time sum is determined as the proportion of the processing time of the first IO request. Exemplarily, the processing time of the first IO request can be represented as t1, the processing time of the second IO request can be represented as t2, and the time sum can be represented as T sum , the proportion of the processing time can be represented as δ, then T sum =t1 + t2,
[0087] S402, determine the initial adjustment direction according to the proportion of the processing time and a preset proportion threshold.
[0088] As an alternative implementation, the ratio between the time proportion and a preset proportion threshold can be calculated. When the ratio between the time proportion and the preset proportion threshold is greater than or equal to a preset ratio threshold, the adjustment direction is downward; when the ratio between the time proportion and the preset proportion threshold is less than the preset ratio threshold, the adjustment direction is upward.
[0089] Optionally, in this embodiment, if the processing time proportion is greater than the proportion threshold, the initial adjustment direction is determined as the first adjustment direction; if the processing time proportion is less than the proportion threshold, the initial adjustment direction is determined as the second adjustment direction; wherein, the second adjustment direction is opposite to the first adjustment direction. For example, the first adjustment direction can be downward, and the second adjustment direction can be upward. Exemplarily, the proportion threshold can be 0.5. When the processing time proportion is 0.6, the processing time proportion is greater than the proportion threshold, and the initial adjustment direction is determined as the first adjustment direction, that is, the initial adjustment direction is determined as downward.
[0090] S403, determine the ratio between the processing time proportion and the proportion difference as the initial adjustment step of the disk read-write resource; the proportion difference is the difference between the processing time proportion and the proportion threshold.
[0091] In this embodiment, calculate the difference between the processing time proportion and the proportion threshold to obtain the proportion difference, and determine the ratio between the processing time proportion and the proportion difference as the initial adjustment step of the disk read-write resource. Exemplarily, the proportion threshold can be represented as δ max , and the initial adjustment step can be represented as step1, then That is, the step adjustment is performed on the basis of the original processing time proportion.
[0092] In this embodiment, according to the processing time of the first IO request and the time sum, determine the processing time proportion of the first IO request, so as to determine the initial adjustment direction and the initial adjustment step according to the processing time proportion and the proportion threshold, and on the basis of the processing time proportion, adjust the read-write resource proportion of the disk read-write resource based on the initial adjustment direction and the initial adjustment step, making the allocation of the read-write resource more accurate.
[0093] In the scenario of determining the target adjustment information of the disk read-write resource according to the time sum, the cycle value of the preset sampling period, and the initial adjustment information as described above, the disk utilization rate within the preset sampling period can be determined first according to the ratio between the time sum and the cycle value, and then the status information of the disk within the preset sampling period can be determined according to the disk utilization rate, and further, the target adjustment information can be determined according to the status information and the initial adjustment information. In one embodiment, as Figure 6 shown, the above S302 includes:
[0094] S501. Determine the disk utilization rate of the disk within a preset sampling period according to the time and the ratio to the cycle value.
[0095] Among them, the disk utilization rate is used to represent the proportion of the total processing duration of the disk for processing the first IO request and the second IO request within the preset sampling period to the cycle value of the preset sampling period.
[0096] Optionally, in this embodiment, the sum of the processing time of the first IO request and the processing time of the second IO request can be calculated, and the ratio of the sum of the time to the cycle value is determined as the disk utilization rate of the disk within the preset sampling period.
[0097] S502. Determine the status information of the disk within the preset sampling period according to the disk utilization rate.
[0098] In this embodiment, a utilization threshold can be set in advance. If the disk utilization rate is less than the utilization threshold, it is determined that the status information of the disk within the preset sampling period is the idle state; if the disk utilization rate is greater than or equal to the utilization threshold, it is determined that the status information of the disk within the preset sampling period is the running state.
[0099] S503. Determine the target adjustment information according to the status information and the initial adjustment information.
[0100] In this embodiment, the status information of the disk within the preset sampling period includes the running state and the idle state. Optionally, a first adjustment parameter corresponding to the running state and a second adjustment parameter corresponding to the idle state can be set in advance. If the status information is the running state, the product of the first adjustment parameter and the initial adjustment step can be determined as the target adjustment step, and the initial adjustment direction and the target adjustment step are determined as the target adjustment information; if the status information is the idle state, the product of the second adjustment parameter and the initial adjustment step can be determined as the target adjustment step, and the initial adjustment direction and the target adjustment step are determined as the target adjustment information.
[0101] In this embodiment, the status information of the disk within the preset sampling period is determined according to the disk utilization rate, so as to further update the initial adjustment information according to the status information to determine the target adjustment information, making the determined target adjustment information more accurate.
[0102] In the scenario of determining the target adjustment information according to the status information and the initial adjustment information described above, if the status information indicates that the disk is in the running state within the preset sampling period, the initial adjustment information is determined as the target adjustment information. If the status information indicates that the disk is in the idle state within the preset sampling period, the target adjustment information can be determined according to the preset disk utilization rate, cycle value, sum of time, and initial adjustment information. In one embodiment, as Figure 7 shown, the above S503 includes:
[0103] S601. If it is determined that the disk is in an operating state within a preset sampling period based on the disk utilization rate, then determine the initial adjustment direction and the initial adjustment step size as the target adjustment information.
[0104] In this embodiment, if it is determined that the disk is in an operating state within a preset sampling period based on the disk utilization rate, it indicates that the total time for processing the first IO request and the second IO request by the disk within the preset sampling period is relatively long. It is necessary to determine whether it is necessary to adjust the read / write resources of the disk corresponding to the first IO request according to the processing time of the first IO request and the processing time of the second IO request. Therefore, the initial adjustment direction and the initial adjustment step size can be determined as the target adjustment information.
[0105] S602. If it is determined that the disk is in an idle state within a preset sampling period based on the disk utilization rate, then determine the target adjustment information according to the preset disk utilization rate, cycle value, time sum, and initial adjustment information.
[0106] In this embodiment, if it is determined that the disk is in an idle state within a preset sampling period based on the disk utilization rate, it indicates that the total time for processing the IO request by the disk within the preset sampling period is relatively short, that is, the read / write operations performed by the disk on the second IO request input by the user are also relatively few, and there are a large number of idle read / write resources on the disk within the preset sampling period. More disk read / write resources can be allocated to the first IO request. However, since the time ratio of the first IO request within the preset sampling period may be relatively high, the initial adjustment direction and the initial adjustment step size determined according to the time ratio within the preset sampling period may be inaccurate. Therefore, the target adjustment information can be further determined according to the preset disk utilization rate, cycle value, time sum, and initial adjustment information. Exemplarily, the target adjustment direction can be determined according to the disk utilization rate within the sampling period and the preset disk utilization rate. Further, the initial adjustment step size can be updated according to the cycle value and the time sum to determine the target adjustment step size.
[0107] In this embodiment, when the disk is in an operating state within a preset sampling period, the initial adjustment direction and the initial adjustment step size are determined as the target adjustment information. When the disk is in an idle state within a preset sampling period, the target adjustment information is determined according to the preset disk utilization rate, cycle value, time sum, and initial adjustment information. Different operations are performed on the initial adjustment information in different states, so that the determined target adjustment information is more matched with the state information, and the accuracy of the target adjustment information is improved.
[0108] The process of determining the target adjustment information according to the preset disk utilization rate, cycle value, time sum, and initial adjustment information will be elaborated in detail below. In one embodiment, as Figure 8 shown, the above S602 includes:
[0109] S701. Determine a target adjustment step size according to a preset disk utilization rate, cycle value, time sum, and initial adjustment step size.
[0110] In this embodiment, when the disk is in an idle state within a preset sampling period, calculate the target adjustment step size according to the preset disk utilization rate, cycle value, time sum, and initial adjustment step size. Optionally, an update parameter may be determined according to the preset disk utilization rate, cycle value, and time sum, and the product of the update parameter and the initial adjustment step size is determined as the target adjustment step size.
[0111] S702. Determine a target adjustment direction according to the initial adjustment direction.
[0112] In this embodiment, when the disk is in an idle state within a preset sampling period, further determine whether to determine the initial adjustment direction as the target adjustment direction, or determine the adjustment direction opposite to the initial direction as the target adjustment direction.
[0113] As an optional implementation manner, if the initial adjustment direction is the first adjustment direction, then determine the second adjustment direction as the target adjustment direction; if the initial adjustment direction is the second adjustment direction, then determine the initial adjustment direction as the target adjustment direction. The first adjustment direction is downward adjustment, and the second adjustment direction may be upward adjustment. When the disk is in an idle state within a preset sampling period, the read / write resources of the disk idle can be allocated to the read / write resources corresponding to the first IO request. Therefore, determine the target adjustment direction as upward adjustment, that is, if the initial adjustment direction is downward adjustment, then correct the target adjustment direction to upward adjustment; if the initial adjustment direction is upward adjustment, then the initial adjustment direction can be determined as the target adjustment direction.
[0114] In this embodiment, determine the target adjustment step size according to the preset disk utilization rate, cycle value, time sum, and initial adjustment step size. Optimize the initial adjustment step size to determine the target adjustment step size, and optimize the initial adjustment direction to determine the target adjustment direction, so that the determined target adjustment information is more reasonable and accurate.
[0115] The process of determining the target adjustment step size according to the preset disk utilization rate, cycle value, time sum, and initial adjustment step size will be elaborated in detail below. In one embodiment, as Figure 9 shown, the above S701 includes:
[0116] S801. Obtain the utilization time of the disk within a preset sampling period according to the preset disk utilization rate and cycle value.
[0117] Wherein, if the preset disk utilization rate is the maximum preset disk utilization rate, the utilization time is the maximum utilization time of the disk within the preset sampling period calculated according to the preset disk utilization rate and the cycle value.
[0118] In this embodiment, the product of the preset disk utilization rate and the cycle value is determined as the utilization time of the disk within the preset sampling period. Exemplarily, the utilization time can be represented as T.
[0119] S802. Determine the candidate adjustment step size of the disk read-write resources by the ratio of the time difference to the time sum; wherein, the time difference is the difference between the utilization time and the time sum.
[0120] In this embodiment, calculate the difference between the utilization time and the time sum to obtain the time difference. Further, determine the ratio of the time difference to the time sum as the candidate adjustment step size of the read-write resources. Wherein, the utilization time is T and the time sum is T sum , the candidate adjustment step size step2, that is
[0121] S803. If the candidate adjustment step size is greater than the initial adjustment step size, determine the candidate adjustment step size as the target adjustment step size; if the candidate adjustment step size is less than or equal to the initial adjustment step size, determine the initial adjustment step size as the target adjustment step size.
[0122] In this embodiment, when the disk is in the idle state, the calculated candidate adjustment step size is the minimum upward adjustment step size, that is, the target adjustment step size is greater than or equal to the candidate adjustment step size. Thus, the target adjustment step size can be determined by comparing the sizes of the candidate adjustment step size and the initial adjustment step size. When the candidate adjustment step size is greater than the initial adjustment step size, determine the candidate adjustment step size as the target adjustment step size; when the candidate adjustment step size is less than or equal to the initial adjustment step size, determine the initial adjustment step size as the target adjustment step size.
[0123] In this embodiment, determine the candidate adjustment step size through the utilization time and the time sum of the disk within the preset sampling period, and thus determine the target adjustment step size according to the candidate adjustment step size and the initial adjustment step size, so that the target adjustment step size is maximized. Allocate the read-write resources of the disk by using the target adjustment step size, which can maximize the processing efficiency of the first IO request on the premise of ensuring the processing efficiency of the second IO request.
[0124] Next, a specific resource adjustment scenario is used to introduce an embodiment of the present disclosure. The method includes the following steps:
[0125] S1. Determine the processing time ratio of the first I / O request based on the sum of the processing time of the first I / O request and the time; where the sum of the times is the sum of the processing time of the first I / O request and the processing time of the second I / O request; the first I / O request is an I / O request generated by the second server itself, and the second I / O request is an I / O request input by the user received by the second server; the second server is the server in the server cluster used to receive I / O requests input by the user.
[0126] S2. If the processing time ratio is greater than the ratio threshold, determine the initial adjustment direction as the first adjustment direction; if the processing time ratio is less than the ratio threshold, determine the initial adjustment direction as the second adjustment direction; where the second adjustment direction is opposite to the first adjustment direction.
[0127] S3. Determine the ratio between the processing time ratio and the ratio difference as the initial adjustment step of the read / write resources of the disk; the ratio difference is the difference between the processing time ratio and the ratio threshold.
[0128] S4. Determine the disk utilization rate of the disk within the preset sampling period based on the ratio between the sum of the times and the period value.
[0129] S5. Determine the status information of the disk within the preset sampling period based on the disk utilization rate.
[0130] S6. If it is determined that the disk is in the running state within the preset sampling period based on the disk utilization rate, execute step S7; if it is determined that the disk is in the idle state within the preset sampling period based on the disk utilization rate, execute steps S8 - S9.
[0131] S7. Determine the initial adjustment direction and the initial adjustment step as the target adjustment information.
[0132] S8. If the initial adjustment direction is the first adjustment direction, determine the second adjustment direction as the target adjustment direction; if the initial adjustment direction is the second adjustment direction, determine the initial adjustment direction as the target adjustment direction.
[0133] S9. Obtain the utilization time of the disk within the preset sampling period based on the preset disk utilization rate and the period value; determine the ratio of the time difference to the sum of the times as the candidate adjustment step of the read / write resources of the disk; where the time difference is the difference between the utilization time and the sum of the times; if the candidate adjustment step is greater than the initial adjustment step, determine the candidate adjustment step as the target adjustment step, if the candidate adjustment step is less than or equal to the initial adjustment step, determine the initial adjustment step as the target adjustment step.
[0134] S10. Send the target adjustment information of the disk's read / write resources to the second server, so that the second server determines the adjustment information of the token resources corresponding to the third IO request based on the target adjustment information; the third IO request is an IO request generated by the second server itself.
[0135] In the above resource adjustment method, the first server receives the first IO request input by the user and the second IO request generated by the second server sent by the second server. The first server determines the target adjustment information of the disk's read / write resources according to the processing time of the first IO request and the processing time of the second IO request received by the disk within a preset sampling period, and sends the target adjustment information of the disk's read / write resources to the second server, so that the second server determines the adjustment information of the token resources corresponding to the third IO request according to the target adjustment information. Compared with the prior art in which the token resources are adjusted by a fixed ratio allocation method, the adjustment information of the token resources is calculated periodically, which is more matched with the processing capacity of the storage system for IO requests, thereby improving the rationality of adjusting the token resources. The target adjustment information of the disk's read / write resources determined according to the processing time of the first IO request and the processing time of the second IO request received by the disk within a preset sampling period fully considers the processing capacity of the disk, making the target adjustment information of the disk's read / write resources highly accurate. Further, the adjustment information of the token resources corresponding to the third IO request determined through the target adjustment information of the disk's read / write resources is also more accurate.
[0136] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.
[0137] Based on the same inventive concept, an embodiment of the present application also provides a resource adjustment device for implementing the above-mentioned resource adjustment method. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the resource adjustment device provided below can refer to the limitations on the resource adjustment method in the above text, and will not be repeated here.
[0138] In one embodiment, as Figure 10As shown in the figure, a resource adjustment device is provided, including: a determination module 10 and a sending module 11, where:
[0139] The determination module 10 is configured to determine the target adjustment information of the disk read / write resources according to the processing time of the first IO requests received by the disk of the first server within a preset sampling period and the processing time of the second IO requests; the first IO requests are the IO requests generated by the second server itself, and the second IO requests are the IO requests input by the user received by the second server; the second server is the server in the server cluster for receiving the IO requests input by the user.
[0140] The sending module 11 is configured to send the target adjustment information of the disk read / write resources to the second server, so that the second server determines the adjustment information of the token resources corresponding to the third IO requests based on the target adjustment information; the third IO requests are the IO requests generated by the second server itself.
[0141] The resource adjustment device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.
[0142] In one embodiment, as Figure 11 shown in the figure, the above determination module 10 includes: a first determination unit 101 and a second determination unit 102, where:
[0143] The first determination unit 101 is configured to determine the initial adjustment information of the disk read / write resources according to the sum of the processing time of the first IO requests; where the sum of time is the sum of the processing time of the first IO requests and the processing time of the second IO requests.
[0144] The second determination unit 102 is configured to determine the target adjustment information of the disk read / write resources according to the sum of time, the cycle value of the preset sampling period, and the initial adjustment information.
[0145] The resource adjustment device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.
[0146] In one embodiment, the first determination unit 101 is configured to determine the proportion of the processing time of the first IO requests according to the sum of the processing time of the first IO requests; determine the initial adjustment direction according to the proportion of the processing time and the preset proportion threshold; determine the ratio between the proportion of the processing time and the difference in proportion as the initial adjustment step of the disk read / write resources; the difference in proportion is the difference between the proportion of the processing time and the proportion threshold.
[0147] The resource adjustment device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.
[0148] In one embodiment, the above-mentioned first determination unit 101 is configured to determine that the initial adjustment direction is the first adjustment direction if the processing time ratio is greater than the ratio threshold; and determine that the initial adjustment direction is the second adjustment direction if the processing time ratio is less than the ratio threshold; wherein, the second adjustment direction is opposite to the first adjustment direction.
[0149] The resource adjustment device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0150] In one embodiment, the above-mentioned first determination unit 101 is configured to determine the disk utilization rate of the disk within a preset sampling period according to the ratio between the time and the cycle value; determine the status information of the disk within the preset sampling period according to the disk utilization rate; and determine the target adjustment information according to the status information and the initial adjustment information.
[0151] The resource adjustment device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0152] In one embodiment, the above-mentioned first determination unit 101 is configured to determine the initial adjustment direction and the initial adjustment step length as the target adjustment information if it is determined that the disk is in the running state within the preset sampling period according to the disk utilization rate; and determine the target adjustment information according to the preset disk utilization rate, cycle value, time sum, and initial adjustment information if it is determined that the disk is in the idle state within the preset sampling period according to the disk utilization rate.
[0153] The resource adjustment device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0154] In one embodiment, the above-mentioned first determination unit 101 is configured to determine the target adjustment step length according to the preset disk utilization rate, cycle value, time sum, and initial adjustment step length; and determine the target adjustment direction according to the initial adjustment direction.
[0155] The resource adjustment device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0156] In one embodiment, the above-mentioned first determination unit 101 is configured to determine the second adjustment direction as the target adjustment direction if the initial adjustment direction is the first adjustment direction; and determine the initial adjustment direction as the target adjustment direction if the initial adjustment direction is the second adjustment direction.
[0157] The resource adjustment device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0158] In one embodiment, the above-mentioned first determination unit 101 is configured to obtain the utilization time of the disk within a preset sampling period according to a preset disk utilization rate and a cycle value; determine a candidate adjustment step size for the read / write resources of the disk by taking the ratio of the time difference to the time sum; where the time difference is the difference between the utilization time and the time sum; if the candidate adjustment step size is greater than the initial adjustment step size, then determine the candidate adjustment step size as the target adjustment step size, and if the candidate adjustment step size is less than or equal to the initial adjustment step size, then determine the initial adjustment step size as the target adjustment step size.
[0159] The resource adjustment device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.
[0160] Each module in the above resource adjustment device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0161] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 12 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store resource adjustment data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a resource adjustment method.
[0162] Those skilled in the art can understand that Figure 12 the structure shown in
[0163] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0164] Determine target adjustment information for the read / write resources of the disk according to the processing time of the first IO request received by the disk of the first server within a preset sampling period and the processing time of the second IO request; the first IO request is an IO request generated by the second server itself, and the second IO request is an IO request input by the user received by the second server; the second server is a server in the server cluster for receiving IO requests input by the user.
[0165] Send the target adjustment information for the read / write resources of the disk to the second server, so that the second server determines adjustment information for the token resources corresponding to the third IO request based on the target adjustment information; the third IO request is an IO request generated by the second server itself.
[0166] In an embodiment, when the processor executes the computer program, the following steps are further implemented:
[0167] Determine initial adjustment information for the read / write resources of the disk according to the processing time of the first IO request and the time sum; wherein, the time sum is the sum of the processing time of the first IO request and the processing time of the second IO request.
[0168] Determine the target adjustment information for the read / write resources of the disk according to the time sum, the period value of the preset sampling period, and the initial adjustment information.
[0169] In an embodiment, when the processor executes the computer program, the following steps are further implemented:
[0170] Determine the proportion of the processing time of the first IO request according to the processing time of the first IO request and the time sum.
[0171] Determine the initial adjustment direction according to the proportion of the processing time and a preset proportion threshold.
[0172] Determine the ratio between the proportion of the processing time and the proportion difference as the initial adjustment step of the read / write resources of the disk; the proportion difference is the difference between the proportion of the processing time and the proportion threshold.
[0173] In an embodiment, when the processor executes the computer program, the following steps are further implemented:
[0174] If the proportion of the processing time is greater than the proportion threshold, determine the initial adjustment direction as the first adjustment direction.
[0175] If the proportion of the processing time is less than the proportion threshold, determine the initial adjustment direction as the second adjustment direction; wherein, the second adjustment direction is opposite to the first adjustment direction.
[0176] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0177] Determine the disk utilization rate of the disk within a preset sampling period according to the ratio between the time and the cycle value;
[0178] Determine the status information of the disk within a preset sampling period according to the disk utilization rate;
[0179] Determine the target adjustment information according to the status information and the initial adjustment information.
[0180] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0181] If it is determined that the disk is in the running state within a preset sampling period according to the disk utilization rate, then determine the initial adjustment direction and the initial adjustment step size as the target adjustment information;
[0182] If it is determined that the disk is in the idle state within a preset sampling period according to the disk utilization rate, then determine the target adjustment information according to the preset disk utilization rate, cycle value, time sum, and initial adjustment information.
[0183] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0184] Determine the target adjustment step size according to the preset disk utilization rate, cycle value, time sum, and initial adjustment step size;
[0185] Determine the target adjustment direction according to the initial adjustment direction.
[0186] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0187] If the initial adjustment direction is the first adjustment direction, then determine the second adjustment direction as the target adjustment direction;
[0188] If the initial adjustment direction is the second adjustment direction, then determine the initial adjustment direction as the target adjustment direction.
[0189] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0190] Obtain the utilization time of the disk within a preset sampling period according to the preset disk utilization rate and cycle value;
[0191] Determine the candidate adjustment step size of the read / write resources of the disk according to the ratio of the time difference to the time sum; wherein, the time difference is the difference between the utilization time and the time sum;
[0192] If the candidate adjustment step size is greater than the initial adjustment step size, then determine the candidate adjustment step size as the target adjustment step size; if the candidate adjustment step size is less than or equal to the initial adjustment step size, then determine the initial adjustment step size as the target adjustment step size.
[0193] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0194] Determine target adjustment information for the read / write resources of the disk according to the processing time of the first IO request received by the disk of the first server within a preset sampling period and the processing time of the second IO request; the first IO request is an IO request generated by the second server itself, and the second IO request is an IO request input by the user received by the second server; the second server is the server in the server cluster for receiving IO requests input by the user.
[0195] Send the target adjustment information for the read / write resources of the disk to the second server, so that the second server determines adjustment information for the token resources corresponding to the third IO request based on the target adjustment information; the third IO request is an IO request generated by the second server itself.
[0196] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0197] Determine initial adjustment information for the read / write resources of the disk according to the processing time of the first IO request and the time sum; wherein, the time sum is the sum of the processing time of the first IO request and the processing time of the second IO request.
[0198] Determine target adjustment information for the read / write resources of the disk according to the time sum, the period value of the preset sampling period, and the initial adjustment information.
[0199] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0200] Determine the proportion of the processing time of the first IO request according to the processing time of the first IO request and the time sum;
[0201] Determine the initial adjustment direction according to the proportion of the processing time and a preset proportion threshold;
[0202] Determine the ratio between the proportion of the processing time and the difference in proportion as the initial adjustment step size for the read / write resources of the disk; the difference in proportion is the difference between the proportion of the processing time and the proportion threshold.
[0203] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0204] If the proportion of processing time is greater than the proportion threshold, determine the initial adjustment direction as the first adjustment direction;
[0205] If the proportion of processing time is less than the proportion threshold, determine the initial adjustment direction as the second adjustment direction; wherein, the second adjustment direction is opposite to the first adjustment direction.
[0206] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0207] Determine the disk utilization rate of the disk within a preset sampling period according to the ratio between the time and the cycle value;
[0208] Determine the status information of the disk within a preset sampling period according to the disk utilization rate;
[0209] Determine the target adjustment information according to the status information and the initial adjustment information.
[0210] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0211] If it is determined that the disk is in the running state within a preset sampling period according to the disk utilization rate, determine the initial adjustment direction and the initial adjustment step size as the target adjustment information;
[0212] If it is determined that the disk is in the idle state within a preset sampling period according to the disk utilization rate, determine the target adjustment information according to the preset disk utilization rate, cycle value, time sum, and initial adjustment information.
[0213] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0214] Determine the target adjustment step size according to the preset disk utilization rate, cycle value, time sum, and initial adjustment step size;
[0215] Determine the target adjustment direction according to the initial adjustment direction.
[0216] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0217] If the initial adjustment direction is the first adjustment direction, determine the second adjustment direction as the target adjustment direction;
[0218] If the initial adjustment direction is the second adjustment direction, determine the initial adjustment direction as the target adjustment direction.
[0219] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0220] Obtain the utilization time of the disk within a preset sampling period according to the preset disk utilization rate and cycle value;
[0221] Determine the candidate adjustment step of the disk's read / write resources based on the ratio of the time difference to the sum of times; where the time difference is the difference between the utilization time and the sum of times.
[0222] If the candidate adjustment step is greater than the initial adjustment step, determine the candidate adjustment step as the target adjustment step; if the candidate adjustment step is less than or equal to the initial adjustment step, determine the initial adjustment step as the target adjustment step.
[0223] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the following steps:
[0224] Determine the target adjustment information of the disk's read / write resources based on the processing time of the first IO request and the second IO request received by the disk of the first server within a preset sampling period; the first IO request is an IO request generated by the second server itself, and the second IO request is an IO request input by the user received by the second server; the second server is the server in the server cluster for receiving IO requests input by the user.
[0225] Send the target adjustment information of the disk's read / write resources to the second server, so that the second server determines the adjustment information of the token resources corresponding to the third IO request based on the target adjustment information; the third IO request is an IO request generated by the second server itself.
[0226] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented:
[0227] Determine the initial adjustment information of the disk's read / write resources based on the processing time of the first IO request and the sum of times; where the sum of times is the sum of the processing time of the first IO request and the processing time of the second IO request.
[0228] Determine the target adjustment information of the disk's read / write resources based on the sum of times, the cycle value of the preset sampling period, and the initial adjustment information.
[0229] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented:
[0230] Determine the proportion of the processing time of the first IO request based on the processing time of the first IO request and the sum of times.
[0231] Determine the initial adjustment direction based on the proportion of the processing time and a preset proportion threshold.
[0232] Determine the ratio between the proportion of the processing time and the difference in proportions as the initial adjustment step of the disk's read / write resources; the difference in proportions is the difference between the proportion of the processing time and the proportion threshold.
[0233] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0234] If the proportion of processing time is greater than the proportion threshold, determine that the initial adjustment direction is the first adjustment direction;
[0235] If the proportion of processing time is less than the proportion threshold, determine that the initial adjustment direction is the second adjustment direction; wherein, the second adjustment direction is opposite to the first adjustment direction.
[0236] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0237] Determine the disk utilization rate of the disk within a preset sampling period according to the ratio between the time and the cycle value;
[0238] Determine the status information of the disk within a preset sampling period according to the disk utilization rate;
[0239] Determine the target adjustment information according to the status information and the initial adjustment information.
[0240] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0241] If it is determined that the disk is in the running state within a preset sampling period according to the disk utilization rate, determine the initial adjustment direction and the initial adjustment step length as the target adjustment information;
[0242] If it is determined that the disk is in the idle state within a preset sampling period according to the disk utilization rate, determine the target adjustment information according to the preset disk utilization rate, cycle value, time sum, and initial adjustment information.
[0243] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0244] Determine the target adjustment step length according to the preset disk utilization rate, cycle value, time sum, and initial adjustment step length;
[0245] Determine the target adjustment direction according to the initial adjustment direction.
[0246] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0247] If the initial adjustment direction is the first adjustment direction, determine the second adjustment direction as the target adjustment direction;
[0248] If the initial adjustment direction is the second adjustment direction, determine the initial adjustment direction as the target adjustment direction.
[0249] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0250] Obtain the utilization time of the disk within a preset sampling period according to the preset disk utilization rate and cycle value;
[0251] Determine the candidate adjustment step size of the disk read-write resource based on the ratio of the time difference to the time sum; where the time difference is the difference between the utilization time and the time sum;
[0252] If the candidate adjustment step size is greater than the initial adjustment step size, determine the candidate adjustment step size as the target adjustment step size; if the candidate adjustment step size is less than or equal to the initial adjustment step size, determine the initial adjustment step size as the target adjustment step size.
[0253] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0254] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0255] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the patent of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A resource adjustment method, characterized in that, The method is applied to a first server in a server cluster for processing IO requests, and the method includes: Determining target adjustment information for the read / write resources of the disk according to the processing time of a first IO request and the processing time of a second IO request received by the disk of the first server within a preset sampling period; the first IO request is an IO request generated by a second server itself, and the second IO request is an IO request input by a user received by the second server; the second server is a server in the server cluster for receiving IO requests input by users. Sending the target adjustment information for the read / write resources of the disk to the second server, so that the second server determines adjustment information for token resources corresponding to a third IO request based on the target adjustment information; the third IO request is an IO request generated by the second server itself.
2. The method according to claim 1, wherein The determining the target adjustment information for the read / write resources of the disk according to the processing time of the first IO request and the processing time of the second IO request received by the disk of the first server within a preset sampling period includes: Determining initial adjustment information for the read / write resources of the disk according to the sum of the processing time of the first IO request; wherein, the sum of time is the sum of the processing time of the first IO request and the processing time of the second IO request. Determining the target adjustment information for the read / write resources of the disk according to the sum of time, the period value of the preset sampling period, and the initial adjustment information.
3. The method according to claim 2, wherein The initial adjustment information includes an initial adjustment direction and an initial adjustment step size; the determining the initial adjustment information for the read / write resources of the disk according to the processing time of the first IO request and the sum of time includes: Determining the proportion of the processing time of the first IO request according to the processing time of the first IO request and the sum of time. Determining the initial adjustment direction according to the proportion of the processing time and a preset proportion threshold. Determining the ratio between the proportion of the processing time and the difference in proportion as the initial adjustment step size for the read / write resources of the disk; the difference in proportion is the difference between the proportion of the processing time and the proportion threshold.
4. The method according to claim 3, wherein The determining the initial adjustment direction according to the proportion of the processing time and a preset proportion threshold includes: If the proportion of the processing time is greater than the proportion threshold, determining the initial adjustment direction as a first adjustment direction. If the proportion of the processing time is less than the proportion threshold, determining the initial adjustment direction as a second adjustment direction; wherein, the second adjustment direction is opposite to the first adjustment direction.
5. The method according to claim 4, wherein The determining the target adjustment information for the read / write resources of the disk according to the sum of time, the period value of the preset sampling period, and the initial adjustment information includes: Determining the disk utilization rate of the disk within the preset sampling period according to the ratio between the sum of time and the period value. Determining the status information of the disk within the preset sampling period according to the disk utilization rate. Determining the target adjustment information according to the status information and the initial adjustment information.
6. The method according to claim 5, wherein Determining the target adjustment information according to the state information and the initial adjustment information includes: If it is determined according to the disk utilization rate that the disk is in an operating state within the preset sampling period, then determine the initial adjustment direction and the initial adjustment step size as the target adjustment information; If it is determined according to the disk utilization rate that the disk is in an idle state within the preset sampling period, then determine the target adjustment information according to the preset disk utilization rate, the period value, the time, and the initial adjustment information.
7. The method according to claim 6, characterized in that, Determining the target adjustment information according to the preset disk utilization rate, the period value, the time, and the initial adjustment information includes: Determine a target adjustment step size according to the preset disk utilization rate, the period value, the time, and the initial adjustment step size; Determine a target adjustment direction according to the initial adjustment direction.
8. The method according to claim 7, characterized in that, Determining the target adjustment direction according to the initial adjustment direction includes: If the initial adjustment direction is the first adjustment direction, then determine the second adjustment direction as the target adjustment direction; If the initial adjustment direction is the second adjustment direction, then determine the initial adjustment direction as the target adjustment direction.
9. The method according to claim 7 or 8, characterized in that, Determining the target adjustment step size according to the preset disk rate and the initial adjustment step size includes: Obtain the utilization time of the disk within the preset sampling period according to the preset disk utilization rate and the period value; Determine a candidate adjustment step size for the read / write resources of the disk as the ratio of the time difference to the sum of the times; wherein the time difference is the difference between the utilization time and the sum of the times; If the candidate adjustment step size is greater than the initial adjustment step size, then determine the candidate adjustment step size as the target adjustment step size; if the candidate adjustment step size is less than or equal to the initial adjustment step size, then determine the initial adjustment step size as the target adjustment step size.
10. A resource adjustment device, characterized in that, The apparatus includes: A determination module, configured to determine target adjustment information for the read / write resources of the disk according to the processing time of the first IO request and the processing time of the second IO request received by the disk of the first server within a preset sampling period; the first IO request is an IO request generated by the second server itself, and the second IO request is an IO request input by the user received by the second server; the second server is a server in the server cluster for receiving IO requests input by the user; A sending module, configured to send the target adjustment information for the read / write resources of the disk to the second server, so that the second server determines adjustment information for the token resources corresponding to the third IO request based on the target adjustment information; the third IO request is an IO request generated by the second server itself.
11. A server, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 9 are implemented.
