CN116136792A - Method, device, equipment and storage medium for expanding and shrinking computing resources of database - Google Patents

Method, device, equipment and storage medium for expanding and shrinking computing resources of database Download PDF

Info

Publication number
CN116136792A
CN116136792A CN202111359373.4A CN202111359373A CN116136792A CN 116136792 A CN116136792 A CN 116136792A CN 202111359373 A CN202111359373 A CN 202111359373A CN 116136792 A CN116136792 A CN 116136792A
Authority
CN
China
Prior art keywords
time period
service
fluctuation
preset
load
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.)
Pending
Application number
CN202111359373.4A
Other languages
Chinese (zh)
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.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
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 China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202111359373.4A priority Critical patent/CN116136792A/en
Publication of CN116136792A publication Critical patent/CN116136792A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses a method, a device, equipment and a storage medium for expanding and shrinking computing resources of a database, wherein the method comprises the following steps: acquiring transaction number TPS per second, query number QPS per second and new order number tpmC processed by the system per minute of the computing resource in a preset time period; determining a traffic fluctuation index within the preset time period based on the TPS, the QPS and the tpmC, wherein the traffic fluctuation index is used for representing fluctuation of traffic load of the computing resource within the preset time period; and under the condition that the service fluctuation index is determined to be larger than a service fluctuation threshold, expanding or shrinking the capacity of the computing resource. Therefore, the load calculation unit is reasonably allocated based on the calculated service fluctuation index, the problem of service interruption caused by error capacity expansion and capacity shrinkage can be reduced, and the influence on database service is avoided.

Description

