CN117687803A - Tenant resource allocation method, device, equipment and storage medium - Google Patents

Tenant resource allocation method, device, equipment and storage medium Download PDF

Info

Publication number
CN117687803A
CN117687803A CN202410154797.4A CN202410154797A CN117687803A CN 117687803 A CN117687803 A CN 117687803A CN 202410154797 A CN202410154797 A CN 202410154797A CN 117687803 A CN117687803 A CN 117687803A
Authority
CN
China
Prior art keywords
tenant
resource
node
determining
time interval
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410154797.4A
Other languages
Chinese (zh)
Other versions
CN117687803B (en
Inventor
雷洋
周军
张琼
高经
宫海林
刘涛
李文强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Systems Engineering of PLA Academy of Military Sciences
Original Assignee
Institute of Systems Engineering of PLA Academy of Military Sciences
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute of Systems Engineering of PLA Academy of Military Sciences filed Critical Institute of Systems Engineering of PLA Academy of Military Sciences
Priority to CN202410154797.4A priority Critical patent/CN117687803B/en
Priority claimed from CN202410154797.4A external-priority patent/CN117687803B/en
Publication of CN117687803A publication Critical patent/CN117687803A/en
Application granted granted Critical
Publication of CN117687803B publication Critical patent/CN117687803B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a tenant resource allocation method, device, equipment and storage medium. The method comprises the steps of distributing node resources for the established tenants by adopting a hard isolation policy, and establishing a cluster naming space for the tenants by adopting a soft isolation policy; building a tenant resource management system in a PaaS platform, wherein the tenant resource management system determines index data of each tenant corresponding to each cluster naming space; the tenant resource management system determines a resource adjustment mode of each tenant based on index data of each tenant corresponding to each cluster naming space, wherein the resource adjustment mode comprises capacity expansion, capacity invariance and capacity shrinkage; and adjusting the resources of each tenant based on the resource adjustment mode. The method can automatically allocate more resources to meet the high load demand, reduce the resources when the load is reduced, and improve the overall performance and the user experience.

Description

Tenant resource allocation method, device, equipment and storage medium
Technical Field
The present invention relates to the field of cloud computing technologies, and in particular, to a tenant resource allocation method, device, equipment, and storage medium.
Background
Platform as a service (Platform as a Service, paaS for short) is an important service mode of cloud computing, and provides resources and services required by application development and deployment for users. With the continuous development of cloud computing technology, the diversification of application scenarios, the PaaS container cloud platform multi-tenant scenario is attracting more and more attention. The multi-tenant technology shares the same bottom resource pool, and ensures data isolation among tenants. The resources in different tenants are isolated from each other so that they can share one platform resource or can not interfere with each other. At the heart of multi-tenant management is the distribution of rights relationships between personnel (organizations) and resources.
In the prior art, a static resource allocation mode is mainly adopted to allocate computing resources, storage resources and network resources of a container cloud platform to each tenant, so that the tenant manages applications, users and resources according to own use situations.
However, in the conventional static resource allocation method, it is difficult to cope with the dynamic resource demand, and there is a possibility that resource waste and performance degradation may occur.
Disclosure of Invention
In order to solve the technical problems, the invention provides a tenant resource allocation method, device, equipment and storage medium, which are used for solving the technical problems that a static resource allocation mode is difficult to deal with dynamic resource requirements and resource waste and performance reduction are possibly caused.
The invention provides a tenant resource allocation method, which comprises the following steps:
step S1: node resources are allocated for the established tenants by adopting a hard isolation strategy, and a cluster naming space is established for the tenants by adopting a soft isolation strategy;
step S2: building a tenant resource management system in a PaaS platform, wherein the tenant resource management system comprises an index acquisition module, an index storage module, a resource control module and a software data management module; the index acquisition module is used for periodically acquiring data of each tenant and determining index data of each tenant; the index storage module is used for storing the index data; the resource control module is used for determining a resource adjustment mode of the tenant according to the index data, and the tenant resources comprise a CPU and a memory; the software data management module is used for managing node resources; the tenant resource management system determines index data of each tenant corresponding to each cluster naming space;
Step S3: the tenant resource management system determines a resource adjustment mode of each tenant based on index data of each tenant corresponding to each cluster namespace, wherein the resource adjustment mode comprises capacity expansion, capacity invariance and capacity shrinkage;
step S4: and the tenant resource management system adjusts the resources of each tenant based on the resource adjustment mode.
Preferably, the step S2: the tenant resource management system determines index data of each tenant corresponding to each cluster naming space, wherein the index data at least comprises: the method comprises the steps of setting the total resource size n of all node resources allocated by a tenant, the preset resource utilization rate S, the average resource utilization rate U, the service request resource size R of the tenant, and the resource size c of the largest node resource in all node resources allocated by the tenant.
Preferably, in the step S3, the determining, by the tenant resource management system, a resource adjustment manner of each tenant based on index data of each tenant corresponding to each cluster namespace includes:
step S301: the tenant resource management system determines a first resource adjustment value of the tenant according to the total resource size of all node resources allocated by the tenant in the index data of the tenant, a preset resource utilization rate and an average resource utilization rate;
Step S302: if the first resource adjustment value is greater than or equal to a first preset threshold value, determining that the resource adjustment mode of the tenant is node resources of the expanded tenant;
the first resource adjustment value P1 is specifically as follows:
preferably, in the step S3, the determining, by the tenant resource management system, a resource adjustment manner of each tenant based on index data of each tenant corresponding to each cluster namespace includes:
step S311: determining a second resource adjustment value of the tenant according to the service request resource size of the tenant, the total resource size of all the nodes allocated by the tenant and the resource size of the largest node in all the nodes allocated by the tenant;
step S312: if the second resource adjustment value is greater than or equal to a second preset threshold value, determining that the resource adjustment mode of the tenant is node resources of the expanded tenant;
the second resource adjustment value P2 is specifically as follows:
preferably, after determining that the resource adjustment mode of the tenant is the node resource of the expanded tenant, the following operations are executed:
dividing 24 hours a day according to preset time length, wherein each divided time period is used as a time interval; determining a time interval corresponding to the current time, and marking the current time interval as a capacity expansion required;
Acquiring historical data of a current time interval, wherein marks of time intervals in a plurality of continuous days which are nearest to the current DATE are recorded in the historical data, and the accumulated days of the historical data are recorded as DATE; obtaining marks of all time intervals corresponding to the current time interval in the historical data; determining the net capacity expansion times corresponding to the current time interval, wherein the net capacity expansion times are obtained values of the total number of the capacity expansion to be performed minus the total number of the capacity contraction to be performed in the obtained marks, and if the net capacity expansion times corresponding to the current time interval are greater than 0, calculating the sum of days of which the net capacity expansion times corresponding to each time interval corresponding to the current time interval in the historical data are greater than 0, and marking the sum as T; the probability of capacity expansion in the current time interval is P3, and P3=T/DATE;
if the P3 exceeds the preset probability P, the capacity is expanded; after capacity expansion, setting an inertial holding TIME TIME, taking the sum of the current TIME and the inertial holding TIME TIME as a holding end TIME, and not executing capacity reduction operation from the current TIME to the holding end TIME.
Preferably, in the step S3, the determining, by the tenant resource management system, a resource adjustment manner of each tenant based on index data of each tenant corresponding to each cluster namespace includes:
Step S321: determining a first resource adjustment value of the tenant according to the total resource size of all the resource nodes allocated by the tenant in the index data of the tenant, and the preset resource utilization rate and the average resource utilization rate;
step S322: and if the first resource adjustment value is smaller than a first preset threshold value, determining node resources of the contractual tenant.
Preferably, after determining node resources of the contractual tenant, the following operations are performed:
dividing 24 hours a day according to preset time length, wherein each divided time period is used as a time interval; determining a time interval corresponding to the current time, and marking the current time interval as a volume needing to be contracted;
acquiring historical data of a current time interval, wherein marks of time intervals in a plurality of continuous days which are nearest to the current DATE are recorded in the historical data, and the accumulated days of the historical data are recorded as DATE; obtaining marks of all time intervals corresponding to the current time interval in the historical data; determining the net capacity reduction times corresponding to the current time interval, wherein the net capacity reduction times are the obtained values of the total number of the capacity reduction required to be performed minus the total number of the capacity expansion required to be performed in the marks, and if the net capacity reduction times corresponding to the current time interval are greater than 0, calculating the sum of days, in the historical data, of which the net capacity reduction times corresponding to each time interval corresponding to the current time interval are greater than 0, and marking the sum as T1; the probability of capacity expansion in the current time interval is P4, and P4=T1/DATE; setting an inertia holding TIME;
If P4 exceeds the preset probability P and the starting time of the current time interval exceeds the inertia holding time, carrying out stepwise capacity reduction; and after the capacity reduction, taking the sum of the current TIME and the inertia holding TIME TIME as a holding end TIME, and not executing the capacity reduction operation from the current TIME to the holding end TIME.
The invention provides a tenant resource allocation device, which comprises:
an initialization module: the method comprises the steps of configuring to allocate node resources for a tenant which is created by adopting a hard isolation strategy, and creating a cluster naming space for the tenant by adopting a soft isolation strategy;
and the acquisition module is used for: the system comprises a tenant resource management system, a data acquisition module, an index storage module, a resource control module and a software data management module, wherein the tenant resource management system is configured to be built in a PaaS platform; the index acquisition module is used for periodically acquiring data of each tenant and determining index data of each tenant; the index storage module is used for storing the index data; the resource control module is used for determining a resource adjustment mode of the tenant according to the index data, and the tenant resources comprise a CPU and a memory; the software data management module is used for managing node resources; the tenant resource management system determines index data of each tenant corresponding to each cluster naming space;
And an analysis module: the tenant resource management system is configured to determine a resource adjustment mode of each tenant based on index data of each tenant corresponding to each cluster name space, wherein the resource adjustment mode comprises capacity expansion, capacity invariance and capacity shrinkage;
and an adjustment module: the tenant resource management system is configured to adjust the resources of each tenant based on the resource adjustment mode.
The invention provides tenant resource allocation equipment, which comprises the following components:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described above.
The present invention provides a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method as described above.
The method adopts the hard isolation policy to allocate node resources for the established tenants, and adopts the soft isolation policy to establish cluster namespaces for the tenants, namely, a stronger tenant isolation mode is provided by a tenant isolation mode combining the soft isolation policy and the hard isolation policy, the influence of mutual interference of resources among the tenants is reduced, and meanwhile, the safety is also ensured; and then, acquiring index data of each tenant in the cluster, determining whether to adjust node resources of each tenant according to the index data of each tenant, if so, performing capacity expansion operation or capacity contraction operation on the node resources of each tenant according to the index data of each tenant, namely dynamically distributing the node resources of each tenant, so as to flexibly manage the tenant resources, thereby improving the resource utilization rate to the greatest extent, reducing the resource waste, and further reducing the tenant cost. Due to the dynamic nature of the resource configuration, the tenant may obtain higher performance according to the load variation. The system can automatically allocate more resources to meet high load demands, reduce the resources when the load is reduced, and improve the overall performance and the user experience.
It should be understood that what is described in this summary is not intended to limit the critical or essential features of the embodiments of the disclosure nor to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The above and other features, advantages and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. For a better understanding of the present disclosure, and without limiting the disclosure thereto, the same or similar reference numerals denote the same or similar elements, wherein:
fig. 1 is a schematic flow chart of a tenant resource allocation method proposed by the present invention;
fig. 2 is a schematic structural diagram of a tenant resource management system according to the present invention;
fig. 3 is a schematic diagram of a second embodiment of the tenant resource allocation method proposed in the present invention;
fig. 4 is a schematic diagram of a third embodiment of the tenant resource allocation method proposed in the present invention;
fig. 5 is a schematic diagram of a fourth embodiment of the tenant resource allocation method proposed in the present invention;
fig. 6 is a schematic diagram of a fifth embodiment of a tenant resource allocation method according to the present invention;
Fig. 7 is a schematic diagram of a sixth embodiment of a tenant resource allocation method according to the present invention;
fig. 8 is a schematic diagram of a seventh embodiment of a tenant resource allocation method proposed in the present invention;
fig. 9 is a schematic diagram of an eighth embodiment of a tenant resource allocation method proposed in the present invention;
fig. 10 is a schematic structural diagram of a tenant resource allocation device according to the present invention;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Reference numerals:
101: index acquisition module, 102: index storage modules 102, 103: resource control module, 104: and a software data management module.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are some embodiments of the present disclosure, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments in this disclosure without inventive faculty, are intended to be within the scope of this disclosure.
Fig. 1 shows a flow diagram of tenant resource allocation. It should be understood that in other embodiments, the sequence of part of the steps in the tenant resource allocation method may be interchanged according to actual needs, or part of the steps may be omitted or deleted. As shown in fig. 1, the method includes:
step S1: node resources are allocated for the established tenants by adopting a hard isolation strategy, and a cluster naming space is established for the tenants by adopting a soft isolation strategy;
step S2: building a tenant resource management system in a PaaS platform, wherein the tenant resource management system comprises an index acquisition module, an index storage module, a resource control module and a software data management module; the index acquisition module is used for periodically acquiring data of each tenant and determining index data of each tenant; the index storage module is used for storing the index data; the resource control module is used for determining a resource adjustment mode of the tenant according to the index data, and the tenant resources comprise a CPU and a memory; the software data management module is used for managing node resources; the tenant resource management system determines index data of each tenant corresponding to each cluster naming space;
Step S3: the tenant resource management system determines a resource adjustment mode of each tenant based on index data of each tenant corresponding to each cluster namespace, wherein the resource adjustment mode comprises capacity expansion, capacity invariance and capacity shrinkage;
step S4: and the tenant resource management system adjusts the resources of each tenant based on the resource adjustment mode.
The hard isolation policy is to provide resources for different tenants on a physical level using independent servers, storage devices and network devices. The hard quarantine policy can provide higher security, privacy, and performance, but is typically more costly, requiring more hardware resources and management costs. However, only using the hard isolation manner tenant resource management may not effectively manage its resource quota, resulting in insufficient resources, and may cause a decrease in service performance, or over-allocate resources, and waste costs. Thus, better resource allocation and quota management is needed.
The soft isolation policy realizes isolation among tenants through control and management of a software layer. For example, based on the k8s cluster environment, a namespace is typically used as a soft isolation mechanism to isolate tenants within the same k8s cluster. Wherein each tenant can create and manage resources within its own namespace and can be assured that the tenant does not exceed its allocated resources by using the resource quota. However, using only soft isolation may occur that if the isolation between tenants is not strong enough, the problem of one tenant may affect other tenants, or resource competition may lead to performance problems.
In general, common tenant isolation methods are classified into soft isolation and hard isolation. Wherein, both isolation modes are used for isolating resources and data among different tenants. They have different technical realizations and features. In the prior art, the conventional resource allocation method is generally static, and allocates computing resources, storage resources and network resources of the container cloud platform to each tenant, so that the tenant manages applications, users and resources according to own use scenarios. Therefore, in the prior art, whether a soft isolation mode or a hard isolation mode is adopted, the resource requirements of each tenant cannot be dynamically adjusted according to the load requirements of the tenant, so that the problems of resource waste and performance degradation are caused. The method and the device have the advantages that the mode of combining the hard isolation strategy with the soft isolation strategy is adopted, the tenant resources can be dynamically adjusted, and the utilization rate of the whole resources of the cluster is improved.
In this embodiment, for example, a container cloud platform system based on k8S clusters is deployed as an example in step S1. Creating tenants, initially setting request resources for each tenant, defaulting to allocate two unit node resources for each tenant by adopting a hard isolation strategy, injecting tenant labels for nodes according to the tenants, and naming the labels by tenant names; meanwhile, a cluster name space is created for each tenant by adopting a soft isolation strategy, and the name of the name space is consistent with the name of each tenant. Therefore, in the embodiment, a stronger tenant isolation mode is provided by combining the soft isolation strategy and the hard isolation strategy, so that the influence of mutual interference of resources among tenants is reduced, and meanwhile, the safety is ensured.
Fig. 2 is a schematic structural diagram of a tenant resource management system provided in an embodiment of the present application, where, as shown in fig. 2, the tenant resource management system includes: an index acquisition module 101, an index storage module 102, a resource control module 103 and a software data management module 104.
The index collection module 101 is configured to collect data of each tenant corresponding to each cluster namespace (for example, based on k8s clusters), determine index data of each tenant, and store the index data of each tenant to the index storage module 102.
A flexible, multidimensional data model is used in the present invention to collect and store time series data and then support querying and visualizing the data to provide insight and data.
The index storage module 102 is used for receiving, storing, managing and retrieving index data of each tenant in the cluster acquired by the index acquisition module 101, expanding the functions of the index acquisition module 101, and solving the problems of long-term storage, high availability, global query and the like of mutual data.
The resource control module 103 is configured to obtain the index data of each tenant in the cluster from the index storage module 102 at regular time, and perform policy judgment and calculation according to the index data, so as to manage, allocate and control the node resources of each tenant in the cluster, including but not limited to, resource isolation, container scheduling, resource monitoring, dynamic resource allocation, automatic expansion and contraction, and container lifecycle management, etc., which are main central control modules.
The software data management module 104 is used to manage and provide storage resources to support data persistence, extensibility, and isolation of the system.
The step S2: the tenant resource management system determines index data of each tenant corresponding to each cluster naming space, wherein the index data at least comprises: the method comprises the steps of setting the total resource size n of all node resources allocated by a tenant, the preset resource utilization rate S, the average resource utilization rate U, the service request resource size R of the tenant, and the resource size c of the largest node resource in all node resources allocated by the tenant. And c is the resource of a redundant unit node, and whether redundancy or a gap exists is measured through the value when the capacity is expanded and contracted later.
In this embodiment, for example, as shown in fig. 1, the index collection module 101 in fig. 1 may query the index data of each tenant at regular time according to the cluster name space of each tenant in the cluster, and store the index data of each tenant in the cluster in the index storage module 102, and the resource control module 103 may obtain the index data of each tenant from the index storage module 102 at regular time, for example, the total cpu core number or the total memory size n of all the nodes allocated by the tenant, a preset cpu usage rate or a memory usage rate threshold, the average cpu usage rate or the memory usage rate U of all the nodes allocated by the tenant, the service request cpu core number or the request memory size R of the tenant, and the cpu core number or the memory size corresponding to the node with the largest cpu core number or memory among all the nodes allocated by the tenant.
The step S3: the tenant resource management system determines a resource adjustment mode of each tenant based on index data of each tenant corresponding to each cluster namespace, wherein the resource adjustment mode comprises capacity expansion, capacity invariance and capacity shrinkage, and the method comprises the following steps:
and the resource control module judges whether the node resources of each tenant meet the current requirements according to the index data of each tenant corresponding to each cluster namespace, so as to determine the resource adjustment mode of each tenant, wherein the resource adjustment mode comprises capacity expansion, capacity invariance and capacity shrinkage, namely the node resources of each tenant are required to be expanded or removed by the current tenant, so that the node resources of each tenant can be dynamically adjusted, and the tenant resources can be flexibly managed.
In one implementation manner, for example, if the node resources of the tenant 1 do not meet the current requirement, the capacity expansion operation needs to be performed on the node resources of the tenant 1, that is, a new node is automatically and automatically allocated to the tenant 1, so as to meet the high load requirement, and overall performance and user experience are improved.
For another example, if node redundancy exists in the node resources of the tenant 2, the node resources of the tenant 2 need to be subjected to capacity shrinking operation, that is, the node is automatically removed for the tenant 2, so that resource waste is reduced, and therefore the tenant cost is reduced.
In summary, in the foregoing, in the present embodiment, firstly, a hard isolation policy is used to allocate node resources for the created tenant, and a soft isolation policy is used to create a cluster namespace for the tenant, that is, a tenant isolation mode combining the soft isolation policy and the hard isolation policy provides a stronger tenant isolation mode, reduces the influence of mutual interference of resources between tenants, and also ensures security; and then, acquiring index data of each tenant in the cluster, determining whether to adjust node resources of each tenant according to the index data of each tenant, if so, performing capacity expansion operation or capacity contraction operation on the node resources of each tenant according to the index data of each tenant, namely dynamically distributing the node resources of each tenant, so as to flexibly manage the tenant resources, thereby improving the resource utilization rate to the greatest extent, reducing the resource waste, and further reducing the tenant cost. Due to the dynamic nature of the resource configuration, the tenant may obtain higher performance according to the load variation. The system can automatically allocate more resources to meet high load demands, reduce the resources when the load is reduced, and improve the overall performance and the user experience.
At the same time, with these schemes, a system administrator can manage and maintain the system more easily. The resource allocation and isolation are automatically completed, so that the risk of human errors caused by manual intervention is reduced.
The following embodiments are used to explain how to dynamically adjust node resources of each tenant.
And a first, capacity expansion operation.
Optionally, referring to fig. 3, in step S3, the determining, by the tenant resource management system, a resource adjustment manner of each tenant based on index data of each tenant corresponding to each cluster namespace includes:
step S301: the tenant resource management system determines a first resource adjustment value of the tenant according to the total resource size of all node resources allocated by the tenant in the index data of the tenant, a preset resource utilization rate and an average resource utilization rate;
step S302: and if the first resource adjustment value is greater than or equal to a first preset threshold value, determining that the resource adjustment mode of the tenant is the node resource of the expanded tenant.
Illustratively, the first preset threshold is zero, for example.
In this embodiment, the following formula (1) may be adopted to calculate the first resource adjustment value P1, which is specifically as follows:
(1)
n is the total cpu core number or total memory size of all node resources allocated by the tenant;
S is a preset CPU utilization rate or memory utilization rate threshold;
u is average CPU utilization rate or memory utilization rate of all node resource collection under the tenant.
Therefore, according to the above formula (1), the first resource adjustment value P1 of each tenant is obtained by calculation, and if P1 is greater than or equal to 0, the node resource of the expanding tenant, that is, the node allocated under the tenant, is determined, and if the cpu utilization rate or the memory utilization rate of each node exceeds a set threshold, the expanding is triggered. Wherein, the capacity expansion amount is determined according to the value of P1.
Optionally, referring to fig. 4, in step S3, the determining, by the tenant resource management system, a resource adjustment manner of each tenant based on index data of each tenant corresponding to each cluster namespace includes:
step S311: and determining a second resource adjustment value of the tenant according to the service request resource size of the tenant, the total resource size of all the nodes allocated by the tenant and the resource size of the largest node in all the nodes allocated by the tenant.
Step S312: and if the second resource adjustment value is greater than or equal to a second preset threshold value, determining node resources of the capacity-expanding tenant.
Illustratively, the second preset threshold is zero, for example.
In this embodiment, the following formula (2) may be adopted to calculate the second resource adjustment value P2, which is specifically as follows:
(2)
wherein R is the number of cores of service requests cpu or the size of a request memory to which the tenant belongs;
n is the total cpu core number or total memory size of all the nodes allocated by the tenant;
c is the cpu core number or the memory size corresponding to the node with the largest cpu core number or memory in the nodes under the tenant, namely, a redundant unit node.
Therefore, according to the above formula (2), the first resource adjustment value P2 of each tenant may be obtained by calculation, when P2 is greater than or equal to 0, the node resource of the expanded tenant is determined, that is, the difference between the number of service request cores of the tenant and the number of cpu cores of the tenant excluding one unit node, which is 90%, exceeds the set threshold, and the expansion is triggered. Wherein, the capacity expansion amount is determined according to the value of P2.
Optionally, referring to fig. 5, after determining the node resources of the capacity-expanding tenant in step S302 and step S312, the method further includes:
step S303: determining whether the time interval between the current time and the last capacity expansion and/or contraction operation time is greater than the silence duration;
wherein, the expansion and/or contraction operation refers to expansion operation or contraction operation.
The silence period is also called cooling time, and is the time when the expansion and/or contraction operation is not executed after the last expansion and/or contraction operation. And (3) not performing capacity expansion and/or capacity contraction operation in the silence duration, but still judging whether the node resources of each tenant can perform capacity expansion and/or capacity contraction operation. And if the capacity expansion and/or contraction conditions are met after the silence duration is exceeded, triggering capacity expansion and/or contraction operation.
In this embodiment, in order to avoid the frequency of the capacity expansion and/or capacity reduction operation, it is further required to determine whether the time interval between the current time and the last time of executing the capacity expansion and/or capacity reduction operation is greater than the silence duration, and if so, trigger the capacity expansion and/or capacity reduction operation; if not, the capacity expansion and contraction operation is not triggered.
Step S304: if yes, a first node list with the node resource size larger than or equal to the first resource adjustment value or the second resource adjustment value in the shared node pool is obtained.
The shared node pool refers to node resources which are not allocated to the tenant on the container cloud platform, namely all nodes in the shared node pool are in a state to be allocated.
Step S305: and if the first node list is not empty, distributing the first nodes in the first node list to tenants, and adding node labels and network access strategies to the first nodes.
The first node is a node resource with the minimum cpu core number or memory size in the first node list.
In this embodiment, for example, when a capacity expansion operation is required for a node resource of the tenant 1, a node list 1 with a cpu core number or a memory size greater than or equal to Pi in a shared node pool may be obtained first, where Pi refers to a first resource adjustment value P1 or a second resource adjustment value P2; if the node list 1 is not empty, selecting the node 1 with the minimum cpu core number or memory size from the node list 1, adding a node tag and a network access policy to the newly added node 1 of the tenant 1, and mounting the tenant shared storage in the cluster, so that more resources can be automatically allocated to meet the high load demand, the dynamic allocation of the tenant node resources is realized, the flexible management of the tenant resources is realized, and the overall performance and the user experience are improved.
Optionally, referring to fig. 6, the method further includes:
step S306: if the first node list is empty, searching a node combination list of which the sum of the resources of the two nodes is greater than or equal to a first resource adjustment value or a second resource adjustment value from a shared node pool;
step S307: and distributing the second node and the third node in the node combination list to the tenant, and adding node labels and network access strategies to the second node and the third node respectively.
The sum of the resources of the second node and the third node is two nodes with the smallest sum of the resources in the node combination list.
In this embodiment, for example, if the obtained node list 1 is empty, a node combination list with a sum of two cores or memory sizes of the two nodes cpu being greater than or equal to Pi is found from the shared node pool, where Pi is a first resource adjustment value P1 or a second resource adjustment value P2; then, two nodes with the smallest CPU total core number or memory total size, namely a node 2 and a node 3, are selected from the node combination list and added into the tenant 1, a node label and a network access strategy are added to the newly added node 1 of the tenant 1, and the shared storage of tenants in the cluster is mounted, so that the dynamic property of resource allocation is realized, and the high-load requirement is met.
Optionally, after determining the node resources of the capacity-expanding tenant in the step S302 and the step S312, the method further includes:
dividing 24 hours a day according to preset time length, wherein each divided time period is used as a time interval; determining a time interval corresponding to the current time, and marking the current time interval as a capacity expansion required;
acquiring historical data of a current time interval, wherein marks of time intervals in a plurality of continuous days which are nearest to the current DATE are recorded in the historical data, and the accumulated days of the historical data are recorded as DATE; obtaining marks of all time intervals corresponding to the current time interval in the historical data; determining the net capacity expansion times corresponding to the current time interval, wherein the net capacity expansion times are obtained values of the total number of the capacity expansion to be performed minus the total number of the capacity contraction to be performed in the obtained marks, and if the net capacity expansion times corresponding to the current time interval are greater than 0, calculating the sum of days of which the net capacity expansion times corresponding to each time interval corresponding to the current time interval in the historical data are greater than 0, and marking the sum as T; the probability of capacity expansion in the current time interval is P3, and P3=T/DATE;
If the P3 exceeds the preset probability P, the capacity is expanded; after capacity expansion, setting an inertial holding TIME TIME, taking the sum of the current TIME and the inertial holding TIME TIME as a holding end TIME, and not executing capacity reduction operation from the current TIME to the holding end TIME.
And second, capacity shrinking operation.
Optionally, referring to fig. 7, in step S3, the determining, by the tenant resource management system, a resource adjustment manner of each tenant based on index data of each tenant corresponding to each cluster namespace includes:
step S321: determining a first resource adjustment value of the tenant according to the total resource size of all the resource nodes allocated by the tenant in the index data of the tenant, and the preset resource utilization rate and the average resource utilization rate;
step S322: and if the first resource adjustment value is smaller than a first preset threshold value, determining node resources of the contractual tenant.
Illustratively, the first preset threshold is zero, for example.
In this embodiment, the first resource adjustment value P1 may be calculated by continuously using the above formula (1), if P1 is smaller than 0, node resources of the contractual tenant, that is, nodes allocated under the tenant, are determined, and if the cpu utilization rate or the memory utilization rate of each node does not exceed a set threshold, expansion is triggered. Wherein, the capacity expansion amount is determined according to the value of P1.
Optionally, referring to fig. 8, the step S3 includes:
step S331: and determining a second resource adjustment value of the tenant according to the service request resource size of the tenant, the total resource size of all the nodes allocated by the tenant and the resource size of the largest node in all the nodes allocated by the tenant.
Step S332: and if the second resource adjustment value is smaller than a second preset threshold value, acquiring a fluctuation factor of the tenant.
The fluctuation factor is the cpu core number or the memory size.
Step S333: and if the summation result of the second resource adjustment value and the fluctuation factor is smaller than a second preset threshold value, determining node resources of the contractual tenant.
Illustratively, the second preset threshold is zero, for example.
In this embodiment, the second resource adjustment value P2 may be obtained by calculating using the above formula (2), if the second resource adjustment value P2 is smaller than zero, the fluctuation factor b of the tenant is continuously obtained, and whether p2+b is smaller than 0 is determined, if p2+b is smaller than 0, the node resource of the shrinking tenant is determined, that is, the shrinking is triggered; if P2+b is not less than 0, determining node resources of the non-tolerant tenant, namely not triggering the tolerant.
Optionally, referring to fig. 9, the step S4 includes: after determining the node resources of the contractor in step S322 and step S333, the method further includes:
Step S323: it is determined whether a time interval between the current time and the last time the expansion and/or contraction operation was performed is greater than a silence period.
Step S324: if yes, a second node list of which the resource size is smaller than the first resource adjustment value or the second resource adjustment value in the node pool of the tenant is obtained.
The node pool of the tenant comprises a plurality of nodes distributed for the tenant.
Step S325: and removing the fourth node in the second node list from the tenant, deleting the node label of the fourth node and recovering the initial network access strategy.
In this embodiment, for example, when a capacity reduction operation needs to be performed on a node resource of the tenant 2, a cpu core number or a node list 2 with a memory size smaller than Pi in a node pool of the tenant may be obtained first, where Pi refers to a first resource adjustment value P1 or a second resource adjustment value P2; and then selecting the node 4 with the minimum CPU core number or memory size from the node list, removing the node label of the node 4 from the tenant, and recovering the initial network access strategy, so that the automatic expansion and elastic resource allocation of the node resources of the tenant are realized, the flexibility of tenant resource management is improved, the resource utilization rate is improved to the greatest extent, and meanwhile, the resource waste is reduced, and the tenant cost is reduced.
The specific process of deleting the node label of the fourth node and recovering the initial network access policy is as follows.
And blocking service nodes in the tenant 2, enabling the nodes to be non-schedulable, expelling services running on the nodes, ensuring that no service related resources exist on the nodes, and backing up and cleaning node data. Deleting the tenant label for the node resource to be moved out of the tenant; obtaining a shared storage mount from a software data management module, and deleting the shared storage mount for node resources of the tenant to be moved out; and acquiring network access policy configuration in the shared resource pool of the tenant from the software data management module, and recovering node resources to be moved out of the tenant into the shared resource pool access policy.
Optionally, after determining the node resources of the contractor in the step S322 and the step S333, the method further includes:
dividing 24 hours a day according to preset time length, wherein each divided time period is used as a time interval; determining a time interval corresponding to the current time, and marking the current time interval as a volume needing to be contracted;
acquiring historical data of a current time interval, wherein marks of time intervals in a plurality of continuous days which are nearest to the current DATE are recorded in the historical data, and the accumulated days of the historical data are recorded as DATE; obtaining marks of all time intervals corresponding to the current time interval in the historical data; determining the net capacity reduction times corresponding to the current time interval, wherein the net capacity reduction times are the obtained values of the total number of the capacity reduction required to be performed minus the total number of the capacity expansion required to be performed in the marks, and if the net capacity reduction times corresponding to the current time interval are greater than 0, calculating the sum of days, in the historical data, of which the net capacity reduction times corresponding to each time interval corresponding to the current time interval are greater than 0, and marking the sum as T1; the probability of capacity expansion in the current time interval is P4, and P4=T1/DATE; setting an inertia holding TIME;
If P4 exceeds the preset probability P and the starting time of the current time interval exceeds the inertia holding time, carrying out stepwise capacity reduction; and after the capacity reduction, taking the sum of the current TIME and the inertia holding TIME TIME as a holding end TIME, and not executing the capacity reduction operation from the current TIME to the holding end TIME.
In the scheme, a stronger tenant isolation mode is provided by a soft isolation and hard isolation tenant isolation mode, so that the influence of mutual interference of resources among tenants is reduced, and meanwhile, the safety is ensured; and then, according to index data of each tenant in the cluster, a dynamic resource expanding and contracting strategy is configured, the tenant node resources are dynamically allocated, and the tenant resources are flexibly managed, so that the resource utilization rate is improved to the greatest extent, and meanwhile, the resource waste is reduced, and the tenant cost is reduced. Due to the dynamic nature of the resource configuration, the tenant may obtain higher performance according to the load variation. The system can automatically allocate more resources to meet high load demands, reduce the resources when the load is reduced, and improve the overall performance and the user experience. At the same time, with these schemes, a system administrator can manage and maintain the system more easily. The resource allocation and isolation are automatically completed, so that the risk of human errors caused by manual intervention is reduced.
Optionally, for example, the tenant resource allocation method provided in the present application includes:
s1001, node resources are allocated for the established tenants by adopting a hard isolation policy, and a cluster name space is established for the tenants by adopting a soft isolation policy.
S1002, index data of each tenant are obtained according to a cluster name space of each tenant in the cluster.
S1003, determining a resource adjustment value of each tenant according to index data of each tenant.
S1004, judging whether the resource adjustment value of the tenant is greater than or equal to 0, if so, determining the node resource of the expanded tenant, and executing step S1005; if not, determining node resources of the contractor, and executing step S1005.
S1005, judging whether the silence duration is within, if so, executing step S1006 to expand the capacity, and executing step S1007 to contract the capacity; if not, ending.
S1006, a first node list with the resource size larger than or equal to the resource adjustment value in the shared node pool is obtained, the first nodes in the first node list are distributed to tenants, and node labels and network access strategies are added to the first nodes.
S1007, a second node list with the resource size smaller than the resource adjustment value in the node pool of the tenant is obtained, a fourth node in the second node list is removed from the tenant, and the node label of the fourth node is deleted and the initial network access strategy is restored.
The following describes a device, equipment, a storage medium, etc. for executing the tenant resource allocation method provided in the present application, and specific implementation processes and technical effects of the device, the equipment, the storage medium, etc. refer to the foregoing, and the following is omitted.
Optionally, an embodiment of the present application provides a tenant resource allocation device, where the device includes:
an initialization module: the method comprises the steps of configuring to allocate node resources for a tenant which is created by adopting a hard isolation strategy, and creating a cluster naming space for the tenant by adopting a soft isolation strategy;
and the acquisition module is used for: the system comprises a tenant resource management system, a data acquisition module, an index storage module, a resource control module and a software data management module, wherein the tenant resource management system is configured to be built in a PaaS platform; the index acquisition module is used for periodically acquiring data of each tenant and determining index data of each tenant; the index storage module is used for storing the index data; the resource control module is used for determining a resource adjustment mode of the tenant according to the index data, and the tenant resources comprise a CPU and a memory; the software data management module is used for managing node resources; the tenant resource management system determines index data of each tenant corresponding to each cluster naming space;
And an analysis module: the tenant resource management system is configured to determine a resource adjustment mode of each tenant based on index data of each tenant corresponding to each cluster name space, wherein the resource adjustment mode comprises capacity expansion, capacity invariance and capacity shrinkage;
and an adjustment module: the tenant resource management system is configured to adjust the resources of each tenant based on the resource adjustment mode.
The foregoing apparatus is used for executing the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, and are not described herein again.
The above modules may be one or more integrated circuits configured to implement the above methods, for example: one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASIC), or one or more microprocessors (digital singnal processor, abbreviated as DSP), or one or more field programmable gate arrays (Field Programmable Gate Array, abbreviated as FPGA), or the like. For another example, when a module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
The modules may be connected or communicate with each other via wired or wireless connections. The wired connection may include a metal cable, optical cable, hybrid cable, or the like, or any combination thereof. The wireless connection may include a connection through a LAN, WAN, bluetooth, zigBee, or NFC, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units. It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the method embodiments, which are not described in detail in this application.
It should be noted that these above modules may be one or more integrated circuits configured to implement the above methods, for example: one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASIC), or one or more microprocessors (Digital Singnal Processor, abbreviated as DSP), or one or more field programmable gate arrays (Field Programmable Gate Array, abbreviated as FPGA), or the like. For another example, when a module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a System-on-a-chip (SOC).
The invention provides a specific embodiment of a tenant resource allocation device. The device comprises:
an allocation module 1101, configured to allocate node resources for the created tenant using a hard isolation policy;
a creating module 1102, configured to create a cluster namespace for a tenant by using a soft isolation policy;
the obtaining module 1103 is configured to obtain, according to a cluster namespace of each tenant in the cluster, index data of each tenant, where the index data at least includes: the method comprises the steps of allocating total resource sizes of all nodes allocated by a tenant, preset resource utilization rate, average resource utilization rate, service request resource sizes of the tenant, and the resource size of the largest node in all the nodes allocated by the tenant;
a determining module 1104, configured to determine whether to adjust node resources of each tenant according to the index data of each tenant;
and the adjusting module 1105 is configured to perform capacity expansion operation or capacity contraction operation on the node resources of each tenant if the node resources of each tenant are available.
Optionally, the determining module 1104 is further configured to:
determining a first resource adjustment value of the tenant according to the total resource size of all the nodes allocated by the tenant in the index data of the tenant, and the preset resource utilization rate and the average resource utilization rate;
and if the first resource adjustment value is greater than or equal to a first preset threshold value, determining node resources of the capacity-expanding tenant.
Optionally, the determining module 1104 is further configured to:
determining a second resource adjustment value of the tenant according to the service request resource size of the tenant, the total resource size of all the nodes allocated by the tenant and the resource size of the largest node in all the nodes allocated by the tenant;
and if the second resource adjustment value is greater than or equal to a second preset threshold value, determining node resources of the capacity-expanding tenant.
Optionally, the adjusting module 1105 is configured to:
determining whether the time interval between the current time and the last time of performing the capacity expansion operation is longer than the silence duration;
if yes, a first node list with the resource size larger than or equal to a first resource adjustment value or a second resource adjustment value in the shared node pool is obtained;
if the first node list is not empty, the first node in the first node list is distributed to the tenant, and a node label and a network access strategy are added to the first node.
Optionally, the adjusting module 1105 is further configured to:
if the first node list is empty, searching a node combination list of which the sum of the resources of the two nodes is greater than or equal to a first resource adjustment value or a second resource adjustment value from the shared node pool;
and distributing the second node and the third node in the node combination list to the tenant, and adding node labels and network access strategies to the second node and the third node respectively.
Optionally, the determining module 1104 is further configured to:
determining a first resource adjustment value of the tenant according to the total resource size of all the nodes allocated by the tenant in the index data of the tenant, and the preset resource utilization rate and the average resource utilization rate;
and if the first resource adjustment value is smaller than a first preset threshold value, determining node resources of the contractual tenant.
Optionally, the determining module 1104 is further configured to:
determining a second resource adjustment value of the tenant according to the service request resource size of the tenant, the total resource size of all the nodes allocated by the tenant and the resource size of the largest node in all the nodes allocated by the tenant;
if the second resource adjustment value is smaller than a second preset threshold value, acquiring a fluctuation factor of the tenant;
and if the summation result of the second resource adjustment value and the fluctuation factor is smaller than a second preset threshold value, determining node resources of the contractual tenant.
Optionally, the adjusting module 1105 is further configured to:
determining whether the time interval between the current time and the last time of performing the capacity expansion operation is longer than the silence duration;
if yes, a second node list of which the resource size is smaller than the first resource adjustment value or the second resource adjustment value in the node pool of the tenant is obtained;
And removing the fourth node in the second node list from the tenant, deleting the node label of the fourth node and recovering the initial network access strategy.
The foregoing apparatus is used for executing the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, and are not described herein again.
Fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device is a computing device with a data processing function.
The device comprises: processor 1201, memory 1202.
The memory 1202 is used for storing a program, and the processor 1201 calls the program stored in the memory 1202 to execute the above-described method embodiment. The specific implementation manner and the technical effect are similar, and are not repeated here.
Therein, the memory 1202 stores program code that, when executed by the processor 1201, causes the processor 1201 to perform various steps in a configuration updating method of a cloud platform virtual machine according to various exemplary embodiments of the present application described in the above-described "exemplary methods" section of the present specification.
The processor 1201 may be a general purpose processor such as a Central Processing Unit (CPU), digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, and may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution.
Memory 1202 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory may include at least one type of storage medium, which may include, for example, flash Memory, hard disk, multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic Memory, magnetic disk, optical disk, and the like. The memory is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 1202 in the present embodiment may also be circuitry or any other device capable of implementing a memory function for storing program instructions and/or data.
Optionally, the present application also provides a program product, such as a computer readable storage medium, comprising a program for performing the above-described method embodiments when being executed by a processor.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.

