CN112817719A - Method, device and equipment for adjusting parameters of thread pool and readable storage medium - Google Patents
Method, device and equipment for adjusting parameters of thread pool and readable storage medium Download PDFInfo
- Publication number
- CN112817719A CN112817719A CN202110119989.8A CN202110119989A CN112817719A CN 112817719 A CN112817719 A CN 112817719A CN 202110119989 A CN202110119989 A CN 202110119989A CN 112817719 A CN112817719 A CN 112817719A
- Authority
- CN
- China
- Prior art keywords
- value
- thread pool
- target
- item
- parameter
- 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
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/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3051—Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
-
- 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/505—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 the load
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Quality & Reliability (AREA)
- Mathematical Physics (AREA)
- Stored Programmes (AREA)
Abstract
The application discloses a method, a device and equipment for adjusting parameters of a thread pool and a readable storage medium, and relates to the technical field of Internet. The method comprises the following steps: starting a thread pool, monitoring a target host where the thread pool is located, and acquiring a performance index value of the target host; evaluating the operation of the thread pool by adopting the performance index value to generate an evaluation result value; when the evaluation result value reaches a preset warning value, determining a parameter value to be adjusted according to the evaluation result value; and based on the distributed configuration center, issuing the parameter values to be adjusted to the thread pool for operation.
Description
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for adjusting parameters of a thread pool.
Background
The concept of process and thread exists in any system and is very important, the configuration of the process and the thread is an important component in the system function, and the quality of the configuration mechanism directly relates to the operation efficiency of the whole system and the realized service function. With the increasing complexity of system functions, the expected value of the thread pool configuration in the system is higher, so that developers can periodically configure and adjust the parameters of the thread pool in the system, optimize the thread pool of the system, and improve the availability of the system.
In the related art, when parameters of a thread pool are adjusted, operation and maintenance personnel need to be contacted to perform operations such as monitoring and log viewing, and the optimal parameters are determined to adjust the thread pool. Subsequently, the system is restarted to validate the adjusted parameters.
In carrying out the present application, the applicant has found that the related art has at least the following problems:
each adjustment of the parameters requires operation and maintenance, the parameter adjustment is complex, the system has multiple functions and various caching modes, the system is restarted to cause the slow update of the system, unnecessary system consumption is caused, and the data consistency of the system is difficult to evaluate.
Disclosure of Invention
In view of the above, the present application provides a method, an apparatus, a device, and a readable storage medium for adjusting parameters of a thread pool, and mainly aims to solve the problems that operation and maintenance are required to be associated with each adjustment of parameters, the parameter adjustment is complex, the system has multiple functions and various cache ways, and the system is restarted to cause a slow update of the system, which causes unnecessary system consumption and makes it difficult to evaluate the data consistency of the system.
According to a first aspect of the present application, a method for adjusting parameters of a thread pool is provided, the method including:
starting a thread pool, monitoring a target host where the thread pool is located, and acquiring a performance index value of the target host, wherein the performance index value comprises a plurality of index items used for indicating the running state of the target host and item data corresponding to each index item in the index items;
evaluating the operation of the thread pool by adopting the performance index value to generate an evaluation result value;
when the evaluation result value reaches a preset warning value, determining a parameter value to be adjusted according to the evaluation result value;
and based on a distributed configuration center, issuing the parameter value to be adjusted to the thread pool for operation.
In another embodiment, the starting the thread pool, monitoring a target host where the thread pool is located, and acquiring the performance index value of the target host includes:
configuring initial operation parameters, and starting the thread pool according to the initial operation parameters;
determining the target host where the thread pool is located, monitoring the index items of the target host to obtain item data, wherein the index items comprise memory usage, processor usage and interface response time;
and associating the index items with corresponding item data in the item data to obtain the performance index value.
In another embodiment, the evaluating the operation of the thread pool by using the performance index value to generate an evaluation result value includes:
acquiring a plurality of standard value intervals corresponding to the plurality of index items, wherein the plurality of standard value intervals stipulate standard value ranges of the plurality of index items;
comparing the plurality of item data with the plurality of standard value intervals to determine at least one target index item, wherein the target item data corresponding to each target index item in the at least one target index item is outside the target standard value interval corresponding to the target index item;
outputting the evaluation result value based on the at least one target index item.
In another embodiment, the outputting the evaluation result value based on the target index item includes:
counting at least one designated numerical value of the target item data corresponding to the at least one target index item exceeding the corresponding target standard value interval, and marking the at least one target index item by using the at least one designated numerical value to obtain the evaluation result value; or the like, or, alternatively,
determining at least one item weight value corresponding to the at least one target index item, and performing weight calculation on the at least one designated numerical value by adopting the at least one item weight value to obtain the evaluation result value; or the like, or, alternatively,
and counting the item quantity of the at least one target index item, and taking the item quantity as the evaluation result value.
In another embodiment, the determining a value of a parameter to be adjusted according to the evaluation result value includes:
determining at least one target index item corresponding to the evaluation result value, and inquiring the associated parameters of the at least one target index item;
and inquiring a standard value corresponding to the association parameter, marking the association parameter by adopting the standard value, and taking the marked association parameter as the parameter value to be adjusted.
In another embodiment, before issuing the parameter value to be adjusted to the thread pool for running based on the distributed configuration center, the method further includes:
obtaining a rated parameter value of the thread pool, and comparing the parameter value to be adjusted with the rated parameter value;
when the parameter value to be adjusted is within the range specified by the rated parameter value, the parameter value to be adjusted is continuously issued to the thread pool;
and when the parameter value to be adjusted is out of the range specified by the rated parameter value, deleting the parameter value to be adjusted, and continuing monitoring the target host.
In another embodiment, the issuing the parameter value to be adjusted to the thread pool for running based on the distributed configuration center includes:
determining a target cluster or a target instance where the thread pool is located based on the distributed configuration center;
and assigning a value to the target cluster or the target instance by using the parameter value to be adjusted in the distributed configuration center, and controlling the thread pool to operate according to the parameter value to be adjusted.
According to a second aspect of the present application, there is provided a parameter adjusting apparatus for a thread pool, the apparatus including:
the monitoring module is used for starting a thread pool, monitoring a target host where the thread pool is located, and acquiring a performance index value of the target host, wherein the performance index value comprises a plurality of index items used for indicating the running state of the target host and item data corresponding to each index item in the index items;
the evaluation module is used for evaluating the operation of the thread pool by adopting the performance index value to generate an evaluation result value;
the determining module is used for determining a parameter value to be adjusted according to the evaluation result value when the evaluation result value reaches a preset warning value;
and the issuing module is used for issuing the parameter value to be adjusted to the thread pool for running based on a distributed configuration center.
In another embodiment, the monitoring module is configured to configure an initial operating parameter, and start the thread pool according to the initial operating parameter; determining the target host where the thread pool is located, monitoring the index items of the target host to obtain item data, wherein the index items comprise memory usage, processor usage and interface response time; and associating the index items with corresponding item data in the item data to obtain the performance index value.
In another embodiment, the evaluation module is configured to obtain a plurality of standard value intervals corresponding to the plurality of index items, where the plurality of standard value intervals specify standard value ranges of the plurality of index items; comparing the plurality of item data with the plurality of standard value intervals to determine at least one target index item, wherein the target item data corresponding to each target index item in the at least one target index item is outside the target standard value interval corresponding to the target index item; outputting the evaluation result value based on the at least one target index item.
In another embodiment, the evaluation module is configured to count at least one designated value of a target item data corresponding to the at least one target index item exceeding a corresponding target standard value interval, and mark the at least one target index item with the at least one designated value to obtain the evaluation result value; or, determining at least one item weight value corresponding to the at least one target index item, and performing weight calculation on the at least one designated numerical value by using the at least one item weight value to obtain the evaluation result value; or, counting the item quantity of the at least one target index item, and taking the item quantity as the evaluation result value.
In another embodiment, the determining module is configured to determine at least one target index item corresponding to the evaluation result value, and query a correlation parameter of the at least one target index item; and inquiring a standard value corresponding to the association parameter, marking the association parameter by adopting the standard value, and taking the marked association parameter as the parameter value to be adjusted.
In another embodiment, the apparatus further comprises:
the comparison module is used for acquiring a rated parameter value of the thread pool and comparing the parameter value to be adjusted with the rated parameter value;
the issuing module is further configured to continue issuing the parameter value to be adjusted to the thread pool when the parameter value to be adjusted is within the range specified by the rated parameter value;
and the monitoring module is further configured to delete the parameter value to be adjusted when the parameter value to be adjusted is outside the range specified by the rated parameter value, and continue to monitor the target host.
In another embodiment, the issuing module is configured to determine, based on the distributed configuration center, a target cluster or a target instance in which the thread pool is located; and assigning a value to the target cluster or the target instance by using the parameter value to be adjusted in the distributed configuration center, and controlling the thread pool to operate according to the parameter value to be adjusted.
According to a third aspect of the present application, there is provided an apparatus comprising a memory storing a computer program and a processor implementing the steps of the method of the first aspect when the processor executes the computer program.
According to a fourth aspect of the present application, there is provided a readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of the first aspect described above.
By means of the technical scheme, the method, the device, the equipment and the readable storage medium for adjusting the parameters of the thread pool monitor the performance index value of a host where the thread pool is located when the thread pool is started in real time, evaluate the running condition of the thread pool, determine whether the parameters of the thread pool need to be adjusted and how to adjust according to the obtained evaluation result value, further utilize a distributed configuration center to intensively manage the configuration of different environments and different clusters, push the effective characteristics in real time after the configuration is modified, send the adjusted parameters to the thread pool, enable the parameters to take effect in real time, achieve dynamic monitoring and adjustment of the parameters of the thread pool, accelerate the speed of parameter adjustment, avoid unnecessary consumption of a system, and ensure the consistency of system data.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flowchart illustrating a method for adjusting parameters of a thread pool according to an embodiment of the present application;
fig. 2A is a schematic flowchart illustrating a method for adjusting parameters of a thread pool according to an embodiment of the present application;
fig. 2B is a schematic flowchart illustrating a method for adjusting parameters of a thread pool according to an embodiment of the present disclosure;
fig. 3A is a schematic structural diagram illustrating a parameter adjustment apparatus for a thread pool according to an embodiment of the present disclosure;
fig. 3B is a schematic structural diagram illustrating a parameter adjustment apparatus for a thread pool according to an embodiment of the present disclosure;
fig. 4 shows a schematic device structure diagram of a computer apparatus according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
An embodiment of the present application provides a method for adjusting parameters of a thread pool, as shown in fig. 1, the method includes:
101. starting a thread pool, monitoring a target host where the thread pool is located, and acquiring a performance index value of the target host, wherein the performance index value comprises a plurality of index items for indicating the running state of the target host and item data corresponding to each index item in the plurality of index items.
102. And evaluating the operation of the thread pool by adopting the performance index value to generate an evaluation result value.
103. And when the evaluation result value reaches a preset warning value, determining a parameter value to be adjusted according to the evaluation result value.
104. And based on the distributed configuration center, issuing the parameter values to be adjusted to the thread pool for operation.
The method provided by the embodiment of the application monitors the performance index value of the host where the thread pool is located when the thread pool is started in real time, evaluates the running condition of the thread pool, determines whether the parameters of the thread pool need to be adjusted and how to adjust according to the obtained evaluation result value, further utilizes the characteristic that the distributed configuration center can intensively manage the configuration of different environments and different clusters and can push the configuration to take effect in real time after the configuration is modified, and sends the adjusted parameters to the thread pool to enable the parameters to take effect in real time, so that the dynamic monitoring and adjustment of the parameters of the thread pool are realized, the speed of parameter adjustment is accelerated, unnecessary consumption of a system is avoided, and the consistency of system data is ensured.
An embodiment of the present application provides a method for adjusting parameters of a thread pool, as shown in fig. 2A, the method includes:
201. and starting the thread pool, monitoring the target host where the thread pool is located, and acquiring the performance index value of the target host.
The applicant realizes that parameter adjustment on the thread pool is mostly performed by staff at present, and the adjustment time and the specific adjustment value are artificially determined. When the thread pool has a requirement for parameter adjustment, the worker needs to perform operations such as monitoring and log viewing, determine the optimal parameter and adjust the thread pool, and the whole process involves a large amount of labor and time cost and needs continuous tracking by the worker. Moreover, if the parameters of the thread pool are to be optimized, the system where the thread pool is located needs to be restarted after the parameters are adjusted. Most of the existing systems are complex in function and various in caching mode, and frequent restarting of the systems can cause slow updating of the systems, which causes unnecessary system consumption, difficult evaluation of the consistency of data in the updated systems, low overall efficiency of parameter adjustment, and lack of a mature and reliable adjustment mechanism. Therefore, the application provides a parameter adjustment method for a thread pool, which monitors the performance index value of a host where the thread pool is located when the thread pool is started in real time, evaluates the operation condition of the thread pool, determines whether the parameter of the thread pool needs to be adjusted and how to adjust the parameter according to the obtained evaluation result value, further utilizes a distributed configuration center (Apollo) to intensively manage the configuration of different environments and different clusters, and can push the effective characteristic in real time after the configuration is modified, and sends the adjusted parameter to the thread pool, so that the parameter is effective in real time, the dynamic monitoring and adjustment of the parameter of the thread pool are realized, the parameter adjustment speed is higher, no perception is given to a user of a system, and unnecessary consumption is avoided being brought to the system. The distributed configuration center may be Apollo (Apollo) specifically.
In the embodiment of the present application, the thread pool needs to run to be able to monitor and determine how to adjust, and therefore, the thread pool needs to be started first. Since the Apollo is utilized in the present application, the Apollo can actually provide a configuration page in which the initial parameters of the thread pool are configured, so that the thread pool is started according to the initial parameters when the service of the system is started. The initial parameters may specifically include the size of the core thread pool, the maximum thread count of the thread pool, and the survival time of idle threads, and the initial parameters may be configured by the staff. It should be noted that, in the process of practical application, the thread pools may be multiple or clustered, so that each thread pool needs to be touched when starting the thread pool, monitoring, evaluating, and parameter adjustment issuing, and in this embodiment of the present application, a certain thread pool is taken as an example for description, and each thread pool can execute the parameter adjustment process described in the present application.
After the thread pool is started, monitoring a target host where the thread pool is located is started, and a performance index value of the target host is obtained, so that the actual operation condition of the thread pool is subsequently evaluated based on the performance index value, and whether the parameters of the thread pool need to be adjusted is judged. The performance index value comprises a plurality of index items for indicating the operating conditions of the target host and item data corresponding to each index item in the index items. When obtaining the performance index value, first, a target host where the thread pool is located is determined, a plurality of index items of the target host are monitored, and a plurality of item data are obtained, where the plurality of index items specifically include memory usage, processor usage, and interface response time, and the item data are specific numerical values of the memory usage, the processor usage, the interface response time, and the like, and the processor usage may specifically be CPU (Central Processing Unit) usage. Subsequently, it is necessary to associate the plurality of index items with corresponding item data among the plurality of item data, thereby obtaining the performance index value.
202. And evaluating the operation of the thread pool by adopting the performance index value to generate an evaluation result value. When the evaluation result value reaches the preset warning value, executing the following steps 203 to 204; when the evaluation result value does not reach the preset guard value, the following step 205 is performed.
In the embodiment of the application, after the performance index value of the target host is obtained, the performance index value is adopted to evaluate the operation of the thread pool, and an evaluation result value is generated, so that whether the parameters of the thread pool need to be adjusted or not is determined according to the indication of the evaluation result value. The process of generating the evaluation result value specifically refers to the process from the following step one to the step three:
the method comprises the steps of firstly, obtaining a plurality of standard value intervals corresponding to a plurality of index items.
The standard value intervals specify the standard value ranges of the index items. The standard value-taking interval can be set by a worker according to the daily operation condition of the system, or can also be an allowable value-taking range of each index item determined by counting big data indexes generated by the operation of the system in the historical process. For example, for an index item of the memory usage amount, the corresponding standard value interval may be less than 80%; for the index item of the processor usage, the corresponding standard value interval may be less than 80%, and the like. It should be noted that the standard value interval is not fixed, and may be set or defaulted according to different scenes, different projects, and different services, and the content of the standard value interval is not specifically limited in the present application.
And step two, comparing the plurality of item data with the plurality of standard value intervals to determine at least one target index item.
The target item data corresponding to each target index item in the at least one target index item is outside the target standard value range corresponding to the target index item, that is, the target item data corresponding to the target index item exceeds the corresponding bearable range, and the target index item needs to be adjusted. For example, assuming that for an index item of processor usage, the corresponding standard value interval is less than 80%, and the processor usage in the performance index value has reached 90%, the processor usage may be used as a target index item.
And thirdly, outputting an evaluation result value based on at least one target index item.
The evaluation result value is actually used to describe the actual behavior of the thread pool, and various methods may be employed in generating the evaluation result value. One method is to count at least one designated value of the target item data corresponding to at least one target index item exceeding the corresponding target standard value interval, and mark at least one target index item by using the at least one designated value to obtain an evaluation result value. The method comprises the steps of calculating the value of each target index item exceeding the corresponding standard value interval, marking the target index item by the exceeding value, and taking the marked target index item as an evaluation result value, so that whether the exceeding value of each target index item is allowed under the current scene or not is judged in the follow-up process, and the target index item does not exceed the standard value by adjusting parameters.
The other method is that at least one item weight value corresponding to at least one target index item is determined, and at least one designated numerical value is subjected to weight calculation by adopting the at least one item weight value to obtain an evaluation result value. The corresponding item weight value is set according to the influence of each target index item on the system, so that after the number exceeding the standard value interval corresponding to each target index item is counted, the item weight value corresponding to each target index item is utilized to perform weighted calculation on the exceeding number value, the obtained result is used as an evaluation result value, and then the evaluation result value which integrates the exceeding number values of a plurality of target index items is evaluated in the follow-up process to determine whether the thread pool needs to be adjusted or not.
In still another method, the number of items of at least one target index item is counted, and the number of items is used as an evaluation result value. Namely, the number of target index items is counted, and the number is used as an evaluation result value, so that whether the parameters of the thread pool need to be adjusted or not is determined by judging the number of the index items which exceed the standard in the subsequent process. It should be noted that, the process of generating the evaluation result value in the foregoing process is several optional generation manners, and in the process of practical application, the obtained target index item may also be directly used as the evaluation result value, and the generation manner of the evaluation result value is not specifically limited in the present application.
Through the above steps one to three, the generation of the evaluation result value is completed. And after the evaluation result value is determined, judging whether the parameters of the thread pool need to be adjusted or not based on the evaluation result value. The system is provided with a preset warning value, the preset warning value is the maximum index value which can be borne by the system, the system can normally work below the preset warning value, and if the preset warning value is exceeded, the parameters of the thread pool need to be adjusted, so that the normal operation of the system is ensured. Therefore, when the evaluation result value reaches the preset warning value, it indicates that the running state of the current thread pool is not good, and the thread pool needs to be tuned, that is, the following steps 203 to 204 are performed. And when the evaluation result value does not reach the preset warning value, it indicates that the running state of the thread pool is good, and the thread pool does not need to be subjected to parameter adjustment, the working state of the thread pool is maintained, and the target host continues to be monitored, that is, the following step 205 is executed.
In addition, it should be noted that, since various processes for generating the evaluation result value are shown in the above step three, the preset warning value may actually be set in various ways. For example, if the evaluation result value is obtained by counting the number of each target index item exceeding the corresponding standard value interval and marking the target index item with the exceeding number, the preset warning value may be the maximum value that each target index item can exceed. Assuming that the evaluation result value is obtained by performing weighted calculation on the exceeded value, the preset guard value may be a result of performing weighted calculation on the maximum value that can be exceeded by each target index item. Assuming that the evaluation result value is obtained by counting the number of target index items, the preset warning value may be a maximum number, that is, the maximum number of index items that can be carried by the system exceeds the standard. However, if the obtained target index items are directly used as the evaluation result value, the preset warning value may also be the maximum value at which each target index item can exceed the standard, and the setting mode of the preset warning value is not specifically limited in the present application.
203. And when the evaluation result value reaches a preset warning value, determining a parameter value to be adjusted according to the evaluation result value.
In the embodiment of the present application, when the evaluation result value reaches the preset warning value, it indicates that the running state of the current thread pool is not good, and the thread pool needs to be optimized, so that the parameter value to be adjusted needs to be determined according to the evaluation result value. When the parameter values to be adjusted are determined, considering that the parameters related to each target index item are different, only the associated parameters associated with the target index item will affect the target index item, so at first, at least one target index item corresponding to the evaluation result value is determined, the associated parameters of at least one target index item are queried, and which parameters affect the target index item are determined, so that the parameters are adjusted only. And then, inquiring a standard value corresponding to the associated parameter, marking the associated parameter by adopting the standard value, and taking the marked associated parameter as a parameter value to be adjusted so as to adjust the value of the associated parameter to the standard value determined by the system. Further, the process of determining the number of the parameters to be adjusted is actually a recommended value automatically given by the system according to the recorded running number of the thread pool, the use condition of the device CPU and the memory as a standard value of the parameters to be adjusted. In the practical application process, a worker can manually input a parameter value to the Apollo as a parameter value to be adjusted according to the requirement, and then the subsequent Apollo can adjust the parameter of the thread pool according to the requirement of the worker.
204. And based on the distributed configuration center, issuing the parameter values to be adjusted to the thread pool for operation.
In the embodiment of the application, after the parameter value to be adjusted is determined, the parameter value to be adjusted can be issued to the thread pool for running. Wherein, the issuing of the parameter value to be adjusted is realized based on Apollo. The thread pool actually runs on an instance, and the instance needs to monitor the change of the parameter to complete the adjustment of the parameter, so in the embodiment of the application, a target cluster or a target instance where the thread pool is located is determined based on the distributed configuration center, the value of the parameter to be adjusted is assigned to the target cluster or the target instance in the distributed configuration center, and the thread pool is controlled to run according to the parameter value to be adjusted. That is, the Apollo will issue the parameter value to be adjusted to the target cluster where the thread pool is located or the target instance where the thread pool runs, so that the parameter to be adjusted can run directly without restarting the system.
In addition, it should be noted that before the thread pool runs the parameter value to be adjusted, the execution condition of the current thread pool is also determined, and it is determined whether the parameter adjustment is really needed. Because a plurality of instances run simultaneously in the system, the monitoring result and the parameter adjustment are probably one-sided and do not accord with the actual running condition of the instances, so that the running effect of the thread pool after the parameter adjustment is worse instead because the adjusted parameter is too large and does not accord with the actual running condition of the current instance, the system in the embodiment of the application can check the value of the parameter to be adjusted. During verification, the system can acquire a rated parameter value of the thread pool, compare the parameter value to be adjusted with the rated parameter value, and judge whether the parameter value to be adjusted exceeds the rated value of the thread pool. And when the parameter value to be adjusted is in the range specified by the rated parameter value, continuously transmitting the parameter value to be adjusted to the thread pool. And when the parameter value to be adjusted is out of the range specified by the rated parameter value, deleting the parameter value to be adjusted, continuing monitoring the target host, and waiting for the next adjustment. Under the mechanism, the system can ensure the rationality of parameter adjustment and the running quality of the thread pool by using a double-verification mode.
205. And when the evaluation result value does not reach the preset warning value, keeping the working state of the thread pool, and continuously monitoring the target host.
In the embodiment of the application, when the evaluation result value does not reach the preset warning value, the running state of the thread pool is good, the adjustment of parameters of the thread pool is not needed, the working state of the thread pool is maintained, and the monitoring of the target host is continued.
To sum up, the parameter adjustment process of the thread pool in the present application is as follows: referring to fig. 2B, when the service of the system is started, the thread pool starts to work, and Apollo monitors the target host where the thread pool is located, so as to obtain the performance index value of the target host. And then, evaluating the operation of the thread pool by Apollo based on the performance index value to obtain an evaluation result value of the thread pool. And when the evaluation result value reaches a preset warning value, determining a parameter value to be adjusted by Apollo, sending the parameter value to be adjusted to the thread pool for changing, operating the parameter value to be adjusted by the thread pool to enable the parameter value to be adjusted to take effect, and continuously keeping the operation state on the instance. According to the parameter adjusting method for the thread pool, the distributed configuration center is used for providing an interface, the thread pool parameters can be adjusted rapidly, the thread pool in service is managed in a centralized mode, adjustment operations such as shutdown and startup of the thread pool, core parameters of the thread pool and the like are performed rapidly, and the thread pool is managed conveniently. On the other hand, the thread pool tuning always has the problems that the execution efficiency of different machine configuration thread pools is different, and the performance optimization can be achieved only by continuously adjusting the parameters of the thread pools, and the thread pool parameters can be rapidly adjusted based on the distributed configuration center, so that the dynamic tuning of the thread pools is achieved. Moreover, the distributed configuration center supports parameter clustering, instance issuing configuration, monitoring configuration, instance reading after updating and updated parameter issuing to the thread pool, so that the parameter adjusting speed is higher, no perception is provided for users, and distributed hot updating parameters are realized.
The method provided by the embodiment of the application monitors the performance index value of the host where the thread pool is located when the thread pool is started in real time, evaluates the running condition of the thread pool, determines whether the parameters of the thread pool need to be adjusted and how to adjust according to the obtained evaluation result value, further utilizes the characteristic that the distributed configuration center can intensively manage the configuration of different environments and different clusters and can push the configuration to take effect in real time after the configuration is modified, and sends the adjusted parameters to the thread pool to enable the parameters to take effect in real time, so that the dynamic monitoring and adjustment of the parameters of the thread pool are realized, the speed of parameter adjustment is accelerated, unnecessary consumption of a system is avoided, and the consistency of system data is ensured.
Further, as a specific implementation of the method shown in fig. 1, an embodiment of the present application provides a parameter adjusting apparatus for a thread pool, and as shown in fig. 3A, the apparatus includes: the monitoring module 301, the evaluation module 302, the determination module 303 and the issuing module 304.
The monitoring module 301 is configured to start a thread pool, monitor a target host where the thread pool is located, and obtain a performance index value of the target host, where the performance index value includes a plurality of index items used for indicating an operating condition of the target host and item data corresponding to each of the plurality of index items;
the evaluation module 302 is configured to evaluate the operation of the thread pool by using the performance index value to generate an evaluation result value;
the determining module 303 is configured to determine a parameter value to be adjusted according to the evaluation result value when the evaluation result value reaches a preset warning value;
the issuing module 304 is configured to issue the parameter value to be adjusted to the thread pool for running based on a distributed configuration center.
In a specific application scenario, the monitoring module 301 is configured to configure an initial operation parameter, and start the thread pool according to the initial operation parameter; determining the target host where the thread pool is located, monitoring the index items of the target host to obtain item data, wherein the index items comprise memory usage, processor usage and interface response time; and associating the index items with corresponding item data in the item data to obtain the performance index value.
In a specific application scenario, the evaluation module 302 is configured to obtain a plurality of standard value intervals corresponding to the plurality of index items, where the plurality of standard value intervals specify standard value ranges of the plurality of index items; comparing the plurality of item data with the plurality of standard value intervals to determine at least one target index item, wherein the target item data corresponding to each target index item in the at least one target index item is outside the target standard value interval corresponding to the target index item; outputting the evaluation result value based on the at least one target index item.
In a specific application scenario, the evaluation module 302 is configured to count at least one specified value of the target item data corresponding to the at least one target index item exceeding the corresponding target standard value interval, and mark the at least one target index item with the at least one specified value to obtain the evaluation result value; or, determining at least one item weight value corresponding to the at least one target index item, and performing weight calculation on the at least one designated numerical value by using the at least one item weight value to obtain the evaluation result value; or, counting the item quantity of the at least one target index item, and taking the item quantity as the evaluation result value.
In a specific application scenario, the determining module 303 is configured to determine at least one target index item corresponding to the evaluation result value, and query a correlation parameter of the at least one target index item; and inquiring a standard value corresponding to the association parameter, marking the association parameter by adopting the standard value, and taking the marked association parameter as the parameter value to be adjusted.
In a specific application scenario, as shown in fig. 3B, the apparatus further includes: and an alignment module 305.
The comparing module 305 is configured to obtain a rated parameter value of the thread pool, and compare the parameter value to be adjusted with the rated parameter value;
the issuing module 304 is further configured to continue to issue the parameter value to be adjusted to the thread pool when the parameter value to be adjusted is within the range specified by the rated parameter value;
the monitoring module 301 is further configured to delete the parameter value to be adjusted when the parameter value to be adjusted is outside the range specified by the rated parameter value, and continue monitoring the target host.
In a specific application scenario, the issuing module 304 is configured to determine, based on the distributed configuration center, a target cluster or a target instance where the thread pool is located; and assigning a value to the target cluster or the target instance by using the parameter value to be adjusted in the distributed configuration center, and controlling the thread pool to operate according to the parameter value to be adjusted.
The device provided by the embodiment of the application monitors the performance index value of a host where the thread pool is located when the thread pool is started in real time, evaluates the running condition of the thread pool, determines whether the parameters of the thread pool need to be adjusted and how to adjust according to the obtained evaluation result value, further utilizes the characteristic that a distributed configuration center can intensively manage different environments, different clusters can be configured, and the configuration can be pushed to take effect in real time after being modified, and sends the adjusted parameters to the thread pool, so that the parameters take effect in real time, dynamic monitoring and adjustment of the parameters of the thread pool are realized, the speed of parameter adjustment is accelerated, unnecessary consumption of a system is avoided, and the consistency of system data is ensured.
It should be noted that, in the embodiment of the present application, other corresponding descriptions of the functional units related to the parameter adjustment apparatus for a thread pool may refer to corresponding descriptions in fig. 1 and fig. 2A to fig. 2B, which are not described herein again.
In an exemplary embodiment, referring to fig. 4, there is further provided a device, where the device 400 includes a communication bus, a processor, a memory, and a communication interface, and may further include an input/output interface and a display device, where the functional units may communicate with each other through the bus. The memory stores a computer program, and the processor is configured to execute the program stored in the memory and execute the parameter adjustment method of the thread pool in the above embodiment.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method for parameter adjustment of a thread pool.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by hardware, and also by software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the implementation scenarios of the present application.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application.
Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial numbers are for description purposes only and do not represent the superiority or inferiority of the implementation scenarios.
The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.
Claims (10)
1. A method for adjusting parameters of a thread pool is characterized by comprising the following steps:
starting a thread pool, monitoring a target host where the thread pool is located, and acquiring a performance index value of the target host, wherein the performance index value comprises a plurality of index items used for indicating the running state of the target host and item data corresponding to each index item in the index items;
evaluating the operation of the thread pool by adopting the performance index value to generate an evaluation result value;
when the evaluation result value reaches a preset warning value, determining a parameter value to be adjusted according to the evaluation result value;
and based on a distributed configuration center, issuing the parameter value to be adjusted to the thread pool for operation.
2. The method according to claim 1, wherein the starting the thread pool, monitoring a target host where the thread pool is located, and acquiring the performance index value of the target host comprises:
configuring initial operation parameters, and starting the thread pool according to the initial operation parameters;
determining the target host where the thread pool is located, monitoring the index items of the target host to obtain item data, wherein the index items comprise memory usage, processor usage and interface response time;
and associating the index items with corresponding item data in the item data to obtain the performance index value.
3. The method of claim 1, wherein evaluating the operation of the thread pool using the performance indicator value to generate an evaluation result value comprises:
acquiring a plurality of standard value intervals corresponding to the plurality of index items, wherein the plurality of standard value intervals stipulate standard value ranges of the plurality of index items;
comparing the plurality of item data with the plurality of standard value intervals to determine at least one target index item, wherein the target item data corresponding to each target index item in the at least one target index item is outside the target standard value interval corresponding to the target index item;
outputting the evaluation result value based on the at least one target index item.
4. The method according to claim 3, wherein the outputting the evaluation result value based on the target index item includes:
counting at least one designated numerical value of the target item data corresponding to the at least one target index item exceeding the corresponding target standard value interval, and marking the at least one target index item by using the at least one designated numerical value to obtain the evaluation result value; or the like, or, alternatively,
determining at least one item weight value corresponding to the at least one target index item, and performing weight calculation on the at least one designated numerical value by adopting the at least one item weight value to obtain the evaluation result value; or the like, or, alternatively,
and counting the item quantity of the at least one target index item, and taking the item quantity as the evaluation result value.
5. The method of claim 1, wherein determining the value of the parameter to be adjusted according to the evaluation result value comprises:
determining at least one target index item corresponding to the evaluation result value, and inquiring the associated parameters of the at least one target index item;
and inquiring a standard value corresponding to the association parameter, marking the association parameter by adopting the standard value, and taking the marked association parameter as the parameter value to be adjusted.
6. The method according to claim 1, wherein before issuing the parameter value to be adjusted to the thread pool for running based on the distributed configuration center, the method further comprises:
obtaining a rated parameter value of the thread pool, and comparing the parameter value to be adjusted with the rated parameter value;
when the parameter value to be adjusted is within the range specified by the rated parameter value, the parameter value to be adjusted is continuously issued to the thread pool;
and when the parameter value to be adjusted is out of the range specified by the rated parameter value, deleting the parameter value to be adjusted, and continuing monitoring the target host.
7. The method of claim 1, wherein the issuing the parameter value to be adjusted to the thread pool for operation based on a distributed configuration center comprises:
determining a target cluster or a target instance where the thread pool is located based on the distributed configuration center;
and assigning a value to the target cluster or the target instance by using the parameter value to be adjusted in the distributed configuration center, and controlling the thread pool to operate according to the parameter value to be adjusted.
8. A parameter adjustment apparatus for a thread pool, comprising:
the monitoring module is used for starting a thread pool, monitoring a target host where the thread pool is located, and acquiring a performance index value of the target host, wherein the performance index value comprises a plurality of index items used for indicating the running state of the target host and item data corresponding to each index item in the index items;
the evaluation module is used for evaluating the operation of the thread pool by adopting the performance index value to generate an evaluation result value;
the determining module is used for determining a parameter value to be adjusted according to the evaluation result value when the evaluation result value reaches a preset warning value;
and the issuing module is used for issuing the parameter value to be adjusted to the thread pool for running based on a distributed configuration center.
9. An apparatus comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110119989.8A CN112817719A (en) | 2021-01-28 | 2021-01-28 | Method, device and equipment for adjusting parameters of thread pool and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110119989.8A CN112817719A (en) | 2021-01-28 | 2021-01-28 | Method, device and equipment for adjusting parameters of thread pool and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112817719A true CN112817719A (en) | 2021-05-18 |
Family
ID=75860221
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110119989.8A Pending CN112817719A (en) | 2021-01-28 | 2021-01-28 | Method, device and equipment for adjusting parameters of thread pool and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112817719A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113268330A (en) * | 2021-05-28 | 2021-08-17 | 中国银行股份有限公司 | Thread pool parameter adjusting method and device |
CN113590285A (en) * | 2021-07-23 | 2021-11-02 | 上海万物新生环保科技集团有限公司 | Method, system and equipment for dynamically setting thread pool parameters |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103888279A (en) * | 2012-12-20 | 2014-06-25 | 阿里巴巴集团控股有限公司 | Resource pool dynamic management method and system based on feedback control cycle |
CN110716764A (en) * | 2019-09-09 | 2020-01-21 | 深圳壹账通智能科技有限公司 | Sharing method and device of public configuration, computer equipment and storage medium |
CN112000455A (en) * | 2020-09-10 | 2020-11-27 | 华云数据控股集团有限公司 | Multithreading task processing method and device and electronic equipment |
-
2021
- 2021-01-28 CN CN202110119989.8A patent/CN112817719A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103888279A (en) * | 2012-12-20 | 2014-06-25 | 阿里巴巴集团控股有限公司 | Resource pool dynamic management method and system based on feedback control cycle |
CN110716764A (en) * | 2019-09-09 | 2020-01-21 | 深圳壹账通智能科技有限公司 | Sharing method and device of public configuration, computer equipment and storage medium |
CN112000455A (en) * | 2020-09-10 | 2020-11-27 | 华云数据控股集团有限公司 | Multithreading task processing method and device and electronic equipment |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113268330A (en) * | 2021-05-28 | 2021-08-17 | 中国银行股份有限公司 | Thread pool parameter adjusting method and device |
CN113590285A (en) * | 2021-07-23 | 2021-11-02 | 上海万物新生环保科技集团有限公司 | Method, system and equipment for dynamically setting thread pool parameters |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7020616B2 (en) | Methods and systems for resource scheduling | |
CN109586952B (en) | Server capacity expansion method and device | |
US8533731B2 (en) | Apparatus and method for distrubuting complex events based on correlations therebetween | |
CN102546256B (en) | System and method used for monitoring cloud computation service | |
CN112463543B (en) | Monitoring method of service data, rule data generation method, device and system | |
US8627147B2 (en) | Method and computer program product for system tuning based on performance measurements and historical problem data and system thereof | |
EP2894565A1 (en) | Method and device for determining task to be migrated based on cache perception | |
CN112817719A (en) | Method, device and equipment for adjusting parameters of thread pool and readable storage medium | |
CN115373835A (en) | Task resource adjusting method and device for Flink cluster and electronic equipment | |
JPWO2005017736A1 (en) | System and program for detecting bottleneck in disk array device | |
US20160080267A1 (en) | Monitoring device, server, monitoring system, monitoring method and program recording medium | |
CN109144846B (en) | Test method and device for testing server | |
CN114490078A (en) | Dynamic capacity reduction and expansion method, device and equipment for micro-service | |
CN110941486A (en) | Task management method and device, electronic equipment and computer readable storage medium | |
CN104135525B (en) | The resource expansion method and apparatus of cloud platform ELB components | |
CN107193749B (en) | Test method, device and equipment | |
US9052952B1 (en) | Adaptive backup model for optimizing backup performance | |
CN111258724B (en) | Data processing method, device, equipment and storage medium of distributed system | |
CN113448747A (en) | Data transmission method and device, computer equipment and storage medium | |
CN108121728B (en) | Method and device for extracting data from database | |
CN111737136A (en) | Object testing method and device based on Internet of things platform | |
CN114003367B (en) | Risk monitoring method, device, equipment and storage medium | |
CN117971455B (en) | Service request scheduling system based on ship equipment load balancing and control method thereof | |
CN112181755B (en) | Method for determining parameter threshold in search service and related equipment | |
CN116257382A (en) | Database regulation method, device, electronic equipment and computer readable storage medium |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20210518 |