Method, device, equipment and storage medium for expanding and shrinking computing resources of database
Technical Field
The embodiment of the application relates to the technical field of cloud computing, and relates to a computing resource expanding and shrinking method, device, equipment and storage medium of a database.
Background
The coming of big data age, the demand of various application programs for relational and non-relational databases is increasing, and cloud database service is far lower than the cost advantage required by self-built databases, and more cloud service providers provide cloud database service. Cloud databases refer to databases optimized or deployed into a virtual computing environment, which can realize the advantages of pay-per-view, expansion-on-demand, high availability, storage integration, and the like. Along with the continuous expansion of the market scale of the cloud database, the corresponding bottom cluster scale of the cloud database is also continuously increased, so that the hardware utilization rate is low, the resources are difficult to use and elastically expand really as required, and the higher operation cost is brought.
In the process of upgrading and downgrading specifications of the existing cloud database cluster, frequent upgrading and downgrading can influence stability of the cloud database cluster, and error capacity expansion or capacity shrinkage can cause problem data.
Disclosure of Invention
In view of this, in order to solve at least one problem in the prior art, the embodiments of the present application provide a method, an apparatus, a device, and a storage medium for expanding and contracting computing resources of a database, which at least solve the problem in the prior art that in a process of upgrading and downgrading a specification, frequent upgrading and downgrading may affect stability of a cloud database cluster, and error capacity expansion or capacity contraction may cause problem data.
The technical scheme of the embodiment of the application is realized as follows:
in a first aspect, an embodiment of the present application provides a method for scaling computing resources of a database, where the method includes: acquiring transaction number TPS per second, query number QPS per second and new order number tpmC processed by the system per minute of the computing resource in a preset time period; determining a traffic fluctuation index within the preset time period based on the TPS, the QPS and the tpmC, wherein the traffic fluctuation index is used for representing fluctuation of traffic load of the computing resource within the preset time period; and under the condition that the service fluctuation index is determined to be larger than a service fluctuation threshold, expanding or shrinking the capacity of the computing resource.
In a second aspect, an embodiment of the present application provides a computing resource scaling apparatus for a database, where the apparatus includes: the acquisition module is used for acquiring the transaction number TPS per second, the query number QPS per second and the new order number tpmC processed by the system per minute of the computing resource in a preset time period; a determining module, configured to determine a traffic fluctuation indicator within the preset time period based on the TPS, the QPS, and the tpmC, where the traffic fluctuation indicator is used to characterize a fluctuation of a traffic load of the computing resource within the preset time period; and the expansion and contraction module is used for expanding or contracting the capacity of the computing resource under the condition that the service fluctuation index is determined to be larger than a service fluctuation threshold value.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, where the memory stores a computer program executable on the processor, and where the processor implements the method described above when executing the program.
In a fourth aspect, embodiments of the present application provide a storage medium storing executable instructions for causing a processor to perform the above-described method.
In the embodiment of the application, the tpmC, TPS and QPS are utilized to calculate the service fluctuation index in the preset time period, and whether the expansion and contraction is carried out is determined according to the service fluctuation index. Therefore, the load calculation unit is reasonably allocated based on the calculated service fluctuation index, the problem of service interruption caused by error capacity expansion and capacity shrinkage can be reduced, and the influence on database service is avoided. The problem that in the prior art, in the process of upgrading and downgrading specifications, frequent upgrading and downgrading can influence the stability of a cloud database cluster, and error capacity expansion or capacity shrinkage can cause problem data is solved. The dynamic capacity expansion and contraction of the database is realized according to the service load of the user, the utilization rate of hardware equipment can be improved, the capacity expansion is realized when the service load is higher, the capacity contraction is realized when the service is low, the use cost of the user is saved, the payment of the user according to the need is truly realized, and better use experience is brought to the user.
Drawings
Fig. 1 is a schematic implementation flow chart of a computing resource scaling method of a database according to an embodiment of the present application;
fig. 2 is a schematic implementation flow chart of a computing resource scaling method of a database according to an embodiment of the present application;
fig. 3 is a schematic implementation flow chart of a computing resource scaling method of a database according to an embodiment of the present application;
fig. 4A is a schematic diagram of a cloud database system architecture based on elastic expansion and contraction of a service load according to an embodiment of the present application;
fig. 4B is an internal logic flow diagram of a service load scaling cloud database cluster according to an embodiment of the present application;
FIG. 4C is a logic flow diagram of an internal logic of a new computing unit according to a traffic load provided in an embodiment of the present application;
FIG. 4D is a flow chart illustrating the internal logic of a reduced computation unit according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a computing resource scaling device of a database according to an embodiment of the present application;
fig. 6 is a schematic diagram of a hardware entity of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes, technical solutions and advantages of the embodiments of the present application to be more apparent, the following detailed description of the specific technical solutions of the present invention will be further described with reference to the accompanying drawings in the embodiments of the present application. The following examples are illustrative of the present application, but are not intended to limit the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
In the following description, the terms "first", "second", "third" and the like are merely used to distinguish similar objects and do not represent a specific ordering of the objects, it being understood that the "first", "second", "third" may be interchanged with a specific order or sequence, as permitted, to enable embodiments of the application described herein to be practiced otherwise than as illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
Before further describing embodiments of the present application in detail, the terms and expressions that are referred to in the embodiments of the present application are described, and are suitable for the following explanation.
Kubernetes: the functions of automatic deployment, automatic expansion and contraction, maintenance and the like of the container cluster can be realized by simply called K8s, and the minimum resource scheduling unit of the running container on the K8s is Pod. Pod controllers include replication controllers (replicalcontrollers), deployments (reploments), duplicate sets (ReplicaSet), and StatefulSets, where StatefulSets resemble Deployments for managing stateful applications.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
It should be understood that some embodiments described herein are merely used to explain the technical solutions of the present application, and are not used to limit the technical scope of the present application.
The embodiment of the application provides a method for expanding and contracting computing resources of a database, as shown in fig. 1, the method includes:
step S110, acquiring transaction number TPS per second, query number QPS per second and new order number tpmC processed by the system per minute of the computing resource in a preset time period;
here, TPS (Transaction Per Second) denotes the number of transactions per second; QPS (Query Per Second) indicates the number of queries per second, which can intuitively reflect the performance of the system, and a larger value indicates a larger throughput of the server, and a higher load of the server is also often. tpmC, which is the abbreviation for the number of tasks (transactionsper minute) processed by the system per minute, represents the number of new orders processed by the system per minute and is widely used to measure the transactional capability of the computer system; c refers to the C reference procedure in TPC.
In the implementation process, a preset time period meeting the actual requirement can be set first, the load change of the computing resource can be reflected in the preset time period, and TPS, QPS and tpmC at a plurality of time points in the preset time period need to be acquired first.
Step S120, determining a service fluctuation index in the preset time period based on the TPS, the QPS and the tpmC, wherein the service fluctuation index is used for representing fluctuation of service load of the computing resource in the preset time period;
in an implementation process, a traffic fluctuation index of the preset time period can be determined based on the acquired TPS, QPS and tpmC at each time point, and the traffic fluctuation index can represent fluctuation of traffic load of the computing resource in the preset time period.
And step S130, expanding or shrinking the computing resource under the condition that the service fluctuation index is determined to be larger than a service fluctuation threshold.
In the embodiment of the application, the tpmC, TPS and QPS are utilized to calculate the service fluctuation index in the preset time period, and whether the expansion and contraction is carried out is determined according to the service fluctuation index. Therefore, the load calculation unit is reasonably allocated based on the calculated service fluctuation index, the problem of service interruption caused by error capacity expansion and capacity shrinkage can be reduced, and the influence on database service is avoided. The problem that in the prior art, in the process of upgrading and downgrading specifications, frequent upgrading and downgrading can influence the stability of a cloud database cluster, and error capacity expansion or capacity shrinkage can cause problem data is solved. The dynamic capacity expansion and contraction of the database is realized according to the service load of the user, the utilization rate of hardware equipment can be improved, the capacity expansion is realized when the service load is higher, the capacity contraction is realized when the service is low, the use cost of the user is saved, the payment of the user according to the need is truly realized, and better use experience is brought to the user. The problem of the current technique that the resources are difficult to be used as required and the resources are elastically expanded, thereby bringing higher operation cost is solved.
The embodiment of the application provides a method for expanding and contracting computing resources of a database, as shown in fig. 2, the method includes:
step S210, acquiring transaction number TPS per second, query number QPS per second and new order number tpmC processed by the system per minute of the computing resource in a preset time period;
step S220, dividing the preset time period into L preset sub-time periods, wherein L is an integer greater than or equal to 1;
here, the preset time may be divided into finer time units according to actual demands, for example, in the case where the preset time period is 5 minutes, 5 minutes may be divided into 5 sub-time periods, that is, 1 minute is 1 preset sub-time period.
Step S230, acquiring TPS, QPS and tpmC in a j-th preset sub-time period, wherein j is an integer less than or equal to L;
step S240, determining a first service load index corresponding to the jth preset sub-period based on TPS, QPS and tpmC in the jth preset sub-period;
for example, the preset sub-period of each minute may be calculated in units of 60 seconds, first obtain TPS, QPS, and tpmC within the 60 seconds, and then determine the first traffic load index corresponding to the preset sub-period of each minute based on TPS, QPS, and tpmC within the 60 seconds.
Step S250, determining a business fluctuation index in the preset time period based on L first business load indexes;
under the condition that the preset time period is 5 minutes, according to the calculated Q value of the first service load index in the time range of the last 5 minutes, namely under the condition that the L value is 5, the Q value of the last 5 minutes can be taken to participate in calculation of W, the larger the Q value calculation weight is close to the current moment, the larger the value range of the service fluctuation index W is [0,1], and the larger the value is, the larger the fluctuation amplitude of the first service load index Q is reflected.
Step S260, under the condition that the service fluctuation index is determined to be larger than a service fluctuation threshold, expanding or shrinking the computing resource;
and step S270, keeping the computing resource unchanged under the condition that the business fluctuation index is smaller than or equal to a business fluctuation threshold value.
The absolute value of the fluctuation amplitude of the first service load index does not exceed a set threshold value, so that the condition that the service load does not have obvious fluctuation can be judged, the number of the computing units is kept unchanged, and the computing resources are not expanded horizontally and longitudinally.
In this embodiment, the preset time period is first divided into L preset sub-time periods, then a first traffic load index corresponding to the jth preset sub-time period is determined based on TPS, QPS and tpmC in the jth preset sub-time period, and finally a traffic fluctuation index in the preset time period is determined based on the L first traffic load indexes. Therefore, a proper preset sub-time period can be divided according to actual requirements, and service fluctuation indexes are effectively obtained based on TPS, QPS and tpmC in the preset sub-time period.
In the embodiment of the application, the absolute value of the fluctuation amplitude of the first service load index does not exceed the set threshold, so that the service load can be judged to be obviously fluctuated, the number of the computing units is kept unchanged at the moment, and the computing resources are not expanded horizontally and longitudinally, so that the cluster operation and the user service stability are kept.
The step S240 "determining the first traffic load index corresponding to the jth preset sub-period based on the TPS, QPS and tpmC in the jth preset sub-period" may be implemented by:
s241, obtaining second service load indexes in a j-th preset sub-time period, wherein the second service load indexes are obtained by carrying out weighted average on the TPS and the QPS, and N is an integer greater than or equal to 1;
here, P may be used to represent the second traffic as a weighted average of the load metrics, i.e. the metrics TPS, QPS related to the traffic load, and its calculation formula (1) is as follows:
P=a·TPS+b·QPS (1);
wherein, the calculation formula adopts the accumulated aggregate values of two indexes (TPS, QPS), the weight values of a and b are respectively 0.5 and 0.5, and the calculation weights can be set by self-defining the values of a and b.
Step S242, determining a first traffic load index in the jth preset sub-period based on the second traffic load index in the nth preset sub-period and the tpmC.
Here, the first traffic load index Q may be determined based on the following formula (2):
Figure BDA0003358530270000071
wherein M represents the number of data points, P i Indicating that the i-th load index is present,
Figure BDA0003358530270000072
the average load index of the M load indices, i.e. the weighted average of the indices TPS, QPS related to the traffic load, is represented.
In the embodiment of the present application, weighted average is performed on the TPS and the QPS, so as to obtain the second traffic load index effectively; and based on the second service load indexes in the Nth preset sub-time period and the tpmC, effectively determining the first service load indexes in the jth preset sub-time period.
The step S242 "determining the first traffic load index in the j-th preset sub-period based on the second traffic load index in the N-th preset sub-period and the tpmC" may be implemented by:
step S2421, determining M second traffic load indexes meeting a preset requirement from the second traffic load indexes in the N j-th preset sub-time periods, where M is an integer less than or equal to N;
in order to eliminate calculation errors caused by incomplete effective index values due to data point acquisition errors or abnormal large or small TPS and QPS values of the second service load index P at a certain time point, M second service load indexes meeting preset requirements can be determined from the second service load indexes in the Nth preset sub-time period.
Step S2422, determining a first traffic load index in the j-th preset sub-period based on the M second traffic load indexes and the tpmC.
In this embodiment, M second traffic load indexes meeting preset requirements are determined, and the second traffic load indexes with abnormally large TPS and QPS values or abnormally small TPS and QPS values may be removed, so as to reduce calculation errors.
The step S2421 "determining M second traffic load indexes meeting the preset requirement from the second traffic load indexes in the N j-th preset sub-time periods" may be implemented by the following steps:
step A, averaging the second business load indexes in the Nth preset sub-time period to obtain an average value of the second business load indexes in the jth sub-time period;
step B, obtaining the variance of the second business load index in the j preset sub-time period based on the second business load index in the N j preset sub-time periods and the average value of the second business load index;
and C, determining M second business load indexes from N second business load indexes in the j preset sub-time period based on the average value of the second business load indexes and the variance of the second business load indexes.
For example, in the case that the preset sub-period is 1 minute, the second traffic load index P value, the average value, may be calculated by calculating the last 1 minute at 1s time interval
Figure BDA0003358530270000081
Variance sigma 2 Only within the interval
Figure BDA0003358530270000082
The M data points within participate in the calculation of the first traffic load index Q value.
In the embodiment of the application, the second service load index P value and the average value are calculated
Figure BDA0003358530270000083
Variance sigma 2 Only the range of the interval is adopted>
Figure BDA0003358530270000084
The M data points in the data processing unit participate in the calculation of the Q value of the first service load index, so that calculation errors caused by incomplete effectiveness of index values due to data point acquisition errors or abnormal large or abnormal small values of TPS and QPS of the second service load index P at a certain time point can be eliminated, and the abnormal large and abnormal small values can be filtered.
The embodiment of the application provides a method for expanding and contracting computing resources of a database, as shown in fig. 3, the method includes:
step S310, acquiring transaction number TPS per second, query number QPS per second and new order number tpmC processed by the system per minute of the computing resource in a preset time period;
step 320, dividing the preset time period into L preset sub-time periods, where L is an integer greater than or equal to 1;
Step S330, acquiring TPS, QPS and tpmC in a j-th preset sub-time period, wherein j is an integer less than or equal to L;
step S340, determining a first service load index corresponding to the jth preset sub-period based on TPS, QPS and tpmC in the jth preset sub-period;
step 350, obtaining the difference value and the sum value of the first service load index in the j+1th preset sub-time period and the first service load index in the j preset sub-time period in the L first service load indexes;
step S360, carrying out weighted summation operation on the values obtained by dividing L differences by the summation value to obtain a service fluctuation index in the preset time period;
the traffic fluctuation index W within the preset time period may be calculated using the following formula (3):
Figure BDA0003358530270000091
wherein Q is j 、Q j+1 The first traffic load index Q is j time and one minute after j time, respectively.
Step S370, under the condition that the service fluctuation index is larger than a service fluctuation threshold, acquiring a first service load index corresponding to an L-th sub-time period and a first service load index corresponding to an L-1 th sub-time period in the L preset sub-time periods;
step S380, expanding the computing resource under the condition that the first business load index corresponding to the L-1 th subperiod is determined to be larger than the first business load index corresponding to the L-1 th subperiod;
And when abnormal fluctuation of the service load is determined, and the current first service load index Q value is larger than the first service load index Q value of the previous minute, abnormal rising of the service load can be judged, and the capacity of the computing resource is expanded.
Step S390, performing capacity reduction on the computing resource when it is determined that the first traffic load index corresponding to the L-th sub-period is smaller than the first traffic load index corresponding to the L-1 th sub-period.
And when abnormal fluctuation of the service load is determined, and the current first service load index Q value is smaller than the first service load index Q value of the previous minute, abnormal drop of the service load can be judged, and the computing resource is contracted.
In this embodiment of the present application, first, a difference value and a summation value of a first traffic load index in a j+1th preset sub-period in L first traffic load indexes and a first traffic load index in the j preset sub-period are obtained, and then a weighted summation operation is performed on a value obtained by dividing L difference values by the summation value, so that a traffic fluctuation index in the preset period can be effectively obtained.
In the embodiment of the application, when abnormal fluctuation of the service load is determined, and the current first service load index Q value is larger than the first service load index Q value of the previous minute, abnormal rising of the service load can be judged, and the computing resource is expanded; and when abnormal fluctuation of the service load is determined, and the current first service load index Q value is smaller than the first service load index Q value of the previous minute, abnormal drop of the service load can be judged, and the computing resource is contracted.
The service of the cloud database can run in the K8s cluster in the form of Pod, the horizontal automatic expansion and contraction means that the number of copies of the K8s resource can be increased or reduced, and the vertical expansion and contraction means that the central processing unit (Central Processing Unit, CPU) and the memory resource size of the Pod can be changed so as to achieve the purpose of expanding and contracting the cluster. Pod level auto-scaling (Horizontal Pod Autoscaler) can scale the number of Pods in ReplicationController, deployment, replicaSet and StateFulSet automatically based on CPU utilization. In addition to CPU utilization, automatic scaling may also be performed based on custom metrics provided by other applications.
The prior art scheme is to realize dynamic expansion and contraction of the database according to the service load of the user, and generally adopts a horizontal and longitudinal expansion and contraction mode to upgrade or downgrade the copy or specification of the cloud database cluster. Because the number or specification of Pod in ReplicationController, deployment, replicaSet and StateFulSet are directly expanded or contracted in the expansion and contraction process of the database cluster, service flashover or intermittent interruption can be unavoidable, and the database storage data can be lost when serious, which also has difficult to predict influence on the existing service of a user.
The prior art has the following disadvantages:
(1) By adopting a mode of upgrading or degrading the specification of the cloud database cluster, service flash or intermittent interruption cannot be avoided in the process of expanding and shrinking the capacity of the database cluster;
(2) In the process of upgrading and downgrading the specification of the cloud database cluster, the problem of losing or generating inconsistent data on the database persistent data can be caused. Particularly in the demotion process, cluster demotion failure may be caused to cause abnormal unavailable situations of clusters, and even influence on user data which is difficult to predict is caused.
With the progress of technology, network bandwidth is also becoming faster and faster, and network bandwidth is no longer a bottleneck affecting data processing, but the disk Input/Output (I/O) speed of a computer is not significantly increased, and architecture defects of computing and storage integration are gradually exposed. As the drawbacks of computing and storage coupling are increasing and network speeds are increasing, the architecture now is again beginning to evolve in a direction of separation of computing and storage. "separation of computation and storage" is the main direction of development for future databases.
The embodiment of the application provides a cloud database system architecture diagram based on business load elastic expansion and contraction, as shown in fig. 4A, the system architecture diagram includes: a processing unit 41, a monitoring unit 42, a computing resource 43 and a storage unit 44 are connected, wherein,
The connection processing unit 41 is used for forwarding the traffic to the computing resources 43 of the corresponding cloud database. The connection processing unit 41 is directly connected to the user so that the user does not need to directly connect to the underlying database; the user may learn about the changes of the entire cloud database background service through the connection processing unit 41 so that the entire cloud database background service is completely transparent to the user.
The monitoring unit 42 is configured to count traffic load, CPU, and memory consumption in real time, and perform longitudinal or horizontal expansion and contraction operations according to the number of copies of the computing resource 43 and corresponding monitoring indexes of the computing resource 43. The storage unit 44 of the cloud database is not involved in the whole scaling process, so that no influence is exerted on the persistent database.
And the computing resource 43 is used for completing the computing task of the cloud database and comprises a plurality of computing units such as A, B … … N and the like.
And a storage unit 44 for storing data in the cloud database.
The cloud database system architecture provided by the application adopts the separation of calculation and storage, automatically expands and contracts capacity based on the actual load condition, can be applied to development and test environments, websites and application programs with infrequent, intermittent or unpredictable workload, charges according to the actual use amount, and greatly saves database cost. The computing resource of the cloud database is a stateless service and is used for processing a database read-write request of a user, analyzing a corresponding SQL grammar, interacting with the storage unit and acquiring and updating database data stored by the storage unit.
The embodiment of the application provides an internal logic flow chart of a service load scaling cloud database cluster, as shown in fig. 4B, the method includes:
step S410, connecting a cloud database system by a user;
firstly, computing resources of a cloud database cluster need to be initialized; in some embodiments, the cloud database may configure the computing resource CPU, N different levels of specification of the memory gradient up, for example, CPU1 core memory 2Gi, CPU2 core memory 4Gi, CPU4 core memory 16Gi, CPU8 core memory 64Gi, under initialization. An upper and lower limit on the number of computing resources may also be configured, for example, an upper limit on the number of computing resources may be configured as N and a lower limit as 1.
In some embodiments, only one minimum first-file specification computing unit may be initially created, and user requests are all forwarded to the only computing unit. In practice, as shown in fig. 4A, a minimum first-gear specification of the computing units a may be created, and the user request may be forwarded to the computing unit a in the computing unit 43 through the connection processing unit 41.
Then, a connection processing unit and a monitoring unit of the cloud database cluster are established; the monitoring unit counts the service load in real time and monitors the indexes of CPU and memory consumption of each computing unit. In implementation, as shown in fig. 4A, the detection unit 42 may implement statistical traffic load, and the CPU and the memory consumption monitor index of each calculation unit (for example, A, B).
Step S420, the connection processing unit acquires the service load in the time period;
here, the traffic load includes a first traffic load index and a second traffic load index.
In some embodiments, the second traffic load indicator, i.e. the weighted average of the traffic load related indicators TPS, QPS, may be denoted by P, which is calculated as follows:
P=a·TPS+b·QPS (1);
wherein TPS (Transaction Per Second) represents transactions per second; QPS (Query Per Second) indicates the number of queries per second, which can intuitively reflect the performance of the system, and a larger value indicates a larger throughput of the server, and a higher load of the server is also often. The calculation formula adopts the accumulated aggregation values of two indexes (TPS and QPS), wherein the weight values of a and b are respectively 0.5 and 0.5, and the aggregation time range and the calculation weight can be set by self-defining the values of a and b.
In order to eliminate calculation errors caused by incomplete effectiveness of index values due to data point acquisition errors or abnormal large or small TPS and QPS values at a certain time point of the second traffic load index P. Under the condition that the preset sub-time period is 1 minute, the P value and the average value corresponding to the monitoring index sampling point can be calculated according to the time interval of 1s in the last 1 minute
Figure BDA0003358530270000131
Variance sigma 2 Only the range of the interval is adopted>
Figure BDA0003358530270000132
M data points in the network participate in the calculation of the Q value of the first traffic load index, so as to filter out abnormally large and abnormally small values. The first traffic load index Q calculation formula (2) is as follows:
Figure BDA0003358530270000133
wherein the first traffic load index Q value is determined by a fluctuation amplitude factor of the load in the reaction time range and a size factor of the traffic load, and in some embodiments, the larger the traffic load fluctuation, the larger the traffic load, and the corresponding first traffic load index Q is.
In the case where the preset time period is 5 minutes, the traffic fluctuation index W may be calculated according to the calculated first traffic load index Q value of the latest 5 minute time range using the following formula (3):
Figure BDA0003358530270000134
wherein Q is j 、Q j+1 The first service load index Q, L which is the moment j and one minute after the moment j takes the value 5 respectively, namely the Q value of the last 5 minutes can be taken to participate in the calculation of W, the more the Q value calculation weight is larger when the Q value is closer to the current moment, the more the value range of the service fluctuation index W is [0,1 ]]The larger the value, the larger the fluctuation amplitude of the first traffic load index Q.
Step S430, judging whether the business load abnormally fluctuates;
the judgment traffic fluctuation index W is compared with a set allowable fluctuation threshold (for example, the fluctuation threshold may be 0.25).
Step S440, the connection processing unit is connected to the computing resource;
the absolute value of the fluctuation amplitude of the first traffic load index does not exceed the set threshold, it can be determined that no significant fluctuation occurs in the traffic load, the number of calculation units is kept unchanged at this time, the horizontal and vertical expansion and contraction of the calculation resources are not performed, for example, the traffic fluctuation index W is smaller than or equal to 0.25, and it can be determined that no abnormal fluctuation occurs in the traffic load.
And under the condition that the traffic load is determined to have no abnormal fluctuation, the connection processing unit forwards the SQL operation statement to the computing resource, and the computing resource inquires the storage unit to acquire data. Finally, the connection processing unit returns the final result to the user.
Step S450, under the condition that abnormal fluctuation of the service load is determined, the number of the calculation units is increased or reduced;
step S460, returning a request result.
In an embodiment of the present application, the following aspects are included:
(1) A cloud database system with uninterrupted elastic expansion and contraction service;
(2) Based on the service load, the number of copies of the computing unit is newly increased and reduced according to the gradient grade specification, so that the expansion and contraction frequency of the cluster is reduced, and the stability of the cluster is kept;
(3) If the absolute value of the fluctuation amplitude of the business load index does not exceed the set threshold value, the number of the calculation units is kept unchanged, and the horizontal and longitudinal expansion and contraction calculation units are not needed.
Has the following beneficial technical effects:
(1) If the absolute value of the fluctuation amplitude of the service load index in a certain time period does not exceed a set threshold, the number of the calculation units is kept unchanged, and the horizontal and longitudinal expansion and contraction calculation units are not needed, so that cluster operation and stable user service are kept;
(2) The scheme of increasing and reducing the number of copies of the computing unit by adopting the new gradient grade specification is adopted, so that the situation that the computing capacity corresponding to the cluster is insufficient for supporting the service in the process of rapidly increasing the service load is dealt with;
(3) The whole cluster is not interrupted in the expanding and shrinking process, particularly in the degradation process, so that the influence on database service is avoided.
Fig. 4C is an internal logic flow diagram of a new computing unit according to a traffic load provided in an embodiment of the present application, as shown in fig. 4C, including the following steps:
step S410, connecting a cloud database system by a user;
step S420, the connection processing unit acquires the service load in the time period;
step S430, judging whether the business load abnormally fluctuates;
in the case where the abnormal fluctuation of the traffic load is determined, step S451 is performed; in the case where it is determined that the traffic load does not abnormally fluctuate, step S455 is performed.
Step S451, determining whether the computing resource is close to a threshold value;
When abnormal fluctuation of the traffic load is determined and the current first traffic load index Q value is larger than the first traffic load index Q value of the previous minute, abnormal rising of the traffic load can be judged: when the connection processing unit detects that the first traffic load index Q is obviously increased, by inquiring indexes monitored by each computing unit in the computing resources, whether the stress of each computing unit resource exceeds a set threshold is detected, for example, if the CPU utilization rate of the computing unit exceeds 90%, the set threshold is determined to be exceeded, or if the memory utilization rate exceeds 80%, the set threshold is determined to be exceeded.
Executing step S452 when it is determined that the computing resource exceeds the set threshold; upon determining that the computing resources do not exceed the set threshold, an idle computing unit is selected and the process proceeds to step S455.
Step S452, determining whether the number of computing units exceeds an upper limit;
in the implementation process, if all the computing units in the computing resource exceed the proximity threshold, the connection processing unit is required to determine whether the number of computing units exceeds the upper limit, and step S453 is executed; in the case where it is determined that the number of computing units does not exceed the upper limit, step S454 is performed.
Step S453, determining whether the idle computing unit is overtime;
In practice, if the number of computing units exceeds the upper limit, the connected processing unit waits for an idle computing unit within a time allowed to timeout.
The connection processing unit finds the idle computing unit within the time allowed to timeout and forwards the user SQL operation request to the idle computing unit, and the step S455 is performed in a jump.
If the connection processing unit fails to find the idle computing unit within the time allowed for timeout, the connection processing unit directly returns to request timeout, and the step S460 is executed in a jump.
Step S454, determining the number of newly added computing units;
in the implementation process, if the number of the computing units does not exceed the upper limit, a computing unit with a higher-grade specification can be newly added in the computing resource, and the connection processing unit forwards the new database connection to the new computing unit.
Step S455, connecting to an idle calculation unit;
step S460, returning a request result.
In an embodiment of the present application, a method for adding a computing unit according to a service load is provided. Therefore, the scheme of increasing the number of copies of the computing unit by adopting the gradient grade specification can cope with the situation that the computing capacity of the cluster is insufficient to support the service in the process of the abrupt rising of the service load.
Fig. 4D is an internal logic flow diagram of a computing unit according to an embodiment of the present application, as shown in fig. 4D, including the following steps:
step S410, connecting a cloud database system by a user;
step S420, the connection processing unit acquires the service load in the time period;
step S430, judging whether the business load abnormally fluctuates;
step S456, determining whether the computing resource is idle;
when abnormal fluctuation of the traffic load is determined and the current first traffic load index Q value is smaller than the first traffic load index Q value of the previous minute, abnormal drop of the traffic load can be judged: when the connection processing unit detects that the service load is obviously reduced, whether the existing computing unit resources are idle or not is detected by inquiring the monitoring indexes monitored by each computing unit.
In the case that it is determined that the computing resources are idle, step S457 is performed; in the case where it is determined that the computing resources are not idle, step S440 is performed.
Step 457, connection of a transfer calculation unit;
in practice, the following steps may be performed:
A. under the condition that the computing resource is determined to be idle, the connection processing unit gradually transfers the connection on the computing unit with the highest specification grade to the computing unit with the minimum specification grade, the new connection is also transferred to the computing unit with the minimum specification grade, and then the step B is continuously executed;
B. Detecting whether the forwarded computing unit resource exceeds a set threshold;
a. if the computing unit resource exceeds the set threshold, forwarding the connection and the new connection on the computing unit corresponding to the specification grade to the computing unit with the higher grade, and then jumping to the step B to judge whether the resource exceeds the set threshold;
b. if the computing unit resource does not exceed the set threshold, the user SQL operation request is forwarded to the computing unit, and step S458 is performed.
Step S458, determining whether the computing unit has a connection;
and judging whether the computing unit with the highest specification grade in the currently existing computing resources is connected or not. If there is a connection, jumping to step S440; in the case where it is determined that the computing unit has no connection, step S459 is performed.
Step S459, a reduction calculation unit;
if no connection exists, the computing unit with the highest specification grade in the currently existing computing units is reduced, and step S440 is performed.
Step S440, connecting to a computing unit;
step S460, returning a request result.
In the embodiment of the application, a method for reducing a computing unit according to a service load is provided, so that service is not interrupted all the time in a degradation process, and the influence on database service can be effectively avoided.
Based on the foregoing embodiments, the embodiments of the present application provide a computing resource scaling device for a database, where the device includes each module including each sub-module, each sub-module includes a unit, and each unit includes each sub-unit, which may be implemented by a processor in an electronic device; of course, the method can also be realized by a specific logic circuit; in an implementation, the processor may be a Central Processing Unit (CPU), a Microprocessor (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like.
Fig. 5 is a schematic structural diagram of a computing resource scaling device of a database according to an embodiment of the present application, as shown in fig. 5, where the device 500 includes:
an obtaining module 510, configured to obtain, in a preset period of time, a transaction number TPS per second, a query number QPS per second, and a new order number tpmC processed by the system in each minute of the computing resource;
a determining module 520, configured to determine a traffic fluctuation indicator within the preset time period based on the TPS, the QPS, and the tpmC, where the traffic fluctuation indicator is used to characterize a fluctuation of a traffic load of the computing resource within the preset time period;
And the expansion and contraction module 530 is configured to expand or contract the computing resource if it is determined that the traffic fluctuation indicator is greater than the traffic fluctuation threshold.
In some embodiments, the determining module includes a dividing sub-module, a first obtaining sub-module, a first determining sub-module, and a second determining sub-module, where the dividing sub-module is configured to divide the preset time period into L preset sub-time periods, where L is an integer greater than or equal to 1; the first obtaining submodule is used for obtaining TPS, QPS and tpmC in a j-th preset time period, wherein j is an integer less than or equal to L; the first determining submodule is configured to determine a first traffic load indicator corresponding to the jth preset time slot based on TPS, QPS and tpmC in the jth preset time slot; the second determining submodule is used for determining service fluctuation indexes in the preset time period based on L first service load indexes.
In some embodiments, the first determining submodule includes a first acquiring unit and a determining unit, where the first acquiring unit is configured to acquire second traffic load indexes in N jth preset sub-periods, where the second traffic load indexes are obtained by weighted averaging the TPS and the QPS, and N is an integer greater than or equal to 1; the determining unit is configured to determine a first traffic load index in the jth preset sub-period based on the second traffic load index in the nth preset sub-period and the tpmC.
In some embodiments, the determining unit includes a first determining subunit and a second determining subunit, where the first determining subunit is configured to determine M second traffic load indicators meeting a preset requirement from second traffic load indicators in the N jth preset sub-time periods, where M is an integer less than or equal to N; the second determining subunit is configured to determine, based on M second traffic load indexes and the tpmC, a first traffic load index in the j-th preset sub-period.
In some embodiments, the first determining subunit is configured to average the second traffic load indexes in the N jth preset sub-periods to obtain an average value of the second traffic load indexes in the jth sub-period; obtaining the variance of the second business load index in the j preset sub-time period based on the second business load index in the N j preset sub-time periods and the average value of the second business load index; and determining M second traffic load indexes from N second traffic load indexes in the j preset sub-time period based on the average value of the second traffic load indexes and the variance of the second traffic load indexes.
In some embodiments, the second determining submodule includes a second obtaining unit and a weighted sum operation unit, where the second obtaining unit is configured to obtain a difference value and a sum value of a first traffic load indicator in a j+1th preset sub-period and a first traffic load indicator in the j preset sub-period in the L first traffic load indicators; and the weighted summation operation unit is used for carrying out weighted summation operation on the L values obtained by dividing the difference value by the summation value to obtain the business fluctuation index in the preset time period.
In some embodiments, the expansion and contraction module includes a second obtaining submodule, a capacity expansion submodule and a contraction Rong Zi module, where the second obtaining submodule is configured to obtain a first traffic load indicator corresponding to an L-th subperiod and a first traffic load indicator corresponding to an L-1-th subperiod in the L preset subperiods when the traffic fluctuation indicator is greater than a traffic fluctuation threshold; the expansion Rong Zi module is configured to expand the computing resource when it is determined that the first traffic load index corresponding to the L-th sub-period is greater than the first traffic load index corresponding to the L-1 th sub-period; the capacity shrinking submodule is used for shrinking the computing resource under the condition that the first business load index corresponding to the L-th subperiod is smaller than the first business load index corresponding to the L-1 th subperiod.
In some embodiments, the apparatus further comprises a holding module configured to hold the computing resource unchanged if the traffic fluctuation index is equal to or less than a traffic fluctuation threshold.
The description of the apparatus embodiments above is similar to that of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
It should be noted that, in the embodiment of the present application, if the method is implemented in the form of a software functional module, and sold or used as a separate product, the method may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied essentially or in a part contributing to the related art in the form of a software product stored in a storage medium, including several instructions for causing an electronic device (which may be a mobile phone, a tablet computer, a notebook computer, a desktop computer, etc.) to perform all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
Correspondingly, the embodiment of the present application provides a computer readable storage medium, on which a computer program is stored, which when being executed by a processor, implements the steps in the method for expanding and contracting the computing resources of the database provided in the above embodiment.
Correspondingly, an electronic device is provided in the embodiment of the present application, fig. 6 is a schematic diagram of a hardware entity of the electronic device provided in the embodiment of the present application, as shown in fig. 6, the hardware entity of the device 600 includes: comprising a memory 601 and a processor 602, said memory 601 storing a computer program executable on the processor 602, said processor 602 implementing the steps in the method of expanding and contracting computational resources of a database provided in the above-described embodiments when said program is executed.
The memory 601 is configured to store instructions and applications executable by the processor 602, and may also cache data (e.g., image data, audio data, voice communication data, and video communication data) to be processed or processed by the processor 602 and the modules in the electronic device 600, which may be implemented by a FLASH memory (FLASH) or a random access memory (Random Access Memory, RAM).
It should be noted here that: the description of the storage medium and apparatus embodiments above is similar to that of the method embodiments described above, with similar benefits as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and the apparatus of the present application, please refer to the description of the method embodiments of the present application for understanding.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present application, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation process of the embodiments of the present application. The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above described device embodiments are only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units; can be located in one place or distributed to 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 be separately used as one unit, 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.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read Only Memory (ROM), a magnetic disk or an optical disk, or the like, which can store program codes.
Alternatively, the integrated units described above may be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied essentially or in a part contributing to the related art in the form of a software product stored in a storage medium, including several instructions for causing an electronic device (which may be a mobile phone, a tablet computer, a notebook computer, a desktop computer, etc.) to perform all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a removable storage device, a ROM, a magnetic disk, or an optical disk.
The methods disclosed in the several method embodiments provided in the present application may be arbitrarily combined without collision to obtain a new method embodiment.
The features disclosed in the several product embodiments provided in the present application may be combined arbitrarily without conflict to obtain new product embodiments.
The features disclosed in the several method or apparatus embodiments provided in the present application may be arbitrarily combined without conflict to obtain new method embodiments or apparatus embodiments.
The foregoing is merely an embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for scaling computing resources of a database, the method comprising:
acquiring transaction number TPS per second, query number QPS per second and new order number tpmC processed by the system per minute of the computing resource in a preset time period;
Determining a traffic fluctuation index within the preset time period based on the TPS, the QPS and the tpmC, wherein the traffic fluctuation index is used for representing fluctuation of traffic load of the computing resource within the preset time period;
and under the condition that the service fluctuation index is determined to be larger than a service fluctuation threshold, expanding or shrinking the capacity of the computing resource.
2. The method of claim 1, wherein the determining a traffic fluctuation indicator for the preset time period based on the TPS, the QPS, and the tpmC comprises:
dividing the preset time period into L preset sub-time periods, wherein L is an integer greater than or equal to 1;
acquiring TPS, QPS and tpmC in a j-th preset sub-time period, wherein j is an integer less than or equal to L;
determining a first service load index corresponding to the jth preset sub-period based on TPS, QPS and tpmC in the jth preset sub-period;
and determining the business fluctuation index in the preset time period based on the L first business load indexes.
3. The method of claim 2, wherein the determining the first traffic load indicator corresponding to the j-th preset sub-period based on TPS, QPS, and tpmC in the j-th preset sub-period comprises:
Acquiring second service load indexes in a j-th preset sub-time period, wherein the second service load indexes are obtained by carrying out weighted average on the TPS and the QPS, and N is an integer greater than or equal to 1;
and determining a first business load index in the j preset sub-time period based on the second business load index in the N j preset sub-time periods and the tpmC.
4. The method of claim 3, wherein the determining the first traffic load indicator for the j-th preset sub-period based on the second traffic load indicator for the N-th preset sub-period and the tpmC comprises:
determining M second business load indexes meeting preset requirements from the second business load indexes in the Nth preset sub-time period, wherein M is an integer less than or equal to N;
and determining a first traffic load index in the j preset sub-time period based on the M second traffic load indexes and the tpmC.
5. The method of claim 4, wherein said determining M second traffic load indicators meeting a preset requirement from among the N second traffic load indicators within the N j-th preset sub-time periods comprises:
Averaging the second service load indexes in the Nth preset sub-time period to obtain an average value of the second service load indexes in the jth sub-time period;
obtaining the variance of the second business load index in the j preset sub-time period based on the second business load index in the N j preset sub-time periods and the average value of the second business load index;
and determining M second traffic load indexes from N second traffic load indexes in the j preset sub-time period based on the average value of the second traffic load indexes and the variance of the second traffic load indexes.
6. The method of claim 2, wherein the determining the traffic fluctuation indicator for the preset time period based on the L first traffic load indicators comprises:
acquiring a difference value and a sum value of a first business load index in a j+1th preset sub-time period and a first business load index in the j preset sub-time period in the L first business load indexes;
and carrying out weighted summation operation on the values obtained by dividing the L differences by the summation value to obtain the business fluctuation index in the preset time period.
7. The method according to any one of claims 2 to 6, wherein expanding or contracting the computing resource in the case where the traffic fluctuation index is greater than a traffic fluctuation threshold value comprises:
under the condition that the service fluctuation index is larger than a service fluctuation threshold, acquiring a first service load index corresponding to an L-th subperiod and a first service load index corresponding to an L-1 th subperiod in the L preset subperiods;
expanding the capacity of the computing resource under the condition that the first business load index corresponding to the L-th subperiod is determined to be larger than the first business load index corresponding to the L-1 th subperiod;
and carrying out capacity reduction on the computing resource under the condition that the first business load index corresponding to the L-th subperiod is smaller than the first business load index corresponding to the L-1 th subperiod.
8. The method of any one of claims 1 to 6, further comprising:
and under the condition that the service fluctuation index is smaller than or equal to a service fluctuation threshold value, keeping the computing resource unchanged.
9. A computing resource scaling apparatus for a database, the apparatus comprising:
The acquisition module is used for acquiring the transaction number TPS per second, the query number QPS per second and the new order number tpmC processed by the system per minute of the computing resource in a preset time period;
a determining module, configured to determine a traffic fluctuation indicator in the preset time period based on the transaction number TPS per second, the query number QPS per second, and the number tpmC of new orders processed by the system per minute, where the traffic fluctuation indicator is used to characterize a fluctuation of a traffic load of the computing resource in the preset time period;
and the expansion and contraction module is used for expanding or contracting the capacity of the computing resource under the condition that the service fluctuation index is determined to be larger than a service fluctuation threshold value.
10. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that the processor implements the steps of the method of any of claims 1 to 8 when the program is executed.
CN202111359373.4A 2021-11-17 2021-11-17 Method, device, equipment and storage medium for expanding and shrinking computing resources of database Pending CN116136792A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111359373.4A CN116136792A (en) 2021-11-17 2021-11-17 Method, device, equipment and storage medium for expanding and shrinking computing resources of database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111359373.4A CN116136792A (en) 2021-11-17 2021-11-17 Method, device, equipment and storage medium for expanding and shrinking computing resources of database

Publications (1)

Publication Number Publication Date
CN116136792A true CN116136792A (en) 2023-05-19

Family

ID=86332547

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111359373.4A Pending CN116136792A (en) 2021-11-17 2021-11-17 Method, device, equipment and storage medium for expanding and shrinking computing resources of database

Country Status (1)

Country Link
CN (1) CN116136792A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701126A (en) * 2023-08-01 2023-09-05 中海石油气电集团有限责任公司 Pod capacity control method and device
CN117407237A (en) * 2023-09-15 2024-01-16 通明智云(北京)科技有限公司 CPU utilization rate statistical method and device based on polling mode

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701126A (en) * 2023-08-01 2023-09-05 中海石油气电集团有限责任公司 Pod capacity control method and device
CN116701126B (en) * 2023-08-01 2023-12-12 中海石油气电集团有限责任公司 Pod capacity control method and device
CN117407237A (en) * 2023-09-15 2024-01-16 通明智云(北京)科技有限公司 CPU utilization rate statistical method and device based on polling mode

Similar Documents

Publication Publication Date Title
US20220335034A1 (en) Multi-master architectures for distributed databases
CN102694868B (en) A kind of group system realizes and task dynamic allocation method
CN116136792A (en) Method, device, equipment and storage medium for expanding and shrinking computing resources of database
US7631076B2 (en) Apparatus, system, and method for adaptive polling of monitored systems
US20160142369A1 (en) Service addressing in distributed environment
JP2019511054A (en) Distributed cluster training method and apparatus
KR102077898B1 (en) Data storage upon database failure
CN101820384A (en) Method and device for dynamically distributing cluster services
EP3331218B1 (en) Method and device for leveling load of distributed database
US20150280981A1 (en) Apparatus and system for configuration management
CN110213203B (en) Network scheduling method and device and computer storage medium
CN101662495A (en) Backup method, master server, backup servers and backup system
WO2016184048A1 (en) Method and device for frequency management for multi-core processor cpu
CN115412449B (en) Dynamic container telescoping method and system based on load prediction
TWI686703B (en) Method and device for data storage and business processing
US11455196B2 (en) Adaptive prioritization of USB traffic
WO2023082681A1 (en) Data processing method and apparatus based on batch-stream integration, computer device, and medium
CN108234231A (en) The method, apparatus and electronic equipment of elastic telescopic arrangement in cloud computing environment
CN109308219B (en) Task processing method and device and distributed computer system
CN110278109B (en) Disaster recovery method and system
CN116662022A (en) Distributed message processing method, system, device, communication equipment and storage medium
CN113542027B (en) Flow isolation method, device and system based on distributed service architecture
CN112948207A (en) Information transfer method, information transfer device, electronic apparatus, and medium
Zhang et al. Proactive Data Placement for Surveillance Video Processing in Heterogeneous Cluster
US20190090120A1 (en) Highly scalable home subscriber server

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