Claims (10)

1. A tenant resource allocation method, the method comprising:
step S1: node resources are allocated for the established tenants by adopting a hard isolation strategy, and a cluster naming space is established for the tenants by adopting a soft isolation strategy;
step S2: building a tenant resource management system in a PaaS platform, wherein the tenant resource management system comprises an index acquisition module, an index storage module, a resource control module and a software data management module; the index acquisition module is used for periodically acquiring data of each tenant and determining index data of each tenant; the index storage module is used for storing the index data; the resource control module is used for determining a resource adjustment mode of the tenant according to the index data; the software data management module is used for managing node resources; the tenant resource management system determines index data of each tenant corresponding to each cluster naming space;
Step S3: the tenant resource management system determines a resource adjustment mode of each tenant based on index data of each tenant corresponding to each cluster namespace, wherein the resource adjustment mode comprises capacity expansion, capacity invariance and capacity shrinkage;
step S4: and the tenant resource management system adjusts the resources of each tenant based on the resource adjustment mode.
2. The method according to claim 1, wherein said step S2: the tenant resource management system determines index data of each tenant corresponding to each cluster naming space, wherein the index data at least comprises: the method comprises the steps of setting the total resource size n of all node resources allocated by a tenant, the preset resource utilization rate S, the average resource utilization rate U, the service request resource size R of the tenant, and the resource size c of the largest node resource in all node resources allocated by the tenant.
3. The method of claim 2, wherein the step S3, the tenant resource management system determining the resource adjustment mode of each tenant based on the index data of each tenant corresponding to each cluster namespace, includes:
step S301: the tenant resource management system determines a first resource adjustment value of the tenant according to the total resource size of all node resources allocated by the tenant in the index data of the tenant, a preset resource utilization rate and an average resource utilization rate;
Step S302: if the first resource adjustment value is greater than or equal to a first preset threshold value, determining that the resource adjustment mode of the tenant is node resources of the expanded tenant;
the first resource adjustment value P1 is specifically as follows:
4. the method of claim 2, wherein the step S3, the tenant resource management system determining the resource adjustment mode of each tenant based on the index data of each tenant corresponding to each cluster namespace, includes:
step S311: determining a second resource adjustment value of the tenant according to the service request resource size of the tenant, the total resource size of all the nodes allocated by the tenant and the resource size of the largest node in all the nodes allocated by the tenant;
step S312: if the second resource adjustment value is greater than or equal to a second preset threshold value, determining that the resource adjustment mode of the tenant is node resources of the expanded tenant;
the second resource adjustment value P2 is specifically as follows:
5. the method of any of claims 3-4, wherein after determining that the tenant's resource adjustment manner is to expand the tenant's node resources, performing the following operations:
dividing 24 hours a day according to preset time length, wherein each divided time period is used as a time interval; determining a time interval corresponding to the current time, and marking the current time interval as a capacity expansion required;
Acquiring historical data of a current time interval, wherein marks of time intervals in a plurality of continuous days which are nearest to the current DATE are recorded in the historical data, and the accumulated days of the historical data are recorded as DATE; obtaining marks of all time intervals corresponding to the current time interval in the historical data; determining the net capacity expansion times corresponding to the current time interval, wherein the net capacity expansion times are obtained values of the total number of the capacity expansion to be performed minus the total number of the capacity contraction to be performed in the obtained marks, and if the net capacity expansion times corresponding to the current time interval are greater than 0, calculating the sum of days of which the net capacity expansion times corresponding to each time interval corresponding to the current time interval in the historical data are greater than 0, and marking the sum as T; the probability of capacity expansion in the current time interval is P3, and P3=T/DATE;
if the P3 exceeds the preset probability P, the capacity is expanded; after capacity expansion, setting an inertial holding TIME TIME, taking the sum of the current TIME and the inertial holding TIME TIME as a holding end TIME, and not executing capacity reduction operation from the current TIME to the holding end TIME.
6. The method of claim 2, wherein the step S3, the tenant resource management system determining the resource adjustment mode of each tenant based on the index data of each tenant corresponding to each cluster namespace, includes:
Step S321: determining a first resource adjustment value of the tenant according to the total resource size of all the resource nodes allocated by the tenant in the index data of the tenant, and the preset resource utilization rate and the average resource utilization rate;
step S322: and if the first resource adjustment value is smaller than a first preset threshold value, determining node resources of the contractual tenant.
7. The method of claim 2, wherein after determining node resources of the scaled tenant, performing the following:
dividing 24 hours a day according to preset time length, wherein each divided time period is used as a time interval; determining a time interval corresponding to the current time, and marking the current time interval as a volume needing to be contracted;
acquiring historical data of a current time interval, wherein marks of time intervals in a plurality of continuous days which are nearest to the current DATE are recorded in the historical data, and the accumulated days of the historical data are recorded as DATE; obtaining marks of all time intervals corresponding to the current time interval in the historical data; determining the net capacity reduction times corresponding to the current time interval, wherein the net capacity reduction times are the obtained values of the total number of the capacity reduction required to be performed minus the total number of the capacity expansion required to be performed in the marks, and if the net capacity reduction times corresponding to the current time interval are greater than 0, calculating the sum of days, in the historical data, of which the net capacity reduction times corresponding to each time interval corresponding to the current time interval are greater than 0, and marking the sum as T1; the probability of capacity expansion in the current time interval is P4, and P4=T1/DATE; setting an inertia holding TIME;
If P4 exceeds the preset probability P and the starting time of the current time interval exceeds the inertia holding time, carrying out stepwise capacity reduction; and after the capacity reduction, taking the sum of the current TIME and the inertia holding TIME TIME as a holding end TIME, and not executing the capacity reduction operation from the current TIME to the holding end TIME.
8. A tenant resource allocation apparatus, the apparatus comprising:
an initialization module: the method comprises the steps of configuring to allocate node resources for a tenant which is created by adopting a hard isolation strategy, and creating a cluster naming space for the tenant by adopting a soft isolation strategy;
and the acquisition module is used for: the system comprises a tenant resource management system, a data acquisition module, an index storage module, a resource control module and a software data management module, wherein the tenant resource management system is configured to be built in a PaaS platform; the index acquisition module is used for periodically acquiring data of each tenant and determining index data of each tenant; the index storage module is used for storing the index data; the resource control module is used for determining a resource adjustment mode of the tenant according to the index data, and the tenant resources comprise a CPU and a memory; the software data management module is used for managing node resources; the tenant resource management system determines index data of each tenant corresponding to each cluster naming space;
And an analysis module: the tenant resource management system is configured to determine a resource adjustment mode of each tenant based on index data of each tenant corresponding to each cluster name space, wherein the resource adjustment mode comprises capacity expansion, capacity invariance and capacity shrinkage;
and an adjustment module: the tenant resource management system is configured to adjust the resources of each tenant based on the resource adjustment mode.
9. A tenant resource allocation apparatus, the apparatus comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-7.
CN202410154797.4A 2024-02-04 Tenant resource allocation method, device, equipment and storage medium Active CN117687803B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410154797.4A CN117687803B (en) 2024-02-04 Tenant resource allocation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410154797.4A CN117687803B (en) 2024-02-04 Tenant resource allocation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117687803A true CN117687803A (en) 2024-03-12
CN117687803B CN117687803B (en) 2024-04-30

