CN116360981A - Resource management method and device - Google Patents
Resource management method and device Download PDFInfo
- Publication number
- CN116360981A CN116360981A CN202310225197.8A CN202310225197A CN116360981A CN 116360981 A CN116360981 A CN 116360981A CN 202310225197 A CN202310225197 A CN 202310225197A CN 116360981 A CN116360981 A CN 116360981A
- Authority
- CN
- China
- Prior art keywords
- query
- index
- rejection rate
- data node
- node
- 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
Links
- 238000007726 management method Methods 0.000 title claims abstract description 54
- 230000002159 abnormal effect Effects 0.000 claims abstract description 127
- 238000012216 screening Methods 0.000 claims abstract description 4
- 238000000034 method Methods 0.000 claims description 58
- 238000004422 calculation algorithm Methods 0.000 claims description 9
- 238000012896 Statistical algorithm Methods 0.000 claims description 6
- 230000009467 reduction Effects 0.000 claims description 5
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 21
- 238000010586 diagram Methods 0.000 description 12
- 238000004590 computer program Methods 0.000 description 11
- 230000003044 adaptive effect Effects 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 5
- 238000002955 isolation Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000003111 delayed effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000013467 fragmentation Methods 0.000 description 1
- 238000006062 fragmentation reaction Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 239000004984 smart glass Substances 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5022—Mechanisms to release resources
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5055—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering software capabilities, i.e. software resources associated or available to the machine
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the specification provides a resource management method and a device, wherein the resource management method comprises the following steps: acquiring thread pool use information corresponding to the data node; determining resource consumption information of a preset index in the data node according to the thread pool use information; screening out abnormal indexes from the data nodes according to the resource consumption information of the preset indexes, and calculating query rejection rates corresponding to the abnormal indexes; and creating and executing a query rejection task associated with the abnormal index based on the query rejection rate, wherein the query rejection task is used for adjusting the resource use of a thread pool in the data node.
Description
Technical Field
The embodiment of the specification relates to the technical field of data processing, in particular to a resource management method and device.
Background
With the development of internet technology, the cloud storage service provides more convenient data storage service for users, and can store the data required to be persistent under the condition that the users do not have physical storage resources, so that the users can apply the cloud storage service in different scenes more conveniently. The multi-element index is used as an important data query means in the cloud storage service, has a thread pool isolation resource isolation means, and can be used for distributing different types of query requests to different query threads for realizing the aim of coping with high concurrency query scenes. However, in the prior art, because of the complexity of the query scenario, a situation of query sudden increase easily occurs, for example, several multiple indexes of one user always keep stable query QPS, one index suddenly accesses the multiple indexes with several times daily query QPS, and the multiple indexes burst a large number of query requests are called burst traffic; burst traffic typically results in a thread pool being full, i.e., full load operation. At this time, the original normal query of the thread pool will be affected, so an effective solution is needed to solve the above problem.
Disclosure of Invention
In view of this, the present embodiments provide a resource management method. One or more embodiments of the present disclosure relate to a resource management device, a query throttling system, a query throttling method, a query throttling device, a query system, a computing device, a computer readable storage medium, and a computer program, which solve the technical drawbacks of the prior art.
According to a first aspect of embodiments of the present specification, there is provided a resource management method, including:
acquiring thread pool use information corresponding to the data node;
determining resource consumption information of a preset index in the data node according to the thread pool use information;
screening out abnormal indexes from the data nodes according to the resource consumption information of the preset indexes, and calculating query rejection rates corresponding to the abnormal indexes;
and creating and executing a query rejection task associated with the abnormal index based on the query rejection rate, wherein the query rejection task is used for adjusting the resource use of a thread pool in the data node.
According to a second aspect of embodiments of the present specification, there is provided a resource management device comprising:
The acquisition module is configured to acquire thread pool use information corresponding to the data node;
the determining module is configured to determine resource consumption information of a preset index in the data node according to the thread pool use information;
the computing module is configured to screen out an abnormal index from the data nodes according to the resource consumption information of the preset index, and compute a query rejection rate corresponding to the abnormal index;
and the creation module is configured to create and execute a query rejection task associated with the abnormal index based on the query rejection rate, wherein the query rejection task is used for adjusting the resource use of a thread pool in the data node.
According to a third aspect of embodiments of the present specification, there is provided a query throttling system comprising a data node and a query node;
the query node is configured to determine a target index corresponding to a query request, and send the query request to the data node when the target index is determined to satisfy a query condition according to locally stored rejection rate information;
the data node is used for determining a query result by executing the query request and loading a query rejection rate corresponding to the target index; writing the query rejection rate into the query result, and sending the query result carrying the query rejection rate to the query node; and the query rejection rate is used for updating the rejection rate information stored by the query node.
According to a fourth aspect of embodiments of the present disclosure, there is provided a query throttling method, applied to a data node, including:
receiving a query request submitted by a query node aiming at a target index;
determining a query result by executing the query request, and loading a query rejection rate corresponding to the target index;
writing the query rejection rate into the query result, and sending the query result carrying the query rejection rate to the query node; and the query rejection rate is used for updating the rejection rate information stored by the query node.
According to a fifth aspect of embodiments of the present disclosure, there is provided a query restriction device, for application to a data node, comprising:
the receiving module is configured to receive a query request submitted by a query node aiming at a target index;
the determining module is configured to determine a query result by executing the query request and load a query rejection rate corresponding to the target index;
the writing module is configured to write the query rejection rate into the query result and send the query result carrying the query rejection rate to the query node; and the query rejection rate is used for updating the rejection rate information stored by the query node.
According to a sixth aspect of embodiments of the present specification, there is provided a query system comprising:
a data node and a query node;
the query node is used for triggering a query executable instruction, and the data node is used for executing the query executable instruction, and the query executable instruction realizes the steps of the resource management method or the query flow limiting method when being executed by the data node.
According to a seventh aspect of embodiments of the present specification, there is provided a computing device comprising:
a memory and a processor;
the memory is configured to store computer-executable instructions that, when executed, implement the steps of any of the resource management methods or query throttling methods described above.
According to an eighth aspect of embodiments of the present specification, there is provided a computer-readable storage medium storing computer-executable instructions which, when executed by a processor, implement the steps of the resource management method or the query restriction method described above.
According to a ninth aspect of embodiments of the present specification, there is provided a computer program, wherein the computer program, when executed in a computer, causes the computer to perform the steps of the resource management method or the query restriction method described above.
In order to achieve adaptive current limiting and avoid thread pool load, the resource management method provided by the specification can firstly obtain thread pool use information corresponding to a thread pool in a data node, then determine resource consumption information corresponding to preset indexes in the data node according to the thread pool use information, and screen out problematic preset indexes, namely abnormal indexes, from the data node according to the resource consumption information respectively corresponding to all the preset indexes at the moment, and calculate query rejection rates corresponding to the abnormal indexes; when the thread pool resource is called, the burst index which may appear at the current moment can be dynamically calculated. After the request of the associated abnormal index can be received at the client side, the request can be refused by using the inquiry refusing rate, so that the quantity of the request fed back to the data node is controlled at the client side, thereby realizing self-adaptive current limiting, realizing simplicity and high efficiency, and ensuring that the thread pool resources can be dynamically allocated according to the actual situation.
Drawings
FIG. 1 is a schematic diagram of a resource management method according to one embodiment of the present disclosure;
FIG. 2 is a flow chart of a method of resource management provided in one embodiment of the present disclosure;
FIG. 3 is a process flow diagram of a resource management method according to one embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a resource management device according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a query throttling system according to one embodiment of the present disclosure;
FIG. 6 is a flow chart of a query throttling method provided by one embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a query flow restrictor device according to an embodiment of the present disclosure;
FIG. 8 is a block diagram of a computing device provided in one embodiment of the present description.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present description. This description may be embodied in many other forms than described herein and similarly generalized by those skilled in the art to whom this disclosure pertains without departing from the spirit of the disclosure and, therefore, this disclosure is not limited by the specific implementations disclosed below.
The terminology used in the one or more embodiments of the specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the specification. As used in this specification, one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that, although the terms first, second, etc. may be used in one or more embodiments of this specification to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first may also be referred to as a second, and similarly, a second may also be referred to as a first, without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
First, terms related to one or more embodiments of the present specification will be explained.
And (3) storing a table: the distributed NoSQL database provides storage and real-time access of massive structured data, and table storage achieves seamless expansion of scale through data slicing and load balancing technology.
Multiple index (SearchIndex): in order to meet the complex query requirements of users of the table storage according to non-primary key column query, multi-column free combination query and the like, the table storage provides multiple indexes while supporting primary key query such as single-row reading, range reading and the like. The multi-element index is based on inverted index and column storage, and can solve the complex query problem of big data, and the complex query problem comprises the functions of non-primary key column query, full text retrieval, prefix query, fuzzy query, multi-field free combination query, nested query, geographic position query and the like.
Filling a thread pool: the multi-element index is provided with a resource isolation means for isolating thread pools, different types of inquiry requests can be distributed to different inquiry thread pools, and if one thread pool resource is used up, the new inquiry request of the type can be delayed to rise or the new request can be refused, and the phenomenon is called that the thread pool is full.
Burst traffic: several multiple indexes of a user always keep stable query QPS, and one index suddenly accesses the multiple indexes with daily multiple query QPS, and the multiple indexes suddenly request a large amount of query is called burst traffic.
In this specification, a resource management method is provided. One or more embodiments of the present disclosure relate to a resource management device, a query restriction system, a query restriction method, a query restriction device, a query system, a computing device, a computer readable storage medium, and a computer program, which are described in detail in the following embodiments.
Referring to the schematic diagram shown in fig. 1, in order to implement adaptive current limiting and avoid causing thread pool load, the resource management method provided in the present disclosure may first obtain thread pool usage information corresponding to a thread pool in a data node, then determine resource consumption information corresponding to preset indexes in the data node according to the thread pool usage information, and at this time, may screen out preset indexes having problems, i.e. abnormal indexes, from the data node according to resource consumption information corresponding to all preset indexes, and calculate a query rejection rate corresponding to the abnormal indexes; when the thread pool resource is called, the burst index which may appear at the current moment can be dynamically calculated. After the request of the associated abnormal index can be received at the client side, the request can be refused by using the inquiry refusing rate, so that the quantity of the request fed back to the data node is controlled at the client side, thereby realizing self-adaptive current limiting, realizing simplicity and high efficiency, and ensuring that the thread pool resources can be dynamically allocated according to the actual situation.
It should be noted that, the related data related to the application are all information and data authorized by the user or fully authorized by each party, and the usage and processing are required to comply with related laws and regulations and standards of related countries and regions, and corresponding operation entrances are provided for the user to select authorization or rejection.
Fig. 2 shows a flowchart of a resource management method according to an embodiment of the present disclosure, which specifically includes the following steps.
Step S202, thread pool use information corresponding to the data node is obtained.
The resource management method provided by the embodiment is applied to the multi-element index of the table storage service, the table storage is used as a distributed NoSQL database, the multi-element index service provided by the method is used as a query acceleration engine of the database, and the complex query requirements of a user of the table storage according to non-main key row query, multi-row free combination query and the like can be met.
Specifically, the data node is a storage node for providing data to be queried for a user, and when the user sends a request to the data node through the front end processor, the data node can call a thread of the belonging thread pool to execute the query request so as to feed back a query result to the front end processor. The corresponding thread pool use information specifically refers to the duty ratio information of the thread pool corresponding to the data node at the current moment, and whether burst traffic exists in the data node at the current moment can be determined according to the thread pool use information so as to ensure that the burst index can be positioned and the adaptive current limiting processing can be performed under the condition that the burst traffic exists, thereby avoiding the use load of the thread pool and realizing the provision of stable query service to the front end machine.
Based on the above, in order to control the thread pool usage rate of any data node with burst traffic, the thread pool usage information of the thread pool in each data node may be monitored at any time before adjustment, so that whether the data node to which the thread pool usage information belongs has burst traffic may be conveniently located according to the thread pool usage information, so as to control the burst index corresponding to the burst traffic.
In practical application, because the multi-element index is provided with a resource isolation means for isolating thread pools, different types of query requests can be distributed to different query thread pools, if a certain thread pool resource is used up, a new query request of the type is delayed to rise or the new request is refused, at the moment, the query result cannot be smoothly fed back to the front-end processor, and meanwhile, other problems can be caused by overload of the thread pool.
In view of this, in order to achieve adaptive current limiting, so as to ensure that the thread pool can be kept at a stable running level at any time and normal query requests performed by the thread pool are not affected, thread pool usage information corresponding to the thread pool in the data node can be obtained first, then resource consumption information corresponding to preset indexes in the data node is determined according to the thread pool usage information, at this time, preset indexes with problems, namely abnormal indexes, can be screened out from the data node according to the resource consumption information corresponding to all the preset indexes, and query rejection rates corresponding to the abnormal indexes are calculated; when the thread pool resource is called, the burst index which may appear at the current moment can be dynamically calculated. After the request of the associated abnormal index can be received at the client side, the request can be refused by using the inquiry refusing rate, so that the quantity of the request fed back to the data node is controlled at the client side, thereby realizing self-adaptive current limiting, realizing simplicity and high efficiency, and ensuring that the thread pool resources can be dynamically allocated according to the actual situation.
Step S204, determining resource consumption information of a preset index in the data node according to the thread pool use information.
Specifically, after the thread pool use information is obtained, further, in order to determine whether burst traffic exists in the thread pool of the data node, the abnormal index in the thread pool with the burst traffic is managed and controlled; at this time, according to the thread pool usage information, resource consumption information respectively corresponding to all preset indexes contained in the data node, that is, the corresponding resource consumption information of the preset indexes respectively corresponding to the data stored in the data node is determined, so as to determine whether each preset index has an abnormal condition or not through the resource consumption information, thereby realizing that the abnormal index can be positioned based on the resource consumption information, limiting the current for the abnormal index, and avoiding the thread pool water level in the data node from exceeding the safe water level.
The preset index is specifically a multi-element index corresponding to data stored in the data node, and the preset index generally keeps stable query QPS when the data node queries the data; correspondingly, the resource consumption information specifically refers to resources consumed by the preset index when data query is performed at the data node, namely consumed thread pool resources.
Further, when determining the resource consumption information corresponding to each preset index in the data node, considering that each preset index may be used at any time, and thus cause the change of consumed resources, in order to ensure the accuracy of determining the resource consumption information, the method may be implemented by using a resource statistical algorithm, and in this embodiment, the specific implementation manner is as follows:
under the condition that the thread pool use information meets a load condition, determining a resource statistical algorithm corresponding to the data node; counting the resource consumption of a preset index in the data node according to the resource counting algorithm to obtain sub-resource consumption information of the preset index corresponding to at least one set duration; and determining the resource consumption information corresponding to the preset index based on the sub-resource consumption information corresponding to at least one set duration of the preset index.
Specifically, the load condition specifically refers to a condition of detecting whether a thread pool in a data node is loaded, so that the water level of the thread pool can be dynamically adjusted under the condition of loading. Correspondingly, the resource statistical algorithm specifically refers to an algorithm for passing through computing resources required by the preset index in the data node. In practical application, in order to ensure that resource consumption can fully embody resource consumption conditions of a preset index, and as the shards exist under the index, the thread pool resource consumption condition of each shard can be counted at the shard level, so that resource consumption information corresponding to the preset index is counted; correspondingly, the set duration is specifically a duration of resource consumption corresponding to different time periods of statistics of the preset index by the pointer, and is used for combining the average level of a plurality of time periods when determining the abnormal index. Correspondingly, the sub-resource consumption information specifically refers to resource consumption information corresponding to the preset index in each set duration.
Based on the method, after the thread pool use information corresponding to the data node is obtained, if the thread pool use information at the current moment is detected to meet the load condition, it is indicated that the resources of the thread pool in the data node at the moment exceed the safety water level, and further it is indicated that the data node at the current moment stores the abnormal index, namely the burst index, so that in order to be able to determine the abnormal index, a resource statistics algorithm corresponding to the data node can be determined first, the resource consumption of the preset index in the data node can be counted according to the resource statistics algorithm, so that the sub-resource consumption information corresponding to each set duration of the preset index is determined according to the set resource statistics algorithm, and on the basis, in order to accurately locate the abnormal index, the resource consumption information corresponding to each set duration of each preset index can be determined in combination with the sub-resource consumption information corresponding to each preset index, and subsequent use is convenient.
In practical application, when determining the resource consumption information of each preset index, the resource consumption of the latest set duration of each index is actually calculated according to the statistics information of the fragmentation level in the engine, for example, the resource consumption corresponding to 1 minute, 5 minutes and 15 minutes respectively. In the process, the calculation of the resource consumption can adopt a moving average (EWMA) to reduce the dimension to represent the corresponding historical state, so that the historical monitoring information is recorded by using an EWMA mode, and the purpose of reducing the memory consumption is achieved.
In specific implementation, the value used in the implementation of resource consumption can be expressed by query time consumption per second, namely, the execution time consumed by running one query in a thread pool per second; for example, with a pool of 20 threads, the node can provide 20s of computing power a second, which indexes that if only one query takes 500ms, then the query takes 0.5 seconds per second, and if qps is very high, the query time per second may be 15 seconds. On this basis, determining the query time-consuming per second refers to: each thread pool running query starts to record time, the difference is the total time of the query running, all the query times are accumulated, and then the average value is calculated every n seconds, so that the query time consumption per second can be obtained, the query time consumption per second is used for representing the resource consumption information corresponding to the preset index, and the subsequent use is convenient.
In conclusion, the positioning processing operation of the abnormal index is triggered under the condition that the thread pool in the data node meets the load condition is determined, the thread pool water level can be ensured to be dynamically controlled when the problem exists, the monitoring cost can be reduced, the problem of the thread pool load can be solved in time, and therefore stable query service can be provided for the front-end processor.
Step S206, the abnormal index is screened out from the data nodes according to the resource consumption information of the preset index, and the query rejection rate corresponding to the abnormal index is calculated.
Specifically, after the resource consumption information corresponding to each preset index in the data node at the current time is determined, further, since it is determined that the water level of the thread pool in the data node exceeds the safety water level, that is, it is determined that there are query requests occupying excessive resources in the thread pool at the current time, in order to control the type of query requests, the calculation of the query rejection rate can be performed starting from the index corresponding to the request, so that after the request corresponding to the index is received, the number of the data nodes can be accessed by controlling the request through the query rejection rate, thereby ensuring that the thread pool in the data node cannot be loaded.
That is, after determining that the water level of the thread pool is unsafe, the preset index that the current time occupies the thread pool resource higher than the normal level can be screened out by combining the resource consumption information corresponding to the preset index, and the preset index is selected as the abnormal index, so that the subsequent calculation of the query rejection rate of the index by combining the water level of the thread pool at the current time is convenient, and the request corresponding to the abnormal index can be controlled at the front end side, thereby achieving the purpose of self-adaptive current limiting.
The abnormal index is specifically a preset index of the level of consumed thread pool resources in the data node, and compared with the normal condition, the abnormal index is different in that more thread pool resources are occupied for data query and the like. Correspondingly, the query rejection rate is specifically the probability that the pointer rejects the query request corresponding to the abnormal index, and is used for reducing the number of the data nodes to be accessed by the request corresponding to the abnormal index, so that the purpose of reducing the thread pool water level is achieved, and the thread pool water level is controlled under the safe water level.
Further, when the abnormal index is screened, the abnormal index of the resource consumption is found from all preset indexes stored in the data node, and the abnormal index is represented by the access frequency of the index exceeding the usual in the current time period, so that when the resource consumption of each index is calculated, the abnormal index is positioned, and in the embodiment, the specific implementation mode is as follows:
determining sub-resource consumption information corresponding to at least one set duration of the preset index according to the resource consumption information corresponding to the preset index; calculating a resource consumption value corresponding to the preset index based on sub-resource consumption information of at least one set duration corresponding to the preset index; and determining a target resource consumption value by comparing the resource consumption values corresponding to the preset indexes, and taking the preset index corresponding to the target resource consumption value as the abnormal index.
Specifically, the resource consumption value refers to a value of time consuming in each second of inquiry when the preset index inquires data, and the higher the resource consumption value is, the more resources are occupied. Conversely, a lower resource consumption value indicates less resources are occupied.
Based on the above, when determining the abnormal index from a plurality of preset indexes in the data node, determining sub-resource consumption information of at least one set duration corresponding to the preset index according to the resource consumption information corresponding to the preset index; on the basis, the resource consumption value can be calculated by combining the sub-resource consumption information corresponding to the time periods, namely, the resource consumption value corresponding to the preset index is calculated based on the sub-resource consumption information corresponding to at least one set time period of the preset index; at the moment, a numerical value capable of representing the resource consumption condition corresponding to each preset index can be obtained, at the moment, the target resource consumption value meeting the condition can be determined by comparing the resource consumption values corresponding to the preset indexes, and the preset index corresponding to the target resource consumption value is taken as an abnormal index.
In practical application, when the abnormal index is determined, the thread pool water level is continuously monitored through the thread in the engine background, when the thread pool load is large, which preset index is the burst flow index according to the resource consumption of the set time length of each index, such as the resource consumption corresponding to 1 minute, 5 minutes and 15 minutes, can be calculated and can be used as the abnormal index, and related resource consumption data is recorded, so that the subsequent numerical calculation of the self-adaptive flow control is convenient, and the query rejection rate corresponding to the abnormal index is dynamically adjusted.
In specific implementation, a moving average algorithm may be used to record the resource consumption of the index in a set duration, for example, the resource consumption corresponding to 1 minute, 5 minutes and 15 minutes respectively, the index=max (15 min index-5 min index, 5min index-now index, 15min index-now index) with the largest resource growth, and after the resource consumption value corresponding to each preset index is obtained by calculation, the largest index is selected as the burst flow index, that is, the abnormal index, so as to perform subsequent calculation of the query rejection rate.
For example, at the data node M, the resource consumption corresponding to each index of 1 minute, 5 minutes, and 15 minutes, respectively, will be calculated from the statistics of the slice level in the engine; and under the condition that the thread pool water level at the data node M exceeds 80%, the resource consumption corresponding to each index is calculated by combining the resource consumption corresponding to each index in the last 1 minute, 5 minutes and 15 minutes, the maximum value of the resource consumption corresponding to each index is calculated, the index I1 is determined to be a burst flow index in the index set I by comparing the maximum value of the resource consumption, and the corresponding query request is multiplied by a plurality of times compared with the normal time, so that the condition that the thread pool resources are occupied is excessive, and the subsequent control can be performed on the query request corresponding to the index I1 so as to avoid the load of the thread pool resources.
In conclusion, by combining the resource consumption value to locate the abnormal index, the index which occupies too much resources through visual data feedback can be realized, so that the abnormal index is accurately located, the subsequent management and control of the corresponding query request are facilitated, and the resource load of a thread pool is avoided.
Furthermore, when calculating the query rejection rate, considering that the query rejection rate is a parameter for controlling the subsequent query request corresponding to the abnormal index, the calculation needs to be completed in combination with the use condition of the thread pool in the data node at the current time, and in this embodiment, the specific implementation manner is as follows:
determining the dominant inquiry time consumption, the thread pool use ratio corresponding to the data node and the local index inquiry time consumption corresponding to a preset index except the abnormal index; calculating global index time consumption corresponding to the data node according to the dominant query time consumption and the thread pool usage duty ratio; calculating reference index time consumption corresponding to the data node according to the global index time consumption and the local index query time consumption; and calculating the query rejection rate according to the abnormal index time consumption corresponding to the abnormal index, the reference index time consumption and the target index time consumption corresponding to the data node.
Specifically, the dominant query time consumption specifically refers to the total query time consumption that can be dominant by the thread pool in the data node at the current moment; correspondingly, the thread pool use ratio specifically refers to the safe water level percentage of the thread pool; correspondingly, the local index inquiry time consumption specifically refers to inquiry time consumption corresponding to all preset indexes except the abnormal index at the current moment; accordingly, the global index time consumption is specifically the query time consumption that can be used by the thread pool in the data node at the current time. Accordingly, the reference index time consumption specifically refers to the allowable query time consumption that can be governed by the anomaly index at the current time.
Based on the above, when the query rejection rate corresponding to the abnormal index is calculated, the available query time consumption, the thread pool use ratio corresponding to the data node and the local index query time consumption corresponding to the preset index except the abnormal index can be determined; calculating global index time consumption corresponding to the data node according to the dominant query time consumption and the thread pool use duty ratio; calculating reference index time consumption corresponding to the data node according to the global index time consumption and the local index query time consumption; and finally, calculating the query rejection rate according to the abnormal index time consumption corresponding to the abnormal index, the reference index time consumption and the target index time consumption corresponding to the data node.
In specific implementation, the method can be realized by adopting the following formula:
P=(T1-T2)/T3=(T1-(T4*m-T5))/T3
wherein P represents the query rejection rate corresponding to the abnormal index; t1 represents the time consumption of the query corresponding to the current moment of the abnormal index; t2 represents the time-consuming query that the thread pool allows for the use of the anomaly index; t3 represents the time consumption of the query corresponding to the thread pool at the current moment; t4 represents the available inquiry time consumption at the current moment, and T5 represents the inquiry time consumption occupied by other indexes at the current moment; m represents the thread pool safe water level percentage.
After the query rejection rate corresponding to the abnormal index is calculated, the query request corresponding to the abnormal index can be rejected at the front end machine according to the query rejection rate, so that the number of the query requests in the submitted data nodes is controlled. In practical application, the query rejection rate of the abnormal index can be updated in real time, and the self-adaptive change can be completed according to different loads of the back-end data node.
For example, the system expects a data node thread pool safe water level of 70%; but the one-wave burst traffic increases the thread pool resource occupation to 100%; at this time, the burst index needs to be determined, and the query request sent to the data node is refused to 70%, so as to reduce the resource occupation condition of the thread pool at the current moment. In the process, the inquiry rejection rate corresponding to the burst index can be calculated in the mode, so that the reduction of the resource utilization ratio of the thread pool according to the inquiry rejection rate is realized. In this process, if 50% of the traffic is rejected for the burst index, and it is determined that the thread pool resource occupation of the data node is reduced to 60%, a problem of higher query rejection rate may occur at this time. The rejection rate can be adjusted in time. For example, the rejection rate of 50% is adjusted to 40%, so that the number of the burst index corresponding requests submitted to the data node can be increased until the thread pool resource ratio is adjusted to be close to 70.
In summary, by combining time consumption of different corresponding resources in the data node at the current moment and calculating the query rejection rate corresponding to the abnormal index, the number of query requests can be ensured to be controlled according to the query rejection rate, so that adaptive current limiting is realized, and the data node can be ensured to allocate the thread pool resources to normal query requests for use.
And step S208, creating and executing a query rejection task associated with the abnormal index based on the query rejection rate, wherein the query rejection task is used for adjusting the resource use of a thread pool in the data node.
Specifically, after the query rejection rate corresponding to the abnormal index is determined, in order to adjust the use condition of the thread pool resources of the data node based on the query rejection rate, a query rejection task associated with the abnormal index can be created and executed according to the query rejection rate, so that the query rejection rate is distributed to the front-end machine according to the execution result of the query rejection task, so that the front-end machine can reject the query request corresponding to the abnormal index according to the query rejection rate, and the number of the query requests of the data node submitted at the current moment is reduced, so that the use condition of the thread pool resources in the data node is further reduced.
Further, in the process of creating and executing the query rejection task, in order to realize the management and control of the query request corresponding to the abnormal index through the query rejection task, the query rejection rate needs to be written into the query result and fed back to the query node, so as to realize the direct rejection judgment logic for the type of query request at the query node, and in this embodiment, the specific implementation manner is as follows:
creating a query rejection task associated with the anomaly index based on the query rejection rate; determining a target query request corresponding to the abnormal index by executing the query rejection task; writing the query rejection rate into a query result corresponding to the target query request to obtain a target query result; and sending the target query result to a query node to which the target query request belongs, wherein the query rejection rate is used for controlling the request quantity of the query requests corresponding to the abnormal index in the query node.
Specifically, the target query request specifically refers to a query request associated with an abnormal index; correspondingly, the query result specifically refers to the result of the feedback of the query data or the query information to the query request by the pointer; correspondingly, the target query result specifically refers to a query result written with a query rejection rate, and is used for realizing control of the request quantity of the query requests corresponding to the abnormal indexes in the query node. Accordingly, the query node specifically refers to a node that submits a target query request, such as a front end processor or a client.
Based on the above, after the query rejection rate is calculated, a query rejection task associated with the abnormal index may be created based on the query rejection rate; at the moment, a target query request corresponding to the abnormal index is determined in the data node by executing the query rejection task; writing the query rejection rate into a query result corresponding to the target query request to obtain a target query result; and sending the target query result to a query node to which the target query request belongs, wherein the query rejection rate is used for controlling the request quantity of the query requests corresponding to the abnormal indexes in the query node.
Furthermore, when the query node makes a request decision according to the query rejection rate, the query node is realized by rejecting the query request mode corresponding to the partial abnormal index, and in this embodiment, the specific implementation mode is as follows:
receiving the target query request through the query node; determining a target query rejection rate corresponding to the abnormal index according to the rejection rate information stored by the query node; and under the condition that the target query request meets the query condition according to the target query rejection rate, sending the target query request to the data node.
Based on the above, after receiving the target query request, the query node determines a target query rejection rate corresponding to the abnormal index according to rejection rate information stored in the query node; if the target query request meets the query condition according to the target query rejection rate, the target query request can be sent to the data node at the moment. If the target query request is determined to not meet the query condition according to the target query rejection rate, the transmission is not required at this time.
That is, after the query request enters the Transport node, if the Transport node does not have the query rejection rate information corresponding to the query request, the query request is directly sent to the Data node, and the Data node will call the resource in the thread pool to execute the query request, at this time, if the abnormal index corresponding to the query request is determined, in order to avoid wasting resources of the node caused by a large number of subsequent query requests of the type accessing the Data node, the calculated query rejection rate may be written into the query result, and then the query result carrying the query rejection rate is fed back to the Transport node, so that when the Transport node submits the query request of the same type again, the Data node may be judged according to the deployed query rejection rate, so as to achieve the purpose of reducing the number of the query requests.
In practical application, when the query rejection rate is used for judging the query request, a number of 0-1 can be randomly generated after the query request corresponding to the abnormal index is received, if the number is smaller than the query rejection rate, the query request is refused to be submitted to the data node, and otherwise, the query request is sent.
In sum, by feeding back the query rejection rate to the query node along with the query result and deploying, the same type of query requests submitted to the node later can be ensured to be controlled, so that the purpose of self-adaptive current limiting can be achieved.
In addition, considering that the query rejection rate is calculated according to the resource usage condition of the thread pool at the current moment, when the usage duty ratio of the thread pool is changed, the query rejection rate also needs to be changed, and a mode of dynamically rejecting the query request corresponding to the abnormal index is implemented, so that the resource usage condition of the thread pool can be stabilized at the most suitable water level, and in the embodiment, the specific implementation mode is as follows:
determining the thread pool use duty ratio corresponding to the data node at the current moment according to the task execution result of the query rejection task; updating the query rejection rate according to a preset increase adjustment strategy under the condition that the usage duty ratio of the thread pool is larger than a preset duty ratio threshold; and determining a growth query rejection rate according to the updated result, creating a growth query rejection task associated with the abnormal index based on the growth query rejection rate, and executing. Updating the query rejection rate according to a preset reduction adjustment strategy under the condition that the usage duty ratio of the thread pool is smaller than or equal to the preset duty ratio threshold; and determining a reduced query rejection rate according to the updating result, creating a reduced query rejection task associated with the abnormal index based on the reduced query rejection rate, and executing.
Specifically, the growth adjustment policy specifically refers to a policy for improving the query rejection rate, and the improvement of the query rejection rate can reject more query requests corresponding to abnormal indexes, so as to further reduce the use water level of the thread pool resources. Correspondingly, the reducing adjustment strategy specifically refers to a strategy for reducing the query rejection rate, and the reducing query rejection rate can accommodate more query requests corresponding to abnormal indexes, so that the water level of the thread pool resources is further stabilized below the safe water level.
Based on the task execution result of the query rejection task, determining the thread pool use duty ratio corresponding to the data node at the current moment; under the condition that the usage duty ratio of the thread pool is larger than a preset duty ratio threshold value, indicating whether the resource usage of the thread pool is relatively large, and updating the query rejection rate according to a preset growth adjustment strategy; and determining a growth query rejection rate according to the updated result, creating a growth query rejection task associated with the abnormal index based on the growth query rejection rate, and executing. The number of requests to reach the data node may be reduced at this time based on the increase query rejection task. Under the condition that the usage duty ratio of the thread pool is smaller than or equal to a preset duty ratio threshold, the resource usage of the thread pool is too low, and the query rejection rate can be updated according to a preset reduction adjustment strategy; and determining a query rejection rate according to the updating result, creating a query rejection lowering task associated with the abnormal index based on the query rejection rate lowering and executing the query rejection lowering task. The number of requests to reach the data node may be increased at this time based on the decreasing query rejection task.
In order to achieve adaptive current limiting and avoid thread pool load, the resource management method provided by the specification can firstly obtain thread pool use information corresponding to a thread pool in a data node, then determine resource consumption information corresponding to preset indexes in the data node according to the thread pool use information, and screen out problematic preset indexes, namely abnormal indexes, from the data node according to the resource consumption information respectively corresponding to all the preset indexes at the moment, and calculate query rejection rates corresponding to the abnormal indexes; when the thread pool resource is called, the burst index which may appear at the current moment can be dynamically calculated. After the request of the associated abnormal index can be received at the client side, the request can be refused by using the inquiry refusing rate, so that the quantity of the request fed back to the data node is controlled at the client side, thereby realizing self-adaptive current limiting, realizing simplicity and high efficiency, and ensuring that the thread pool resources can be dynamically allocated according to the actual situation.
The resource management method provided in the present specification is further described below with reference to fig. 3 by taking an application of the resource management method in a data access scenario as an example. Fig. 3 is a flowchart of a process of a resource management method according to an embodiment of the present disclosure, which specifically includes the following steps.
Step S302, thread pool use information corresponding to the data node is obtained.
Step S304, under the condition that the thread pool use information meets the load condition, determining a resource statistical algorithm corresponding to the data node.
Step S306, counting the resource consumption of the preset index in the data node according to the resource counting algorithm to obtain the sub-resource consumption information of the preset index corresponding to at least one set duration.
Step S308, determining the resource consumption information corresponding to the preset index based on the sub-resource consumption information corresponding to at least one set duration of the preset index.
Step S310, determining sub-resource consumption information corresponding to at least one set duration of the preset index according to the resource consumption information corresponding to the preset index.
Step S312, calculating a resource consumption value corresponding to the preset index based on the sub-resource consumption information corresponding to at least one set duration of the preset index.
In step S314, the target resource consumption value is determined by comparing the resource consumption values corresponding to the preset indexes, and the preset index corresponding to the target resource consumption value is used as the abnormal index.
Step S316, determining available query time consumption, thread pool usage duty ratio corresponding to the data node, and local index query time consumption corresponding to a preset index except for the abnormal index.
Step S318, calculating the global index time consumption corresponding to the data node according to the dominant query time consumption and the thread pool use ratio.
Step S320, calculating the reference index time consumption corresponding to the data node according to the global index time consumption and the local index query time consumption.
Step S322, according to the abnormal index time consumption corresponding to the abnormal index, the reference index time consumption and the target index time consumption corresponding to the data node, calculating the query rejection rate.
Step S324, a query rejection task associated with the abnormal index is created based on the query rejection rate, and a target query request corresponding to the abnormal index is determined by executing the query rejection task.
Step S326, writing the query rejection rate into the query result corresponding to the target query request to obtain the target query result.
Step S328, the target query result is sent to the query node to which the target query request belongs, where the query rejection rate is used to control the number of query requests corresponding to the abnormal index in the query node.
In order to achieve adaptive current limiting and avoid thread pool load, the resource management method provided by the specification can firstly obtain thread pool use information corresponding to a thread pool in a data node, then determine resource consumption information corresponding to preset indexes in the data node according to the thread pool use information, and screen out problematic preset indexes, namely abnormal indexes, from the data node according to the resource consumption information respectively corresponding to all the preset indexes at the moment, and calculate query rejection rates corresponding to the abnormal indexes; when the thread pool resource is called, the burst index which may appear at the current moment can be dynamically calculated. After the request of the associated abnormal index can be received at the client side, the request can be refused by using the inquiry refusing rate, so that the quantity of the request fed back to the data node is controlled at the client side, thereby realizing self-adaptive current limiting, realizing simplicity and high efficiency, and ensuring that the thread pool resources can be dynamically allocated according to the actual situation.
Corresponding to the above method embodiments, the present disclosure further provides an embodiment of a resource management device, and fig. 4 shows a schematic structural diagram of a resource management device provided in one embodiment of the present disclosure. As shown in fig. 4, the apparatus includes:
an obtaining module 402, configured to obtain thread pool usage information corresponding to the data node;
a determining module 404, configured to determine resource consumption information of a preset index in the data node according to the thread pool usage information;
a calculation module 406, configured to screen out an abnormal index from the data nodes according to the resource consumption information of the preset index, and calculate a query rejection rate corresponding to the abnormal index;
a creating module 408 configured to create and execute a query rejection task associated with the anomaly index based on the query rejection rate, wherein the query rejection task is used to adjust resource usage of a thread pool in the data node.
In an alternative embodiment, the determining module 404 is further configured to:
under the condition that the thread pool use information meets a load condition, determining a resource statistical algorithm corresponding to the data node; counting the resource consumption of a preset index in the data node according to the resource counting algorithm to obtain sub-resource consumption information of the preset index corresponding to at least one set duration; and determining the resource consumption information corresponding to the preset index based on the sub-resource consumption information corresponding to at least one set duration of the preset index.
In an alternative embodiment, the computing module 406 is further configured to:
determining sub-resource consumption information corresponding to at least one set duration of the preset index according to the resource consumption information corresponding to the preset index; calculating a resource consumption value corresponding to the preset index based on sub-resource consumption information of at least one set duration corresponding to the preset index; and determining a target resource consumption value by comparing the resource consumption values corresponding to the preset indexes, and taking the preset index corresponding to the target resource consumption value as the abnormal index.
In an alternative embodiment, the computing module 406 is further configured to:
determining the dominant inquiry time consumption, the thread pool use ratio corresponding to the data node and the local index inquiry time consumption corresponding to a preset index except the abnormal index; calculating global index time consumption corresponding to the data node according to the dominant query time consumption and the thread pool usage duty ratio; calculating reference index time consumption corresponding to the data node according to the global index time consumption and the local index query time consumption; and calculating the query rejection rate according to the abnormal index time consumption corresponding to the abnormal index, the reference index time consumption and the target index time consumption corresponding to the data node.
In an alternative embodiment, the creation module 408 is further configured to:
creating a query rejection task associated with the anomaly index based on the query rejection rate; determining a target query request corresponding to the abnormal index by executing the query rejection task; writing the query rejection rate into a query result corresponding to the target query request to obtain a target query result; and sending the target query result to a query node to which the target query request belongs, wherein the query rejection rate is used for controlling the request quantity of the query requests corresponding to the abnormal index in the query node.
In an alternative embodiment, the apparatus further comprises:
the determining duty ratio module is configured to determine the thread pool use duty ratio corresponding to the data node at the current moment according to the task execution result of the query rejection task; updating the query rejection rate according to a preset increase adjustment strategy under the condition that the usage duty ratio of the thread pool is larger than a preset duty ratio threshold; and determining a growth query rejection rate according to the updated result, creating a growth query rejection task associated with the abnormal index based on the growth query rejection rate, and executing.
In an alternative embodiment, the determining duty cycle module is further configured to:
updating the query rejection rate according to a preset reduction adjustment strategy under the condition that the usage duty ratio of the thread pool is smaller than or equal to the preset duty ratio threshold; and determining a reduced query rejection rate according to the updating result, creating a reduced query rejection task associated with the abnormal index based on the reduced query rejection rate, and executing.
In an alternative embodiment, the computing module 406 is further configured to:
receiving the target query request through the query node; determining a target query rejection rate corresponding to the abnormal index according to the rejection rate information stored by the query node; and under the condition that the target query request meets the query condition according to the target query rejection rate, sending the target query request to the data node.
In summary, in order to achieve adaptive current limiting and avoid causing thread pool load, thread pool usage information corresponding to a thread pool in a data node may be obtained first, then resource consumption information corresponding to preset indexes in the data node is determined according to the thread pool usage information, at this time, according to resource consumption information corresponding to all preset indexes respectively, preset indexes having problems, i.e. abnormal indexes, may be screened out from the data node, and query rejection rates corresponding to the abnormal indexes may be calculated; when the thread pool resource is called, the burst index which may appear at the current moment can be dynamically calculated. After the request of the associated abnormal index can be received at the client side, the request can be refused by using the inquiry refusing rate, so that the quantity of the request fed back to the data node is controlled at the client side, thereby realizing self-adaptive current limiting, realizing simplicity and high efficiency, and ensuring that the thread pool resources can be dynamically allocated according to the actual situation.
The above is a schematic scheme of a resource management device of the present embodiment. It should be noted that, the technical solution of the resource management device and the technical solution of the resource management method belong to the same concept, and details of the technical solution of the resource management device, which are not described in detail, can be referred to the description of the technical solution of the resource management method.
Corresponding to the above method embodiments, the present disclosure further provides a query current limiting system, and fig. 5 shows a schematic structural diagram of a query current limiting system according to one embodiment of the present disclosure. The query throttling system 500 includes a data node 520 and a query node 510;
the query node 510 is configured to determine a target index corresponding to a query request, and send the query request to the data node when determining that the target index meets a query condition according to locally stored reject rate information;
the data node 520 is configured to determine a query result by executing the query request, and load a query rejection rate corresponding to the target index; writing the query rejection rate into the query result, and sending the query result carrying the query rejection rate to the query node; and the query rejection rate is used for updating the rejection rate information stored by the query node.
The foregoing is an exemplary scenario of a query throttling system in accordance with the present embodiments. It should be noted that, the technical solution of the query current limiting system and the technical solution of the resource management method belong to the same concept, and details of the technical solution of the query current limiting system, which are not described in detail, can be referred to the description of the technical solution of the resource management method.
Corresponding to the above method embodiments, the present disclosure further provides a query current limiting method, and fig. 6 shows a flowchart of a query current limiting method provided in one embodiment of the present disclosure. The method is applied to the data node and comprises the following steps:
step S602, receiving a query request submitted by a query node aiming at a target index;
step S604, determining a query result by executing the query request, and loading a query rejection rate corresponding to the target index;
step S606, writing the query rejection rate into the query result, and sending the query result carrying the query rejection rate to the query node; and the query rejection rate is used for updating the rejection rate information stored by the query node.
The foregoing is an exemplary scenario of a query throttling method in this embodiment. It should be noted that, the technical solution of the query current limiting method and the technical solution of the resource management method belong to the same concept, and details of the technical solution of the query current limiting method, which are not described in detail, can be referred to the description of the technical solution of the resource management method.
Corresponding to the above method embodiment, the present disclosure further provides a query current limiting device, and fig. 7 shows a schematic structural diagram of a query current limiting device according to one embodiment of the present disclosure. The device is applied to a data node and comprises:
a receiving module 702 configured to receive a query request submitted by a query node for a target index;
a determining module 704 configured to determine a query result by executing the query request, and load a query rejection rate corresponding to the target index;
a writing module 706 configured to write the query rejection rate into the query result, and send the query result carrying the query rejection rate to the query node; and the query rejection rate is used for updating the rejection rate information stored by the query node.
The foregoing is an exemplary scenario of a query flow restriction device according to this embodiment. It should be noted that, the technical solution of the query current limiting device and the technical solution of the query current limiting method belong to the same concept, and details of the technical solution of the query current limiting device, which are not described in detail, can be referred to the description of the technical solution of the query current limiting method.
Fig. 8 illustrates a block diagram of a computing device 800 provided in accordance with one embodiment of the present description. The components of computing device 800 include, but are not limited to, memory 810 and processor 820. Processor 820 is coupled to memory 810 through bus 830 and database 850 is used to hold data.
Computing device 800 also includes access device 840, access device 840 enabling computing device 800 to communicate via one or more networks 860. Examples of such networks include public switched telephone networks (PSTN, public Switched Telephone Network), local area networks (LAN, local Area Network), wide area networks (WAN, wide Area Network), personal area networks (PAN, personal Area Network), or combinations of communication networks such as the internet. Access device 840 may include one or more of any type of network interface, wired or wireless, such as a network interface card (NIC, network interface controller), such as an IEEE802.11 wireless local area network (WLAN, wireless Local Area Network) wireless interface, a worldwide interoperability for microwave access (Wi-MAX, worldwide Interoperability for Microwave Access) interface, an ethernet interface, a universal serial bus (USB, universal Serial Bus) interface, a cellular network interface, a bluetooth interface, a near field communication (NFC, near Field Communication) interface, and so forth.
In one embodiment of the present application, the above-described components of computing device 800, as well as other components not shown in FIG. 8, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device illustrated in FIG. 8 is for exemplary purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as desired.
Computing device 800 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smart phone), wearable computing device (e.g., smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or personal computer (PC, personal Computer). Computing device 800 may also be a mobile or stationary server.
Wherein the processor 820 is configured to execute computer-executable instructions that, when executed by the processor, perform the steps of the resource management method or the query throttling method described above.
The foregoing is a schematic illustration of a computing device of this embodiment. It should be noted that, the technical solution of the computing device and the technical solution of the resource management method or the query current limiting method belong to the same concept, and details of the technical solution of the computing device, which are not described in detail, can be referred to the description of the technical solution of the resource management method or the query current limiting method.
An embodiment of the present disclosure also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the resource management method or the query throttling method described above.
The above is an exemplary version of a computer-readable storage medium of the present embodiment. It should be noted that, the technical solution of the storage medium and the technical solution of the resource management method or the query current limiting method belong to the same concept, and details of the technical solution of the storage medium which are not described in detail can be referred to the description of the technical solution of the resource management method or the query current limiting method.
An embodiment of the present disclosure further provides a query system, including a data node and a query node; the query node is used for triggering a query executable instruction, and the data node is used for executing the query executable instruction, and the query executable instruction realizes the steps of a resource management method or a query flow limiting method when being executed by the data node.
The foregoing is a schematic solution of a query system in this embodiment. It should be noted that, the technical solution of the query system and the technical solution of the resource management method or the query current limiting method belong to the same concept, and details of the technical solution of the query system, which are not described in detail, can be referred to the description of the technical solution of the resource management method or the query current limiting method.
An embodiment of the present disclosure further provides a computer program, where the computer program, when executed in a computer, causes the computer to perform the steps of the resource management method or the query restriction method described above.
The above is an exemplary version of a computer program of the present embodiment. It should be noted that, the technical solution of the computer program and the technical solution of the resource management method or the query current limiting method belong to the same concept, and details of the technical solution of the computer program, which are not described in detail, can be referred to the description of the technical solution of the resource management method or the query current limiting method.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The computer instructions include computer program code that may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the embodiments are not limited by the order of actions described, as some steps may be performed in other order or simultaneously according to the embodiments of the present disclosure. Further, those skilled in the art will appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all required for the embodiments described in the specification.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The preferred embodiments of the present specification disclosed above are merely used to help clarify the present specification. Alternative embodiments are not intended to be exhaustive or to limit the invention to the precise form disclosed. Obviously, many modifications and variations are possible in light of the teaching of the embodiments. The embodiments were chosen and described in order to best explain the principles of the embodiments and the practical application, to thereby enable others skilled in the art to best understand and utilize the invention. This specification is to be limited only by the claims and the full scope and equivalents thereof.
Claims (13)
1. A resource management method, comprising:
acquiring thread pool use information corresponding to the data node;
determining resource consumption information of a preset index in the data node according to the thread pool use information;
screening out abnormal indexes from the data nodes according to the resource consumption information of the preset indexes, and calculating query rejection rates corresponding to the abnormal indexes;
And creating and executing a query rejection task associated with the abnormal index based on the query rejection rate, wherein the query rejection task is used for adjusting the resource use of a thread pool in the data node.
2. The method according to claim 1, wherein the determining, according to the thread pool usage information, resource consumption information of a preset index in the data node includes:
under the condition that the thread pool use information meets a load condition, determining a resource statistical algorithm corresponding to the data node;
counting the resource consumption of a preset index in the data node according to the resource counting algorithm to obtain sub-resource consumption information of the preset index corresponding to at least one set duration;
and determining the resource consumption information corresponding to the preset index based on the sub-resource consumption information corresponding to at least one set duration of the preset index.
3. The method of claim 2, wherein the screening the data node for the abnormal index according to the resource consumption information of the preset index comprises:
determining sub-resource consumption information corresponding to at least one set duration of the preset index according to the resource consumption information corresponding to the preset index;
Calculating a resource consumption value corresponding to the preset index based on sub-resource consumption information of at least one set duration corresponding to the preset index;
and determining a target resource consumption value by comparing the resource consumption values corresponding to the preset indexes, and taking the preset index corresponding to the target resource consumption value as the abnormal index.
4. The method of claim 1, the calculating a query rejection rate corresponding to the anomaly index, comprising:
determining the dominant inquiry time consumption, the thread pool use ratio corresponding to the data node and the local index inquiry time consumption corresponding to a preset index except the abnormal index;
calculating global index time consumption corresponding to the data node according to the dominant query time consumption and the thread pool usage duty ratio;
calculating reference index time consumption corresponding to the data node according to the global index time consumption and the local index query time consumption;
and calculating the query rejection rate according to the abnormal index time consumption corresponding to the abnormal index, the reference index time consumption and the target index time consumption corresponding to the data node.
5. The method of claim 1, the creating and executing a query rejection task associated with the anomaly index based on the query rejection rate, comprising:
Creating a query rejection task associated with the anomaly index based on the query rejection rate;
determining a target query request corresponding to the abnormal index by executing the query rejection task;
writing the query rejection rate into a query result corresponding to the target query request to obtain a target query result;
and sending the target query result to a query node to which the target query request belongs, wherein the query rejection rate is used for controlling the request quantity of the query requests corresponding to the abnormal index in the query node.
6. The method of any of claims 1-5, after the creating a query rejection task associated with the anomaly index based on the query rejection rate and performing the step of performing, further comprising:
determining the thread pool use duty ratio corresponding to the data node at the current moment according to the task execution result of the query rejection task;
updating the query rejection rate according to a preset increase adjustment strategy under the condition that the usage duty ratio of the thread pool is larger than a preset duty ratio threshold;
and determining a growth query rejection rate according to the updated result, creating a growth query rejection task associated with the abnormal index based on the growth query rejection rate, and executing.
7. The method according to claim 6, wherein after determining that the thread pool usage duty ratio corresponding to the data node at the current time is executed according to the task execution result of the query rejection task, the method further comprises:
updating the query rejection rate according to a preset reduction adjustment strategy under the condition that the usage duty ratio of the thread pool is smaller than or equal to the preset duty ratio threshold;
and determining a reduced query rejection rate according to the updating result, creating a reduced query rejection task associated with the abnormal index based on the reduced query rejection rate, and executing.
8. The method of claim 5, the method further comprising:
receiving the target query request through the query node;
determining a target query rejection rate corresponding to the abnormal index according to the rejection rate information stored by the query node;
and under the condition that the target query request meets the query condition according to the target query rejection rate, sending the target query request to the data node.
9. A query throttling system comprising a data node and a query node;
the query node is configured to determine a target index corresponding to a query request, and send the query request to the data node when the target index is determined to satisfy a query condition according to locally stored rejection rate information;
The data node is used for determining a query result by executing the query request and loading a query rejection rate corresponding to the target index; writing the query rejection rate into the query result, and sending the query result carrying the query rejection rate to the query node; and the query rejection rate is used for updating the rejection rate information stored by the query node.
10. A query throttling method, applied to a data node, comprising:
receiving a query request submitted by a query node aiming at a target index;
determining a query result by executing the query request, and loading a query rejection rate corresponding to the target index;
writing the query rejection rate into the query result, and sending the query result carrying the query rejection rate to the query node; and the query rejection rate is used for updating the rejection rate information stored by the query node.
11. A query system, comprising:
a data node and a query node;
the query node is configured to trigger a query executable instruction, and the data node is configured to execute the query executable instruction, which when executed by the data node, implements the steps of the method of any of claims 1 to 8 or 10.
12. A computing device, comprising:
a memory and a processor;
the memory is configured to store computer executable instructions, the processor being configured to execute the computer executable instructions, which when executed by the processor, implement the steps of the method of any one of claims 1 to 8 or 10.
13. A computer readable storage medium storing computer executable instructions which when executed by a processor implement the steps of the method of any one of claims 1 to 8 or 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310225197.8A CN116360981A (en) | 2023-03-03 | 2023-03-03 | Resource management method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310225197.8A CN116360981A (en) | 2023-03-03 | 2023-03-03 | Resource management method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116360981A true CN116360981A (en) | 2023-06-30 |
Family
ID=86926855
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310225197.8A Pending CN116360981A (en) | 2023-03-03 | 2023-03-03 | Resource management method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116360981A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117290560A (en) * | 2023-11-23 | 2023-12-26 | 支付宝(杭州)信息技术有限公司 | Method and device for acquiring graph data in graph calculation task |
-
2023
- 2023-03-03 CN CN202310225197.8A patent/CN116360981A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117290560A (en) * | 2023-11-23 | 2023-12-26 | 支付宝(杭州)信息技术有限公司 | Method and device for acquiring graph data in graph calculation task |
CN117290560B (en) * | 2023-11-23 | 2024-02-23 | 支付宝(杭州)信息技术有限公司 | Method and device for acquiring graph data in graph calculation task |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11734271B2 (en) | Data query method, apparatus and device | |
CN108427886B (en) | Method, system, device and readable medium for setting access authority of application program | |
CN110018799B (en) | Storage pool PG (packet data) master determination method, device, equipment and readable storage medium | |
CN111478857B (en) | Interface current limiting control method and device and electronic equipment | |
CN110018899B (en) | Method and device for recycling memory | |
CN107463437B (en) | Application control method and device, storage medium and electronic equipment | |
US10554737B2 (en) | Method and apparatus for leveling loads of distributed databases | |
CN106713028B (en) | Service degradation method and device and distributed task scheduling system | |
CN111198759A (en) | Memory optimization method, system, terminal equipment and readable storage medium | |
CN109981702B (en) | File storage method and system | |
CN115277577B (en) | Data processing method, apparatus, computer device, and computer readable storage medium | |
CN116360981A (en) | Resource management method and device | |
CN107995286A (en) | Service automatic start-stop method, server and storage medium based on dubbo platforms | |
WO2020094064A1 (en) | Performance optimization method, device, apparatus, and computer readable storage medium | |
CN112600897B (en) | Multi-user access control method and device for intelligent equipment | |
US10915376B2 (en) | Systems and methods for increasing efficiency of application programming interface calls | |
EP2348676B1 (en) | Method for accessing magnanimity data of intelligent network service database and system and device thereof | |
CN117527721A (en) | Content distribution network bandwidth control method, device, equipment and storage medium | |
CN102779058A (en) | Interface data loading device and interface data loading method | |
CN109982375A (en) | A kind of the load balancing method of adjustment and device of serving cell | |
CN113873504A (en) | Application access processing method, device, terminal and storage medium | |
EP2983105B1 (en) | Electronic device, on-chip memory and method of operating the on-chip memory | |
CN115480713A (en) | Method, device and medium for determining cold and hot data | |
CN116955271A (en) | Method and device for storing data copy, electronic equipment and storage medium | |
EP3599547B1 (en) | Elastic storage volume type selection and optimization engine for public cloud environments |
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 |