Resource dynamic scheduling method and electronic equipment
By dynamically scheduling load assessment metrics at the tenant instance and node levels, creating replica instances solves the problem of resource utilization and load balancing in large-scale container clusters, improving overall resource utilization and network stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MACROSAN TECH
- Filing Date
- 2025-12-04
- Publication Date
- 2026-04-10
AI Technical Summary
In large-scale container cluster environments, improving the efficient utilization of resources and load balancing has become an urgent technical problem to be solved.
By statistically analyzing load assessment metrics at the tenant instance and node levels, tenant instances are dynamically scheduled to target NAS nodes, and replica instances are created to handle IO requests, thus achieving load balancing.
It improved overall resource utilization, reduced uneven load, increased the efficiency of IO request processing, and enhanced the high availability and stability of network scenarios.
Smart Images

Figure CN121833236A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, in particular to a resource dynamic scheduling method and an electronic device. BACKGROUND
[0002] As a lightweight virtualization solution, container technology has been widely used in cloud native application scenarios in enterprises due to its advantages of fast start and stop, efficient resource utilization, and flexible deployment. Container technology can refer to encapsulating resources such as service programs, dependent libraries, and configuration files of a tenant into a container (also referred to as a tenant instance) to provide an isolated service running environment for the tenant to process input / output (IO) requests issued by at least one client interfaced by the tenant. The container can be independently started and run on a node.
[0003] Currently, in actual applications, as the demand for cloud native applications continues to grow, the scale and complexity of container clusters are also increasing. Therefore, in a large-scale container cluster environment, how to improve the efficient utilization and load balancing of overall resources has become a technical problem that needs to be solved. SUMMARY
[0004] Therefore, the present application provides a resource dynamic scheduling method and an electronic device to improve the efficient utilization and load balancing of resources.
[0005] The present application provides a resource dynamic scheduling method. The method is applied to any Network Attached Storage (NAS) node in a network scenario containing at least two NAS nodes, and each NAS node in the network scenario shares tenant instances with each other. The method comprises the following steps: statistically determining a tenant load evaluation index corresponding to each tenant instance on the node in the dimension of tenant instance; the tenant load evaluation index corresponding to any tenant instance is determined based on a load parameter of the tenant instance; statistically determining a node load evaluation index corresponding to the node in the dimension of node; the node load evaluation index corresponding to the node is determined based on the number of tenant instances on the node and the current resource occupation of the node; For any tenant instance, when it is determined to expand the instance based on the tenant load evaluation index corresponding to the tenant instance, a target NAS node is found from other NAS nodes in the network scenario except the node based on the node load evaluation index corresponding to the other NAS nodes, and a replica instance of the tenant instance is created on the target NAS node, so that the tenant instance and the replica instance of the tenant instance process IO requests issued by each client interfaced by the tenant instance according to the principle of load balancing.
[0006] This application embodiment also provides a resource dynamic scheduling device, which is applied to any NAS node in a network scenario containing at least two NAS nodes, wherein the NAS nodes in the network scenario share tenant instances with each other; the device includes: The statistics module is used to calculate the tenant load assessment metrics for each tenant instance on this node at the tenant instance level; the tenant load assessment metrics for any tenant instance are determined based on the load parameters of that tenant instance. At the node level, the node load assessment metrics corresponding to this node are calculated; the node load assessment metrics corresponding to this node are determined based on the number of tenant instances on this node and the current resource usage of this node; The extension module is used to, for any tenant instance, when it is determined to extend the tenant instance based on the tenant load assessment index corresponding to the tenant instance, find a target NAS node from the other NAS nodes in the network scenario based on the node load assessment index corresponding to the other NAS nodes besides the current node, and create a replica instance of the tenant instance on the target NAS node, so that the tenant instance and the replica instance of the tenant instance can handle the IO requests issued by each client connected to the tenant instance according to the principle of load balancing.
[0007] This application also provides an electronic device, which includes: Processor; and A computer-readable storage medium storing computer program instructions that, when executed by a processor, cause the processor to perform the steps of the method described above.
[0008] This application also provides a computer-readable storage medium storing computer program instructions that, when executed by a processor, cause the processor to perform the steps in the above method.
[0009] As can be seen from the above technical solutions, in network scenarios containing at least two NAS nodes, by statistically analyzing the tenant load assessment metrics corresponding to each tenant instance on the current node at the tenant instance level, and the node load assessment metrics corresponding to the current node at the node level, when determining to expand a tenant instance based on the tenant load assessment metrics corresponding to each tenant instance on the current node, a target NAS node is determined based on the node load assessment metrics corresponding to other NAS nodes. A replica instance of the tenant instance is then created on the target NAS node, so that the tenant instance and its replica instance handle the IO requests issued by each client connected to the tenant instance according to the principle of load balancing. By introducing resource-related load assessment metrics at the tenant instance and node levels for dynamic scheduling of tenant instances on NAS nodes, such as creating replica instances on the target NAS node, the overall resource utilization of this network scenario can be effectively improved, reducing the problem of uneven load among NAS nodes, improving the processing efficiency of IO requests, thereby achieving efficient utilization and load balancing of overall resources, and enhancing the high availability and stability of this network scenario. Attached Figure Description
[0010] The accompanying drawings, which are incorporated in and form part of this application, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0011] Figure 1 This is a schematic diagram of the method flow provided in the embodiments of this application.
[0012] Figure 2 This is a schematic diagram of another method flow provided for an embodiment of this application.
[0013] Figure 3 This is a schematic diagram illustrating the implementation of the NAS dual-active architecture provided in this application embodiment.
[0014] Figure 4 This is a schematic diagram of the device structure provided in the embodiments of this application.
[0015] Figure 5 A schematic diagram of the electronic device structure is provided for the embodiments of this application. Detailed Implementation
[0016] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0017] See Figure 1 , Figure 1This is a flowchart illustrating a method provided in an embodiment of this application. In this embodiment, as one example, the method is applied to any NAS node in a network scenario containing at least two NAS nodes, where each NAS node in the network scenario shares the tenant instance load. At least one tenant instance is deployed on any NAS node in the network scenario, and each tenant instance is used to handle IO requests issued by at least one client connected to that tenant instance. Here, a NAS node can refer to a dedicated data storage server, which can be used to provide centralized, shareable storage services for tenant instances.
[0018] like Figure 1 As shown, the process may include the following steps: Step 101: Calculate the tenant load assessment metrics for each tenant instance on this node at the tenant instance level; the tenant load assessment metrics for any tenant instance are determined based on the load parameters of that tenant instance.
[0019] In this embodiment, as one example, the load parameters of any tenant instance can be statistically analyzed periodically (e.g., every 30 seconds or 1 minute) to determine the tenant load evaluation metric corresponding to that tenant instance. Optionally, the load parameters of any tenant instance in any statistical period include at least: the memory utilization, IO load, and IO latency of the tenant instance in that statistical period.
[0020] The memory utilization rate of the tenant instance within the statistical period can refer to the ratio of the memory used by the tenant instance at the start or end of the statistical period to the total memory of the node. The IO load of the tenant instance within the statistical period can refer to the IOPS of the tenant instance within the statistical period; IOPS stands for Input / Output Operations Per Second, which is the number of IO requests processed by the tenant instance within the statistical period. The IO latency (also known as IO response time) of the tenant instance within the statistical period can refer to the average IO latency corresponding to the IO requests processed by the tenant instance within the statistical period.
[0021] Based on this, as an example, the tenant load assessment index corresponding to any tenant instance in this step can be determined by the following steps: first, obtain the load parameters of the tenant instance in the current statistical period, which include at least: memory utilization, IO load, and IO latency; then, weight the load parameters of the tenant instance in the current statistical period to obtain the tenant load assessment index corresponding to the tenant instance; wherein, the weights of different load parameters can be the same or different.
[0022] Optionally, in this embodiment, the weights of the load parameters can be preset fixed values or dynamically updated. Specifically, when the load parameter weights are dynamically updated, initially, the load parameter weights are preset based on actual application requirements.
[0023] Based on this, for example, when the weights of the load parameters are dynamically updated, regarding the weight of memory utilization, if it is found that the memory utilization of the tenant instance is consistently greater than a first utilization threshold at any collection time within the current statistical period, then the current weight of the load parameter (i.e., the weight determined in the previous statistical period) is increased by a first set value (such as 0.1 or 0.2); if it is found that the memory utilization of the tenant instance is consistently less than a second utilization threshold at any collection time within the current statistical period, then the current weight of the load parameter is decreased by a first set value; otherwise, the current weight of the load parameter remains unchanged. The first utilization threshold is greater than the second utilization threshold.
[0024] Similar to the dynamic update of memory usage weights, for IO load weights, if the IO load of a tenant instance is consistently greater than the first load threshold at any given time during the current statistical period, the current weight of the IO load is increased by a second set value (e.g., 0.1 or 0.2); if the IO load of a tenant instance is consistently less than the second load threshold at any given time during the current statistical period, the current weight of the IO load is decreased by the second set value; otherwise, the current weight of the IO load remains unchanged. The first load threshold is greater than the second load threshold.
[0025] Similarly, regarding the weight of IO latency, if it is found that the IO latency of the tenant instance is consistently greater than the first latency threshold at any collection time within the current statistical period, the current weight of IO latency is increased by a third set value (such as 0.1 or 0.2); if it is found that the IO latency of the tenant instance is consistently less than the second latency threshold at any collection time within the current statistical period, the current weight of IO latency is decreased by the third set value; otherwise, the current weight of IO latency remains unchanged. The first latency threshold is greater than the second latency threshold.
[0026] In this embodiment, the weights of memory utilization, IO load, and IO latency are dynamically adjusted based on real-time data collected within the current statistical period, such as memory utilization, IO load, and IO latency. This effectively improves the calculation accuracy of tenant load assessment indicators, thereby enhancing the reliability of dynamic scheduling of tenant instance resources.
[0027] It should be noted that the first utilization threshold, the second utilization threshold, the first load threshold, the second load threshold, the first latency threshold, and the second latency threshold mentioned above can all be flexibly set based on actual application requirements, and this embodiment does not specifically limit them.
[0028] Step 102: Calculate the node load assessment metrics corresponding to this node at the node level; the node load assessment metrics corresponding to this node are determined based on the number of tenant instances on this node and the current resource usage of this node.
[0029] Based on the above description, in this embodiment, as an example, the node load assessment index corresponding to this node can be determined through the following steps: First, based on the memory usage, IO load, and IO latency of each tenant instance on this node in the current statistical period, determine the current resource occupancy of this node; then, weight the number of tenant instances on this node and the current resource occupancy of this node to obtain the node load assessment index corresponding to this node; wherein, the weight of the number of tenant instances on this node and the weight of the current resource occupancy of this node can be the same or different.
[0030] Optionally, in this embodiment, the determination of the current resource usage of this node based on the memory usage, IO load, and IO latency of each tenant instance on this node within the current statistical period can be implemented in the same way as determining the tenant load assessment index corresponding to any tenant instance. This involves determining the tenant load assessment index corresponding to each tenant instance based on the memory usage, IO load, and IO latency of each tenant instance on this node within the current statistical period, and then determining the current resource usage of this node based on the tenant load assessment index corresponding to each tenant instance. The specific method for determining the current resource usage of this node based on the tenant load assessment index corresponding to each tenant instance will be described with examples below and will not be elaborated here.
[0031] Optionally, in this embodiment, the weights of the number of tenant instances on this node and the weights of the current resource occupancy of this node can be preset fixed values or dynamically updated. Wherein, if the weights are dynamically updated, initially, the weights of the number of tenant instances on this node and the weights of the current resource occupancy of this node are preset weights based on actual application requirements.
[0032] Based on this, for example, when the weights are dynamically updated, regarding the weight of the number of tenant instances on this node, if the number of tenant instances on this node is consistently within the set range during the current statistical period, it indicates that the number of tenant instances on this node is relatively balanced in the entire network environment, and the current weight of the number of tenant instances on this node can remain unchanged; if the number of tenant instances on this node is less than the lower limit of the set range during the current statistical period, the current weight of the number of tenant instances on this node is reduced by a fourth set value (such as 0.1 or 0.2, etc.); if the number of tenant instances on this node is greater than the upper limit of the set range during the current statistical period, the current weight of the number of tenant instances on this node is increased by a fourth set value.
[0033] As for the current weight of the current resource occupancy of this node, it can be determined based on the current weight of the number of tenant instances on this node as determined above. For example, the difference between the preset weight value such as 1 and the current weight of the number of tenant instances on this node as determined above can be determined as the current weight of the current resource occupancy of this node.
[0034] In this embodiment, by dynamically adjusting the weights corresponding to the number of tenant instances on the node and the current resource occupancy of the node, the calculation accuracy of the node load assessment index can be effectively improved, thereby enhancing the reliability of dynamic scheduling of tenant instance resources.
[0035] Step 103: For any tenant instance, when it is determined to expand the instance based on the tenant load assessment index corresponding to the tenant instance, a target NAS node is found from the other NAS nodes based on the node load assessment index corresponding to the other NAS nodes in the network scenario, and a replica instance of the tenant instance is created on the target NAS node so that the tenant instance and the replica instance of the tenant instance can handle the IO requests issued by each client connected to the tenant instance according to the principle of load balancing.
[0036] In this embodiment, the above-mentioned determination to expand the tenant instance based on the tenant load assessment index corresponding to the tenant instance can be implemented in many ways: For example, as an implementation, when the tenant load assessment metric corresponding to the tenant instance reaches a first metric threshold, it is determined to extend the tenant instance. Optionally, the first metric threshold can be flexibly set based on actual application needs, such as 85% or 90%.
[0037] For example, as another embodiment, if it is found that the memory usage of the tenant instance reaches a set usage threshold in the current statistical period, and / or, the IO load of the tenant instance reaches a set load threshold in the current statistical period, and / or, the IO latency of the tenant instance reaches a set latency threshold in the current statistical period, then it is determined to expand the tenant instance. Optionally, the set usage threshold, set load threshold, and set latency threshold can be flexibly set based on actual application needs, and this embodiment is not specifically limited.
[0038] In this embodiment, as an example, this step involves finding a target NAS node based on the node load assessment metrics of other NAS nodes besides this node in the network scenario. In specific implementation, for example, it can be: first, find the NAS node with the smallest node load assessment metrics from the other NAS nodes; then, when the number of found NAS nodes is 1, the found NAS node can be directly used as the target NAS node; when the number of found NAS nodes is greater than 1, the NAS node with the smallest number of tenant instances can be selected from the found NAS nodes as the target NAS node.
[0039] In this embodiment, as one example, the above-mentioned method of enabling the tenant instance and its replica instances to handle the IO requests issued by each client connected to the tenant instance according to the principle of load balancing can be implemented as follows: the client establishes a connection with the corresponding tenant instance through a shared protocol such as the Network File System (NFS) protocol, and uses the domain name corresponding to the tenant instance, such as www.zuhu1.com, to establish a connection; for each tenant instance created on the NAS node, an Internet Protocol (IP) address is generated for the tenant instance to be associated with the above domain name. If a replica instance of the tenant instance is subsequently created, a replica IP address is generated for the replica instance to be associated with the above domain name. In this way, the domain name corresponding to the tenant instance will correspond to two IP addresses. Based on this, when a client needs to send an IO request to the tenant instance, it accesses the domain name corresponding to the tenant instance. When accessing the domain name, it randomly connects to one of the IP addresses associated with that domain name. The IO request is then handled by the tenant instance or its replica instance corresponding to the connected IP address. In this way, the tenant instance and its corresponding replica instance can share the IO requests sent by the client, thereby achieving load balancing. It should be noted that this is only an illustrative example, and this embodiment does not specifically limit how IO requests are handled according to the principle of load balancing.
[0040] This concludes the process. Figure 1The process is shown below.
[0041] pass Figure 1 As shown in the process, in this embodiment of the application, in a network scenario containing at least two NAS nodes, by statistically analyzing the tenant load assessment metrics corresponding to each tenant instance on the current node at the tenant instance level, and the node load assessment metrics corresponding to the current node at the node level, when determining whether to extend a tenant instance based on the tenant load assessment metrics corresponding to each tenant instance on the current node, a target NAS node is determined based on the node load assessment metrics corresponding to other NAS nodes. A replica instance of the tenant instance is then created on the target NAS node, so that the tenant instance and its replica instance handle the IO requests issued by each client connected to the tenant instance according to the principle of load balancing. By introducing resource-related load assessment metrics at the tenant instance and node levels for dynamic scheduling of tenant instances on NAS nodes, such as creating replica instances on the target NAS node, the overall resource utilization of this network scenario can be effectively improved, reducing the problem of uneven load among NAS nodes, improving the processing efficiency of IO requests, thereby achieving efficient utilization and load balancing of overall resources, and enhancing the high availability and stability of this network scenario.
[0042] The following is about the above. Figure 1 The resource dynamic scheduling method shown will be further described below: In this embodiment, as an example, the above-mentioned dynamic resource scheduling method further includes: when determining to migrate an instance of this node based on the node load assessment index corresponding to this node, finding a target NAS node from other NAS nodes based on the node load assessment index corresponding to other NAS nodes in this network scenario, and migrating at least one tenant instance on this node to the target NAS node.
[0043] This embodiment monitors the node load assessment metrics corresponding to the NAS node in real time to dynamically determine and migrate tenant instances of the NAS node to a low-load target NAS node to share the load of the tenant instances of the NAS node. This can effectively improve the load balancing of each NAS node in this network scenario, thereby reducing the problem of reduced IO request processing performance due to NAS node overload.
[0044] Optionally, in this embodiment, the above-mentioned determination to migrate the instance of the node based on the node load assessment index corresponding to the node can be implemented in a specific way, for example, by determining to migrate the instance of the node when the node load assessment index corresponding to the node reaches a second index threshold. Here, the second index threshold can be, for example, 85% or 90%, etc., and this embodiment is not specifically limited.
[0045] Optionally, in this embodiment, the migration of at least one tenant instance on the current node to the target NAS node can be implemented as follows: First, based on the tenant priority and request load of each tenant instance on the current node, the migration priority of that tenant instance is determined; the request load of any tenant instance refers to the total number of IO requests issued by at least one client connected to that tenant instance within the current statistical period; then, the tenant instances on the current node are sorted in descending order of migration priority, so as to migrate at least one tenant instance with the highest ranking in the sorting result to the target NAS node.
[0046] Optionally, the above method of determining the migration priority of a tenant instance based on the tenant priority and request load of each tenant instance on the local node can be implemented in a specific way, for example, by determining the product of the tenant priority and request load of each tenant instance on the local node as the migration priority of that tenant instance.
[0047] The following is a further description of the fault that occurred at this node: In this embodiment, as an example, see [example]. Figure 2 As shown, the above-mentioned dynamic resource scheduling method further includes the following steps: Step 201: If a fault is detected in this node based on the heartbeat detection mechanism, and this node is the master node in this network scenario, then any non-faulty NAS node in this network scenario will be switched to the master node, and the tenant instances on this node will be migrated to one of the non-faulty NAS nodes in this network scenario.
[0048] Optionally, in this embodiment, the specific implementation process of detecting whether a NAS node in the network scenario has failed based on the heartbeat detection mechanism is as follows: The master node in the network scenario will periodically (e.g., once every 2 seconds) actively send heartbeat packets to other NAS nodes in the network scenario other than the master node. If the master node does not receive a heartbeat response packet from other NAS nodes for the heartbeat packet within a set time, it is determined that other NAS nodes have failed; otherwise, it is determined that other NAS nodes have not failed. Correspondingly, if other NAS nodes do not receive a heartbeat packet sent by the master node at set intervals, it is determined that the master node has failed.
[0049] Step 202: If the heartbeat detection mechanism detects that the node has recovered to normal, select at least one tenant instance from the tenant instances that were previously migrated from this node to one of the non-faulty NAS nodes, and migrate the selected tenant instance back to this node.
[0050] If it is found that after migrating the selected tenant instances back to this node, there are still tenant instances that were previously migrated to this node on one of the non-faulty NAS nodes, then if the newly determined node load assessment index corresponding to this node is less than the third index threshold, the above step of selecting at least one tenant instance from the tenant instances that were previously migrated to one of the non-faulty NAS nodes will be returned.
[0051] Optionally, in this embodiment, the number of tenant instances migrated back to the local node each time can be flexibly set based on actual application needs. For example, a "low-load gradual migration" strategy can be adopted, that is, the number of tenant instances migrated back to the local node each time can be 10% or 20% of the number of tenant instances previously migrated to one of the non-faulty NAS nodes, so as to avoid overloading the local node by migrating all tenant instances back to the local node at once.
[0052] To facilitate understanding of the specific implementation process of the above-mentioned dynamic resource scheduling method, specific embodiments are described below.
[0053] In this embodiment, the architecture including at least two network-attached storage (NAS) nodes can also be referred to as a dual-active NAS architecture. See also Figure 3 The illustrated NAS active-active architecture includes NAS node 0 (node0) and NAS node 1 (node1). Both node0 and node1 are active, and the two NAS nodes can share the load. When one NAS node is overloaded or fails, the other NAS node can seamlessly take over the relevant services to ensure the high availability and stability of the overall architecture. Tenant instances corresponding to tenants 1 and 2 are deployed on node0, and tenant instance corresponding to tenant 3 is deployed on node1. Each tenant can interface with clients through a shared protocol such as NFS. `fs` stands for File System, and one client corresponds to one `fs` to assist in implementing storage services. A storage pool can refer to a storage pool composed of multiple disks. Nodes 0 and 1 connect to the storage pool to provide efficient and reliable storage services to tenants.
[0054] based on Figure 3 The NAS active-active architecture shown in this embodiment provides a dynamic scheduling method for containers (i.e., tenant instances) based on global optimization and load prediction. For example, as an embodiment, this method can be applied to the master node in a NAS active-active architecture. The specific implementation process of this method is as follows: I. Data Acquisition and Processing 1. Data Collection: In this embodiment, a monitoring tool such as Prometheus+Grafana is deployed on each NAS node, which can be used to periodically collect multi-dimensional data corresponding to the NAS node and store real-time extreme values through Redis distributed cache.
[0055] The multi-dimensional data to be collected in each statistical period may include: Tenant dimension: The total number of IO requests issued by each client connected to the tenant instance within the statistical period (which can be recorded as the number of requests per unit time for each client), as well as the tenant instance's memory utilization, IO load, and IO latency within the statistical period.
[0056] Node dimension: The number of tenant instances on the NAS node during the statistical period (which can be recorded as tenant instance load), the memory utilization rate of the NAS node during the statistical period (i.e., the sum of the memory utilization rates of each tenant instance on the NAS node during the statistical period), the IO load (i.e., the sum of the IO loads of each tenant instance on the NAS node during the statistical period), and the IO latency (i.e., the average IO latency of each tenant instance on the NAS node during the statistical period), etc.
[0057] The storage of real-time extreme values through a Redis distributed cache includes: dynamically updating extreme values every set time interval, such as 10 minutes, based on a sliding window (as described below). , , , (etc.) The cache is updated only when new data exceeds the window's extreme value, avoiding global data traversal and thus improving the computational efficiency of data normalization. It should be noted that this embodiment does not specifically limit how the extreme value is dynamically updated based on the sliding window; please refer to the relevant descriptions in related technologies.
[0058] For example, the structure for storing sliding window data using Redis is as follows: { “tenantA”: { / / Tenant A "window": "2025-06-05 09:00-09:10"; “ ": 100000, / / The maximum number of requests per unit time among the client requests connected to the tenant instance; “ ":50, / / The minimum number of requests per unit time among the requests per client connected to the tenant instance; … } } 2. Data Processing: In this embodiment, the collected data is subjected to incremental normalization to unify the data dimensions and eliminate dimensional differences.
[0059] (1) Normalization of the number of requests per unit time: ; in, For the client The number of requests per unit time within the statistical period Indicates the client number; This represents the normalized request volume per unit of time. and Please refer to the relevant descriptions above.
[0060] (2) Normalization of memory usage: ; in, Represents a tenant instance The amount of memory used during the statistical period. Indicates the tenant instance number; Represents a tenant instance Total memory capacity of the NAS node; This represents the normalized memory usage rate.
[0061] (3) Normalization of I / O load: ; in, Represents a tenant instance IO load during the statistical period; Represents a tenant instance The sum of the IO load of each tenant instance on the NAS node during the statistical period; This represents the normalized I / O load.
[0062] (4) Normalization of I / O latency: ; in, Represents a tenant instance IO latency within the statistical period; Represents a tenant instance The minimum IO latency of each tenant instance on the NAS node within the statistical period; Represents a tenant instance The maximum IO latency of each tenant instance on the NAS node within the statistical period; This represents the normalized I / O latency.
[0063] (5) Normalization of tenant instance load: ; in, Indicates NAS node Tenant instance load during the statistical period Number the NAS nodes; This represents the minimum tenant instance load among the tenant instance loads of each NAS node in a dual-active NAS architecture within the statistical period; This represents the maximum tenant instance load among the tenant instance loads of each NAS node in a dual-active NAS architecture within the statistical period; This represents the normalized tenant instance load.
[0064] In this embodiment, as one example, after collecting data, each NAS node can perform incremental normalization on the collected data, and then send the normalized data to the master node for subsequent processing, such as calculating load assessment metrics and dynamically scheduling tenant instances. Alternatively, after collecting data, each NAS node can directly send the collected data to the master node, so that the master node can perform incremental normalization on the collected data. This embodiment does not specifically limit this approach.
[0065] II. Calculation of Load Assessment Indicators 1. For each tenant instance, the tenant load assessment metric can be calculated using the following formula: ; in, Represents a tenant instance Corresponding tenant load assessment metrics; , and These represent the weights of memory utilization, IO load, and IO latency, respectively, and characterize the importance of memory utilization, IO load, and IO latency in overall resource utilization.
[0066] For example, initially, , Subsequently, adjustments can be made periodically based on the collected real-time data. , and Dynamic updates will be performed. For details on how to perform dynamic updates, please refer to the relevant descriptions above, which will not be repeated here.
[0067] 2. For each NAS node, the node load evaluation index can be calculated using the following formula: ; in, Indicates NAS node Corresponding node load assessment metrics; For NAS nodes The weight of the tenant instance load; Indicates NAS node The sum of tenant load assessment metrics corresponding to each tenant instance.
[0068] For example, initially, It can be set to 0.5, and subsequently adjusted periodically based on the collected real-time data. Perform dynamic updates; as for the specifics of how to perform dynamic updates... For details, please refer to the relevant descriptions above, which will not be repeated here.
[0069] III. Dynamic Scheduling of Tenant Instances 1. For any tenant instance on any NAS node, when the memory utilization rate of the tenant instance reaches the set utilization threshold in the current statistical period, and / or the IO load of the tenant instance reaches the set load threshold in the current statistical period, and / or the IO latency of the tenant instance reaches the set latency threshold in the current statistical period, and / or the tenant load assessment index of the tenant instance reaches the first index threshold in the current statistical period, it is determined to expand the tenant instance. At this time, based on the node load assessment index of other NAS nodes in this network scenario, a target NAS node can be found from other NAS nodes, and a replica instance of the tenant instance can be created on the target NAS node so that the tenant instance and the replica instance of the tenant instance can handle the IO requests issued by each client connected to the tenant instance according to the principle of load balancing.
[0070] Optionally, the above-mentioned utilization threshold, load threshold, and latency threshold can be dynamically adjusted according to the tenant priority of the tenant instance. For example, the utilization threshold, load threshold, and latency threshold are higher for tenant instances with higher tenant priority.
[0071] 2. For any NAS node, if the node load assessment metric corresponding to the NAS node reaches the second metric threshold, it is determined to migrate the instance of the NAS node. At this time, based on the node load assessment metrics of other NAS nodes in this network scenario, a target NAS node can be found from other NAS nodes, and at least one tenant instance on the NAS node can be migrated to the target NAS node.
[0072] In summary, the resource dynamic scheduling method provided in this embodiment comprehensively senses multi-dimensional data of multi-tenant instances in a NAS dual-active architecture, such as the aforementioned request volume per unit time, memory usage, IO load, and IO latency, and dynamically judges and expands replica instances and dynamically migrates tenant instances to achieve globally optimized dynamic scheduling of tenant instance resources. This not only ensures the comprehensiveness and scientific nature of scheduling decisions but also effectively improves overall resource utilization and dynamic adaptability, thereby enhancing overall service quality and user experience.
[0073] This concludes the description of the method provided in the embodiments of this application. The apparatus provided in the embodiments of this application will now be described: As an example, this embodiment also provides a dynamic resource scheduling device. For example, see... Figure 4 , Figure 4 This is a schematic diagram of a resource dynamic scheduling device provided in an embodiment of this application. The device corresponds to… Figure 1 The process is shown below. Figure 4 As shown, the resource dynamic scheduling device 400 is applied to any NAS node in a network scenario containing at least two NAS nodes. The resource dynamic scheduling device 400 includes: The statistics module 401 is used to calculate the tenant load assessment metrics for each tenant instance on this node at the tenant instance level; the tenant load assessment metrics for any tenant instance are determined based on the load parameters of that tenant instance. At the node level, the node load assessment metrics corresponding to this node are calculated; the node load assessment metrics corresponding to this node are determined based on the number of tenant instances on this node and the current resource usage of this node; The extension module 402 is used to, for any tenant instance, when determining to extend the tenant instance based on the tenant load assessment index corresponding to the tenant instance, find a target NAS node from the other NAS nodes in the network scenario based on the node load assessment index corresponding to the other NAS nodes besides the current node, and create a replica instance of the tenant instance on the target NAS node, so that the tenant instance and the replica instance of the tenant instance can handle the IO requests issued by each client connected to the tenant instance according to the principle of load balancing.
[0074] As an example, the tenant load assessment metric corresponding to any tenant instance on this node is determined through the following steps: Obtain the load parameters of the tenant instance within the current statistical period. The load parameters include at least: memory utilization, IO load, and IO latency. The load parameters of the tenant instance within the current statistical period are weighted to obtain the tenant load assessment index corresponding to the tenant instance; where different load parameters may have the same or different weights.
[0075] As an example, the node load evaluation metric corresponding to this node is determined through the following steps: Based on the memory usage, IO load, and IO latency of each tenant instance on this node within the current statistical period, determine the current resource usage of this node; The number of tenant instances on this node and the current resource usage of this node are weighted to obtain the node load assessment index corresponding to this node; wherein, the weight of the number of tenant instances on this node is the same as or different from the weight of the current resource usage of this node.
[0076] As one embodiment, the device 400 further includes: The migration module is used to determine whether to migrate instances on the current node based on the node load assessment index corresponding to the current node, and to find a target NAS node from the other NAS nodes in the network scenario based on the node load assessment index corresponding to the other NAS nodes besides the current node, and migrate at least one tenant instance on the current node to the target NAS node.
[0077] As one embodiment, finding a target NAS node from the other NAS nodes based on the node load evaluation metrics of the other NAS nodes in the network scenario (excluding the current node) includes: Find the NAS node with the lowest node load evaluation index among the other NAS nodes; When the number of NAS nodes found is 1, the found NAS node is taken as the target NAS node; When the number of NAS nodes found is greater than 1, select the NAS node with the smallest number of tenant instances from the found NAS nodes as the target NAS node.
[0078] As one embodiment, migrating at least one tenant instance on this node to the target NAS node includes: Based on the tenant priority and request load of each tenant instance on this node, the migration priority of that tenant instance is determined; the request load of any tenant instance refers to the total number of IO requests sent by at least one client connected to that tenant instance within the current statistical period. The tenant instances of this node are sorted in descending order of migration priority, so that at least one tenant instance with the highest ranking in the sorting results is migrated to the target NAS node.
[0079] As one embodiment, the device 400 further includes: The fault handling module is used to switch any non-faulty NAS node in the network scenario to become the master node if a fault is detected in this node based on the heartbeat detection mechanism, and to migrate the tenant instances on this node to one of the non-faulty NAS nodes in the network scenario.
[0080] As an example, the fault handling module is further configured to, after a fault is detected in the local node based on the heartbeat detection mechanism, if the local node is found to have recovered to normal based on the heartbeat detection mechanism, select at least one tenant instance from the tenant instances that were previously migrated from the local node to one of the non-faulty NAS nodes, and migrate the selected tenant instance back to the local node. If it is found that after migrating the selected tenant instances back to this node, there are still tenant instances that were previously migrated to this node on one of the non-faulty NAS nodes, then if the newly determined node load assessment index corresponding to this node is less than the third index threshold, the step of selecting at least one tenant instance from the tenant instances that were previously migrated from this node to one of the non-faulty NAS nodes will be returned.
[0081] This concludes the process. Figure 4 Structural description of the device shown.
[0082] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0083] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0084] Please see Figure 5This is a schematic diagram of the hardware structure of an electronic device provided as an exemplary embodiment of this application. The electronic device includes a processor and a computer-readable storage medium; the computer-readable storage medium stores a plurality of computer program instructions, which, when executed by the processor, implement the method disclosed in the above example of this application. Depending on the actual function of the electronic device, other hardware may also be included, which will not be elaborated further.
[0085] Based on the same concept as the above method, this application also provides a computer-readable storage medium storing a plurality of computer program instructions, which, when executed by a processor, can implement the method disclosed in the above examples of this application.
[0086] For example, the aforementioned computer-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, messages, etc. For instance, computer-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0087] The above are merely preferred embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for dynamic resource scheduling, characterized in that, This method is applied to any NAS node in a network scenario containing at least two network-attached storage (NAS) nodes, wherein the NAS nodes in the network scenario share tenant instances with each other; the method includes: At the tenant instance level, the tenant load assessment metric for each tenant instance on this node is calculated; the tenant load assessment metric for any tenant instance is determined based on the load parameters of that tenant instance. At the node level, the node load assessment metrics corresponding to this node are calculated; the node load assessment metrics corresponding to this node are determined based on the number of tenant instances on this node and the current resource usage of this node; For any tenant instance, when it is determined to extend the instance based on the tenant load assessment metric corresponding to the tenant instance, a target NAS node is found from the other NAS nodes based on the node load assessment metrics corresponding to the other NAS nodes in the network scenario, and a replica instance of the tenant instance is created on the target NAS node, so that the tenant instance and the replica instance of the tenant instance can handle the input / output IO requests issued by each client connected to the tenant instance according to the principle of load balancing.
2. The method according to claim 1, characterized in that, The tenant load assessment metrics for any tenant instance on this node are determined through the following steps: Obtain the load parameters of the tenant instance within the current statistical period. The load parameters include at least: memory utilization, IO load, and IO latency. The load parameters of the tenant instance within the current statistical period are weighted to obtain the tenant load assessment index corresponding to the tenant instance; where different load parameters may have the same or different weights.
3. The method according to claim 1, characterized in that, The node load evaluation metrics for this node are determined through the following steps: Based on the memory usage, IO load, and IO latency of each tenant instance on this node within the current statistical period, determine the current resource usage of this node; The number of tenant instances on this node and the current resource usage of this node are weighted to obtain the node load assessment index corresponding to this node; wherein, the weight of the number of tenant instances on this node is the same as or different from the weight of the current resource usage of this node.
4. The method according to claim 1, characterized in that, The method further includes: When determining to migrate instances on a node based on the node load assessment metrics corresponding to that node, a target NAS node is found from the other NAS nodes in the network scenario based on the node load assessment metrics corresponding to other NAS nodes besides that node, and at least one tenant instance on that node is migrated to the target NAS node.
5. The method according to claim 4, characterized in that, The step of determining to extend the tenant instance based on the tenant load assessment index corresponding to the tenant instance includes: when the tenant load assessment index corresponding to the tenant instance reaches the first index threshold, determining to extend the tenant instance. The step of determining to migrate an instance of a node based on the node load assessment index corresponding to the node includes: when the node load assessment index corresponding to the node reaches the second index threshold, it is determined to migrate an instance of the node.
6. The method according to claim 4, characterized in that, The process of finding a target NAS node from other NAS nodes in the network scenario based on node load evaluation metrics includes: Find the NAS node with the lowest node load evaluation index among the other NAS nodes; When the number of NAS nodes found is 1, the found NAS node is taken as the target NAS node; When the number of NAS nodes found is greater than 1, select the NAS node with the smallest number of tenant instances from the found NAS nodes as the target NAS node.
7. The method according to claim 4, characterized in that, The step of migrating at least one tenant instance on this node to the target NAS node includes: Based on the tenant priority and request load of each tenant instance on this node, the migration priority of that tenant instance is determined; the request load of any tenant instance refers to the total number of IO requests sent by at least one client connected to that tenant instance within the current statistical period. The tenant instances of this node are sorted in descending order of migration priority, so that at least one tenant instance with the highest ranking in the sorting results is migrated to the target NAS node.
8. The method according to claim 1, characterized in that, The method further includes: If a fault is detected in this node based on the heartbeat detection mechanism, and this node is the master node in the network scenario, then any non-faulty NAS node in the network scenario will be switched to the master node, and the tenant instances on this node will be migrated to one of the non-faulty NAS nodes in the network scenario.
9. The method according to claim 8, characterized in that, After detecting a fault in this node based on the heartbeat detection mechanism, the method further includes: If the heartbeat detection mechanism detects that this node has recovered to normal, then select at least one tenant instance from the tenant instances that were previously migrated from this node to one of the non-faulty NAS nodes, and migrate the selected tenant instance back to this node. If it is found that after migrating the selected tenant instances back to this node, there are still tenant instances that were previously migrated to this node on one of the non-faulty NAS nodes, then if the newly determined node load assessment index corresponding to this node is less than the third index threshold, the step of selecting at least one tenant instance from the tenant instances that were previously migrated from this node to one of the non-faulty NAS nodes will be returned.
10. An electronic device, characterized in that, The electronic device includes: Processor; and A computer-readable storage medium storing computer program instructions that, when executed by the processor, cause the processor to perform the steps of the method according to any one of claims 1 to 9.