Family

ID=

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160323880A1 (en) * 2015-04-30 2016-11-03 Futurewei Technologies, Inc. Application Driven and Adaptive Unified Resource Management For Data Centers with Multi-Resource Schedulable Unit (MRSU)
CN106663035A (en) * 2014-07-10 2017-05-10 甲骨文国际公司 System and method for resource isolation and consumption in a multitenant application server environment
CN109845303A (en) * 2016-09-30 2019-06-04 华为技术有限公司 The management method and administrative unit of network slice
CN113986528A (en) * 2021-09-29 2022-01-28 济南浪潮数据技术有限公司 Method, system, equipment and storage medium for multi-tenant space resource management
CN115801775A (en) * 2022-09-07 2023-03-14 中国建设银行股份有限公司 Distributed micro-service platform resource configuration method and device
CN116126542A (en) * 2023-02-22 2023-05-16 多点(深圳)数字科技有限公司 Cluster resource allocation method, device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106663035A (en) * 2014-07-10 2017-05-10 甲骨文国际公司 System and method for resource isolation and consumption in a multitenant application server environment
US20160323880A1 (en) * 2015-04-30 2016-11-03 Futurewei Technologies, Inc. Application Driven and Adaptive Unified Resource Management For Data Centers with Multi-Resource Schedulable Unit (MRSU)
CN109845303A (en) * 2016-09-30 2019-06-04 华为技术有限公司 The management method and administrative unit of network slice
CN113986528A (en) * 2021-09-29 2022-01-28 济南浪潮数据技术有限公司 Method, system, equipment and storage medium for multi-tenant space resource management
CN115801775A (en) * 2022-09-07 2023-03-14 中国建设银行股份有限公司 Distributed micro-service platform resource configuration method and device
CN116126542A (en) * 2023-02-22 2023-05-16 多点(深圳)数字科技有限公司 Cluster resource allocation method, device and storage medium

Similar Documents

Publication Publication Date Title
US9319281B2 (en) Resource management method, resource management device, and program product
US20200348863A1 (en) Snapshot reservations in a distributed storage system
CN107426274B (en) Method and system for service application and monitoring, analyzing and scheduling based on time sequence
CN111880936B (en) Resource scheduling method, device, container cluster, computer equipment and storage medium
CN105049268A (en) Distributed computing resource allocation system and task processing method
CN111522636B (en) Application container adjusting method, application container adjusting system, computer readable medium and terminal device
CN103019853A (en) Method and device for dispatching job task
CN108900626B (en) Data storage method, device and system in cloud environment
CN111459641B (en) Method and device for task scheduling and task processing across machine room
CN108574645B (en) Queue scheduling method and device
CN112925607A (en) System capacity expansion and contraction method and device and electronic equipment
CN103455433A (en) Memory management method and system
JP2016086225A (en) Network system, program for gateway device, and program for management device
CN114579296A (en) Server idle calculation scheduling method and device and electronic equipment
CN112269661A (en) Partition migration method and device based on Kafka cluster
CN111988160B (en) Method and device for deploying virtualized network function
CN114565502A (en) GPU resource management method, scheduling method, device, electronic equipment and storage medium
WO2016121879A1 (en) Virtualization control apparatus, arrangement destination selecting method and program
CN117687803B (en) Tenant resource allocation method, device, equipment and storage medium
CN110471759B (en) Method for dynamically managing memory of multi-core embedded processor in real time
CN112631680A (en) Micro-service container scheduling system, method, device and computer equipment
CN110543357B (en) Method, related device and system for managing application program object
CN117687803A (en) Tenant resource allocation method, device, equipment and storage medium
WO2015167453A1 (en) Computing system management using shared memory
CN112346848A (en) Method, device and terminal for managing memory pool

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant