CN114090225A - Method and device for dynamically adjusting regional server thread - Google Patents

Method and device for dynamically adjusting regional server thread Download PDF

Info

Publication number
CN114090225A
CN114090225A CN202110068684.9A CN202110068684A CN114090225A CN 114090225 A CN114090225 A CN 114090225A CN 202110068684 A CN202110068684 A CN 202110068684A CN 114090225 A CN114090225 A CN 114090225A
Authority
CN
China
Prior art keywords
information
server
performance
load
represented
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110068684.9A
Other languages
Chinese (zh)
Inventor
吴怡燃
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110068684.9A priority Critical patent/CN114090225A/en
Publication of CN114090225A publication Critical patent/CN114090225A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation 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/505Allocation 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a method and a device for dynamically adjusting regional server threads. One embodiment of the method comprises: determining the operation information of the server in the area to be adjusted within a preset time period from the current time; determining adjustment information for adjusting the thread of the server in the area to be adjusted according to the operation information and the preset limit information; and adjusting the number of the threads of the area server to be adjusted according to the adjustment information. The application provides a mechanism for dynamically adjusting the processing capacity of the regional server according to the running information of the regional server, and improves the flexibility of adjusting the processing capacity of the regional server.

Description

Method and device for dynamically adjusting regional server thread
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for dynamically adjusting regional server threads.
Background
Typically, a server cluster is composed of a plurality of regional servers, and client-to-server cluster operation requests are processed by the specific regional servers. When the operation request reaches the area server, the operation request is specifically processed by a handler (handler) in the area server. We should maximize the utilization of the standalone load to ensure that the correct number of handlers can be configured. Currently, the number of threads for a single zone server is specified by a configuration file. If the set thread number is too large, the processing capacity of the server exceeding the area is insufficient, and if the set thread number is too small, the problem of wasting server resources is caused.
Disclosure of Invention
The embodiment of the application provides a method and a device for dynamically adjusting regional server threads.
In a first aspect, an embodiment of the present application provides a method for dynamically adjusting a zone server thread, including: determining the operation information of the server in the area to be adjusted within a preset time period from the current time; determining adjustment information for adjusting the thread of the server in the area to be adjusted according to the operation information and the preset limit information; and adjusting the number of the threads of the area server to be adjusted according to the adjustment information.
In some embodiments, the determining the operation information of the area server to be adjusted within the preset time period from the current time includes: acquiring operation information of a server in an area to be adjusted based on a preset time interval; and taking the average value of the operation information collected in the preset time period from the current time as the operation information of the server in the area to be adjusted in the preset time period.
In some embodiments, the operation information includes load information and performance information, and the preset restriction information includes load restriction information and performance restriction information; the determining, according to the operation information and the preset restriction information, adjustment information for adjusting the thread of the area server to be adjusted includes: in response to determining that the machine utilization rate represented by the load information is smaller than the machine utilization rate represented by the load limiting information and the request processing time represented by the performance information is smaller than the request processing time represented by the performance limiting information, determining adjustment information for expanding the capacity of the thread of the server in the area to be adjusted; and in response to the fact that the machine utilization rate represented by the load information is not smaller than the machine utilization rate represented by the load limiting information or the request processing time represented by the performance information is not smaller than the request processing time represented by the performance limiting information, determining adjustment information for performing capacity reduction on the thread of the area server to be adjusted.
In some embodiments, the preset limit information further includes load tolerance information and performance tolerance information; the determining, in response to determining that the machine usage rate represented by the load information is smaller than the machine usage rate represented by the load limiting information and that the request processing time represented by the performance information is smaller than the request processing time represented by the performance limiting information, adjustment information for expanding the capacity of the thread of the area server to be adjusted includes: and in response to determining that the machine utilization rate represented by the load information is smaller than the machine utilization rate represented by the load limitation information, the request processing time represented by the performance information is smaller than the request processing time represented by the performance limitation information, the difference between the machine utilization rate represented by the load limitation information and the machine utilization rate represented by the load information is larger than the machine utilization rate represented by the load tolerance information, and the difference between the request processing time represented by the performance limitation information and the request processing time represented by the performance information is larger than the request processing time represented by the performance tolerance information, determining adjustment information for expanding the thread of the area server to be adjusted by a preset step length.
In some embodiments, the above method further comprises: and acquiring a preset time period, load limiting information, performance limiting information, load tolerance information, performance tolerance information and a preset step length through the configuration file of the server in the area to be adjusted.
In a second aspect, an embodiment of the present application provides an apparatus for dynamically adjusting a zone server thread, including: a first determination unit configured to determine operation information of a regional server to be adjusted within a preset time period up to a current time; the second determining unit is configured to determine adjusting information for adjusting the thread of the server in the area to be adjusted according to the running information and the preset limiting information; and the adjusting unit is configured to adjust the number of threads of the area server to be adjusted according to the adjusting information.
In some embodiments, the first determining unit is further configured to: acquiring operation information of a server in an area to be adjusted based on a preset time interval; and taking the average value of the operation information collected in the preset time period from the current time as the operation information of the server in the area to be adjusted in the preset time period.
In some embodiments, the operation information includes load information and performance information, and the preset restriction information includes load restriction information and performance restriction information; a second determination unit further configured to: in response to determining that the machine utilization rate represented by the load information is smaller than the machine utilization rate represented by the load limiting information and the request processing time represented by the performance information is smaller than the request processing time represented by the performance limiting information, determining adjustment information for expanding the capacity of the thread of the server in the area to be adjusted; and in response to the fact that the machine utilization rate represented by the load information is not smaller than the machine utilization rate represented by the load limiting information or the request processing time represented by the performance information is not smaller than the request processing time represented by the performance limiting information, determining adjustment information for performing capacity reduction on the thread of the area server to be adjusted.
In some embodiments, the preset limit information further includes load tolerance information and performance tolerance information; a second determination unit further configured to: and in response to determining that the machine utilization rate represented by the load information is smaller than the machine utilization rate represented by the load limitation information, the request processing time represented by the performance information is smaller than the request processing time represented by the performance limitation information, the difference between the machine utilization rate represented by the load limitation information and the machine utilization rate represented by the load information is larger than the machine utilization rate represented by the load tolerance information, and the difference between the request processing time represented by the performance limitation information and the request processing time represented by the performance information is larger than the request processing time represented by the performance tolerance information, determining adjustment information for expanding the thread of the area server to be adjusted by a preset step length.
In some embodiments, the above apparatus further comprises: the acquisition unit is configured to acquire a preset time period, load limit information, performance limit information, load tolerance information, performance tolerance information and a preset step length through a configuration file of the server in the area to be adjusted.
In a third aspect, the present application provides a computer-readable medium, on which a computer program is stored, where the program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement a method as described in any implementation of the first aspect.
According to the method and the device for dynamically adjusting the regional server thread, the running information of the regional server to be adjusted in the preset time period from the current time is determined; determining adjustment information for adjusting the thread of the server in the area to be adjusted according to the operation information and the preset limit information; and adjusting the number of threads of the regional server to be adjusted according to the adjustment information, thereby providing a mechanism for dynamically adjusting the processing capacity of the regional server according to the running information of the regional server and improving the flexibility of adjusting the processing capacity of the regional server.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for dynamically adjusting a zone server thread according to the present application;
FIG. 3 is a diagram illustrating an application scenario of a method for dynamically adjusting a zone server thread according to the present embodiment;
FIG. 4 is a flow diagram of yet another embodiment of a method of dynamically adjusting zone server threads according to the present application;
FIG. 5 is a block diagram of one embodiment of an apparatus to dynamically adjust zone server threads according to the present application;
FIG. 6 is a block diagram of a computer system suitable for use in implementing embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary architecture 100 to which the methods and apparatus for dynamically adjusting zone server threads of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The communication connections between the terminal devices 101, 102, 103 form a topological network, and the network 104 serves to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 101, 102, 103 may be hardware devices or software that support network connections for data interaction and data processing. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices supporting network connection, information acquisition, interaction, display, processing, and the like, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a background processing server that acquires operation requests sent by the terminal apparatuses 101, 102, 103 and processes the received operation requests. In the process of processing the operation request, the background processing server can dynamically adjust the processing capacity of the background processing server according to the running information of the background processing server. As an example, the server 105 may be a cloud server.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be further noted that the method for dynamically adjusting the zone server thread provided by the embodiments of the present disclosure may be executed by a server, may also be executed by a terminal device, and may also be executed by the server and the terminal device in cooperation with each other. Accordingly, each part (for example, each unit, subunit, module, and submodule) included in the device for dynamically adjusting the regional server thread may be all disposed in the server, may be all disposed in the terminal device, and may be disposed in the server and the terminal device, respectively.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. The system architecture may include only the electronic device (e.g., server or terminal device) on which the method of dynamically adjusting the zone server thread is running, when the electronic device on which the method of dynamically adjusting the zone server thread is running does not need to perform data transfer with other electronic devices.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method of dynamically adjusting zone server threads is shown, comprising the steps of:
step 201, determining the running information of the regional server to be adjusted within a preset time period from the current time.
In this embodiment, an execution subject (for example, the server in fig. 1) of the method for dynamically adjusting the regional server thread may determine the operation information of the regional server to be adjusted within a preset time period from the current time.
The time length represented by the preset time period can be specifically set according to the actual situation. For example, the preset time period is characterized by a time length of 30 seconds. The regional Server to be tuned (Region Server) may be any regional Server in the Server cluster. By way of example, the server cluster is an HBase cluster, which is a distributed, column-oriented open-source database. The server of the area to be adjusted is a HRegonServer in the Hbase cluster and is mainly responsible for responding to a user I/O request and reading and writing data into a Hadoop Distributed File System (HDFS). The operation information may be various information representing the information processing capability of the area server to be adjusted, which is exhibited by the area server to be adjusted in the process of executing the operation request issued by the user through the client. For example, the run information includes the number of threads, the load of the server, and the like.
In this embodiment, the execution subject may determine the preset time period from the current time by using a sliding time window. And the time length represented by the sliding time window is the same as the time length represented by the preset time period.
As an example, the execution subject may use, as the operation information of the area server to be adjusted, which is collected within a preset time period from a current time, a start point, a middle point, or an end point of the preset time period.
In some optional implementations of this embodiment, the executing main body may execute the step 201 as follows:
firstly, acquiring operation information of a server in an area to be adjusted based on a preset time interval.
The preset time interval can be specifically set according to actual conditions. For example, the preset time interval is 5 seconds. It is understood that the time length represented by the preset time interval is less than or equal to the time length represented by the preset time period.
Secondly, taking the average value of the running information collected in the preset time period from the current time as the running information of the server in the area to be adjusted in the preset time period.
As an example, the time length represented by the preset time period is 30 seconds, the preset time interval is 5 seconds, and the execution main body may use an average value of the operation information acquired for a plurality of times in the preset time period as the operation information of the area server to be adjusted in the preset time period.
Step 202, determining adjustment information for adjusting the thread of the server in the area to be adjusted according to the running information and the preset limit information.
In this embodiment, the execution main body may determine, according to the operation information and the preset restriction information, adjustment information for adjusting a thread of the server in the area to be adjusted. The preset limiting information represents limiting information set for the operation information of the area server to be adjusted. It is understood that the zone server should operate under the preset restriction information.
In this embodiment, when the value represented by the operation information is lower than the value represented by the preset limit information, the execution main body may determine the adjustment information for expanding the capacity of the thread of the area server to be adjusted, but the value represented by the operation information of the area server to be adjusted after expansion should be still lower than the value represented by the preset limit information; when the value represented by the operation information is not lower than the value represented by the preset limit information, the execution main body may determine adjustment information for performing capacity reduction on the thread of the area server to be adjusted, so that the value represented by the operation information of the area server to be adjusted after capacity reduction is lower than the value represented by the preset limit information.
In some optional implementations of this embodiment, the operation information includes load information and performance information. The load information is used for representing the machine utilization rate of the area server, and the performance information represents the processing time of the area server to the received operation request. The operation request includes various types of requests, and may be, for example, a read request or a write request. It can be understood that, when the processing time of the area server for the received operation request is shorter, the processing performance of the area server is better; the longer the processing time of the area server for the received operation request is, the worse the processing performance of the area server is. That is, the processing time of the received operation request by the zone server is inversely related to the processing performance.
The preset restriction information includes load restriction information and performance restriction information. The load limitation information is limitation information set for the load information of the area server to be adjusted, and the performance limitation information is limitation information set for the performance information of the area server to be adjusted.
The execution main body may execute the step 202 as follows:
first, in response to determining that the machine utilization rate represented by the load information is smaller than the machine utilization rate represented by the load limiting information and that the request processing time represented by the performance information is smaller than the request processing time represented by the performance limiting information, determining adjustment information for expanding the capacity of the thread of the area server to be adjusted.
The utilization rate of the machine represented by the load information of the expanded area server to be adjusted should still be less than the utilization rate of the machine represented by the load limitation information, and the request processing time represented by the performance information should still be less than the request processing time represented by the performance limitation information.
Secondly, in response to determining that the machine utilization rate represented by the load information is not less than the machine utilization rate represented by the load limiting information or that the request processing time represented by the performance information is not less than the request processing time represented by the performance limiting information, determining adjustment information for performing capacity reduction on the thread of the area server to be adjusted.
In some optional implementations of this embodiment, the preset limit information further includes load tolerance information and performance tolerance information. The load tolerance information is used for limiting the difference between the load limiting information and the load information in the area server to be adjusted, and the performance tolerance information is used for limiting the difference between the performance limiting information and the performance information in the area server to be adjusted. It can be understood that, when the difference between the machine utilization rate represented by the load limitation information and the machine utilization rate represented by the load information is greater than the machine utilization rate represented by the load tolerance information, and the difference between the request processing time represented by the performance limitation information and the request processing time represented by the performance information is greater than the request processing time represented by the performance tolerance information, it indicates that the to-be-adjusted area server has the capability of processing more operation requests, and the capacity of the thread of the to-be-adjusted area server can be expanded. Otherwise, it indicates that the area server to be adjusted does not have the capability of processing more operation requests, and the capacity of the thread of the area server to be adjusted is not expanded, so that the thread currently running by the area server to be adjusted processes the received operation request.
Specifically, in response to determining that the machine utilization rate represented by the load information is smaller than the machine utilization rate represented by the load limitation information, the request processing time represented by the performance information is smaller than the request processing time represented by the performance limitation information, the difference between the machine utilization rate represented by the load limitation information and the machine utilization rate represented by the load information is larger than the machine utilization rate represented by the load tolerance information, and the difference between the request processing time represented by the performance limitation information and the request processing time represented by the performance information is larger than the request processing time represented by the performance tolerance information, the adjustment information for performing capacity expansion of a preset step length on the thread of the area server to be adjusted is determined.
It is to be understood that, in this implementation, in response to determining that the machine usage rate represented by the load information is less than the machine usage rate represented by the load limitation information, and the request processing time represented by the performance information is not less than the request processing time represented by the performance limitation information, and the difference between the machine usage rate represented by the load limitation information and the machine usage rate represented by the load information is not greater than the machine usage rate represented by the load tolerance information, or the difference between the request processing time represented by the performance limitation information and the request processing time represented by the performance information is not greater than the request processing time represented by the performance tolerance information, the execution entity does not perform capacity expansion on the thread of the area server to be adjusted, so that the thread currently running by the area server to be adjusted processes the received operation request.
The preset step represents the number of the threads with capacity expansion or capacity reduction in each adjustment process of the threads of the server to be adjusted. Specifically, the preset step length may include a preset capacity expansion step length and a preset capacity reduction step length. The preset capacity expansion step length and the preset capacity reduction step length can be the same or different, and the numerical values represented by the preset capacity expansion step length and the preset capacity reduction step length can be specifically set according to actual conditions. For example, the preset capacity expansion step size and the preset capacity reduction step size are both 5.
And step 203, adjusting the number of threads of the area server to be adjusted according to the adjustment information.
In this embodiment, the execution main body may adjust the number of threads of the server in the area to be adjusted according to the adjustment information.
As an example, when the adjustment information is adjustment information representing capacity expansion of the threads of the area server to be adjusted, the capacity expansion of the number of the threads of the area server to be adjusted is performed; and when the adjustment information is the adjustment information representing the capacity reduction of the threads of the area server to be adjusted, carrying out the capacity reduction on the number of the threads of the area server to be adjusted.
With continued reference to fig. 3, fig. 3 is a schematic diagram 300 of an application scenario of the method for dynamically adjusting a zone server thread according to the present embodiment. In the application scenario of fig. 3, the HBase cluster 301 includes a plurality of zone servers, including zone servers 3011, 3012, and 3013. HBase cluster 301 may receive and process operation requests of various clients. In the process of processing the operation request, each zone server in the HBase cluster 301 dynamically adjusts the processing capability of the zone server according to the operation information of the zone server. Taking the server 3011 as an example, first, the running information of the area server 3011 to be adjusted in a preset time period from the current time is determined. Then, adjustment information for adjusting the thread of the area server 3011 to be adjusted is determined according to the operation information and the preset restriction information. Finally, the number of threads of the area server 3011 to be adjusted is adjusted according to the adjustment information.
In the method provided by the above embodiment of the present disclosure, the operation information of the area server to be adjusted is determined within the preset time period from the current time; determining adjustment information for adjusting the thread of the server in the area to be adjusted according to the operation information and the preset limit information; and adjusting the number of threads of the regional server to be adjusted according to the adjustment information, thereby providing a mechanism for dynamically adjusting the processing capacity of the regional server according to the running information of the regional server and improving the flexibility of adjusting the processing capacity of the regional server.
In some optional implementation manners of this embodiment, the execution main body may further obtain a preset time period, load limitation information, performance limitation information, load tolerance information, performance tolerance information, and a preset step size through a configuration file of the server in the area to be adjusted. The configuration file is a configuration file corresponding to the area server to be adjusted.
In some optional implementations of this embodiment, the executing agent may execute the steps 201 to 203 respectively for various types of operation requests. Specifically, the execution entity executes the following operations for each type of operation request processed by the area server to be adjusted: firstly, determining the running information of the regional server to be adjusted corresponding to the type of operation request within a preset time period from the current time; determining adjustment information for adjusting the thread of the server in the area to be adjusted according to the operation information and the preset limit information; and adjusting the number of threads of the area server to be adjusted for processing the type of operation request according to the adjustment information.
It is understood that, in the present implementation manner, for each type of operation request, a preset time period, load limitation information, performance limitation information, load tolerance information, performance tolerance information, and a preset step corresponding to the type of operation request may be preset. For each type of operation request, the execution main body may adjust the thread processing the type of operation request in an adjustment manner similar to various implementations in the embodiment, so as to individually and flexibly adjust the thread processing various types of operation requests.
With continuing reference to FIG. 4, an exemplary flow 400 of one embodiment of a method for dynamically adjusting zone server threads in accordance with the present application is shown and includes the steps of:
step 401, collecting operation information of the server in the area to be adjusted based on a preset time interval.
Step 402, taking the average value of the operation information collected in the preset time period from the current time as the operation information of the server in the area to be adjusted in the preset time period.
Step 403, in response to determining that the machine utilization rate represented by the load information is less than the machine utilization rate represented by the load limitation information, the request processing time represented by the performance information is less than the request processing time represented by the performance limitation information, the difference between the machine utilization rate represented by the load limitation information and the machine utilization rate represented by the load information is greater than the machine utilization rate represented by the load tolerance information, and the difference between the request processing time represented by the performance limitation information and the request processing time represented by the performance information is greater than the request processing time represented by the performance tolerance information, determining adjustment information for performing capacity expansion of a preset step size on the thread of the area server to be adjusted.
Step 404, in response to determining that the machine utilization represented by the load information is not less than the machine utilization represented by the load limiting information, or that the request processing time represented by the performance information is not less than the request processing time represented by the performance limiting information, determining adjustment information for performing capacity reduction on the thread of the area server to be adjusted.
Step 405, in response to determining that the machine usage rate represented by the load information is less than the machine usage rate represented by the load limitation information, and the request processing time represented by the performance information is not less than the request processing time represented by the performance limitation information, and the difference between the machine usage rate represented by the load limitation information and the machine usage rate represented by the load information is not greater than the machine usage rate represented by the load tolerance information, or the difference between the request processing time represented by the performance limitation information and the request processing time represented by the performance information is not greater than the request processing time represented by the performance tolerance information, expanding the capacity of the thread of the area server to be adjusted, and processing the received operation request by the thread currently running in the area server to be adjusted.
As can be seen from this embodiment, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for dynamically adjusting a thread of a zone server in this embodiment specifically illustrates an adjustment process of a thread of a zone server to be adjusted, so that flexibility and accuracy of adjusting the processing capability of the zone server are further improved.
With continuing reference to fig. 5, as an implementation of the method shown in the above-mentioned figures, the present disclosure provides an embodiment of an apparatus for dynamically adjusting a zone server thread, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be applied to various electronic devices.
As shown in fig. 5, the apparatus for dynamically adjusting a zone server thread includes: the method comprises the following steps: a first determining unit 501 configured to determine operation information of a regional server to be adjusted within a preset time period up to a current time; a second determining unit 502 configured to determine adjustment information for adjusting the thread of the area server to be adjusted according to the operation information and the preset restriction information; an adjusting unit 503 configured to adjust the number of threads of the area server to be adjusted according to the adjustment information.
In some embodiments, the first determining unit 501 is further configured to: acquiring operation information of a server in an area to be adjusted based on a preset time interval; and taking the average value of the operation information collected in the preset time period from the current time as the operation information of the server in the area to be adjusted in the preset time period.
In some embodiments, the operation information includes load information and performance information, and the preset restriction information includes load restriction information and performance restriction information; a second determining unit 502, further configured to: in response to determining that the machine utilization rate represented by the load information is smaller than the machine utilization rate represented by the load limiting information and the request processing time represented by the performance information is smaller than the request processing time represented by the performance limiting information, determining adjustment information for expanding the capacity of the thread of the server in the area to be adjusted; and in response to the fact that the machine utilization rate represented by the load information is not smaller than the machine utilization rate represented by the load limiting information or the request processing time represented by the performance information is not smaller than the request processing time represented by the performance limiting information, determining adjustment information for performing capacity reduction on the thread of the area server to be adjusted.
In some embodiments, the preset limit information further includes load tolerance information and performance tolerance information; a second determining unit 502, further configured to: and in response to determining that the machine utilization rate represented by the load information is smaller than the machine utilization rate represented by the load limitation information, the request processing time represented by the performance information is smaller than the request processing time represented by the performance limitation information, the difference between the machine utilization rate represented by the load limitation information and the machine utilization rate represented by the load information is larger than the machine utilization rate represented by the load tolerance information, and the difference between the request processing time represented by the performance limitation information and the request processing time represented by the performance information is larger than the request processing time represented by the performance tolerance information, determining adjustment information for expanding the thread of the area server to be adjusted by a preset step length.
In some embodiments, the above apparatus further comprises: and an obtaining unit (not shown in the figure) configured to obtain the preset time period, the load limit information, the performance limit information, the load tolerance information, the performance tolerance information, and the preset step size through the configuration file of the server in the area to be adjusted.
In this embodiment, a first determining unit in a device for dynamically adjusting a regional server thread determines the running information of a regional server to be adjusted within a preset time period from the current time; the second determining unit determines adjustment information for adjusting the thread of the server in the area to be adjusted according to the running information and the preset limiting information; the adjusting unit adjusts the number of threads of the regional server to be adjusted according to the adjusting information, so that a mechanism for dynamically adjusting the processing capacity of the regional server according to the running information of the regional server is provided, and the flexibility of adjusting the processing capacity of the regional server is improved.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing devices of embodiments of the present application (e.g., devices 101, 102, 103, 105 shown in FIG. 1). The apparatus shown in fig. 6 is only an example, and should not bring any limitation to the function and use range of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a processor (e.g., CPU, central processing unit) 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the system 600 are also stored. The processor 601, the ROM602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the method of the present application.
It should be noted that the computer readable medium of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the client computer, partly on the client computer, as a stand-alone software package, partly on the client computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the client computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a first determining unit, a second determining unit, and an adjusting unit. The names of these units do not form a limitation on the unit itself in some cases, and for example, the second determination unit may also be described as a "unit that determines adjustment information for adjusting a thread of a to-be-adjusted area server according to the operation information and preset limitation information".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the computer device to: determining the operation information of the server in the area to be adjusted within a preset time period from the current time; determining adjustment information for adjusting the thread of the server in the area to be adjusted according to the operation information and the preset limit information; and adjusting the number of the threads of the area server to be adjusted according to the adjustment information.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A method of dynamically adjusting a zone server thread, comprising:
determining the operation information of the server in the area to be adjusted within a preset time period from the current time;
determining adjustment information for adjusting the thread of the server in the area to be adjusted according to the operation information and preset limit information;
and adjusting the number of the threads of the area server to be adjusted according to the adjustment information.
2. The method of claim 1, wherein the determining operation information of the area server to be adjusted within a preset time period from a current time comprises:
acquiring the operation information of the server in the area to be adjusted based on a preset time interval;
and taking the average value of the operation information collected in a preset time period from the current time as the operation information of the server in the area to be adjusted in the preset time period.
3. The method of claim 1, wherein the operation information includes load information and performance information, and the preset restriction information includes load restriction information and performance restriction information;
the determining, according to the operation information and preset restriction information, adjustment information for adjusting the thread of the area server to be adjusted includes:
in response to determining that the machine utilization rate represented by the load information is smaller than the machine utilization rate represented by the load limiting information and that the request processing time represented by the performance information is smaller than the request processing time represented by the performance limiting information, determining adjustment information for expanding the capacity of the thread of the area server to be adjusted;
and in response to determining that the machine utilization rate represented by the load information is not less than the machine utilization rate represented by the load limiting information or that the request processing time represented by the performance information is not less than the request processing time represented by the performance limiting information, determining adjustment information for performing capacity reduction on the thread of the area server to be adjusted.
4. The method of claim 3, wherein the preset limit information further comprises load tolerance information and performance tolerance information;
the determining, in response to determining that the machine usage rate represented by the load information is smaller than the machine usage rate represented by the load limiting information and that the request processing time represented by the performance information is smaller than the request processing time represented by the performance limiting information, adjustment information for expanding the capacity of the thread of the area server to be adjusted includes:
and in response to determining that the machine utilization rate represented by the load information is smaller than the machine utilization rate represented by the load limitation information, the request processing time represented by the performance information is smaller than the request processing time represented by the performance limitation information, the difference between the machine utilization rate represented by the load limitation information and the machine utilization rate represented by the load information is larger than the machine utilization rate represented by the load tolerance information, and the difference between the request processing time represented by the performance limitation information and the request processing time represented by the performance information is larger than the request processing time represented by the performance tolerance information, determining adjustment information for expanding the thread of the area server to be adjusted by a preset step length.
5. The method of any of claims 1-4, further comprising:
and acquiring the preset time period, the load limiting information, the performance limiting information, the load tolerance information, the performance tolerance information and the preset step length through a configuration file of the server in the area to be adjusted.
6. An apparatus for dynamically adjusting a zone server thread, comprising:
a first determination unit configured to determine operation information of a regional server to be adjusted within a preset time period up to a current time;
a second determining unit configured to determine adjustment information for adjusting the thread of the area server to be adjusted according to the operation information and preset restriction information;
and the adjusting unit is configured to adjust the number of threads of the area server to be adjusted according to the adjusting information.
7. The apparatus of claim 6, wherein the first determining unit is further configured to:
acquiring the operation information of the server in the area to be adjusted based on a preset time interval; and taking the average value of the operation information collected in a preset time period from the current time as the operation information of the server in the area to be adjusted in the preset time period.
8. The apparatus of claim 6, wherein the operation information includes load information and performance information, and the preset restriction information includes load restriction information and performance restriction information;
the second determination unit is further configured to:
in response to determining that the machine utilization rate represented by the load information is smaller than the machine utilization rate represented by the load limiting information and that the request processing time represented by the performance information is smaller than the request processing time represented by the performance limiting information, determining adjustment information for expanding the capacity of the thread of the area server to be adjusted; and in response to determining that the machine utilization rate represented by the load information is not less than the machine utilization rate represented by the load limiting information or that the request processing time represented by the performance information is not less than the request processing time represented by the performance limiting information, determining adjustment information for performing capacity reduction on the thread of the area server to be adjusted.
9. The apparatus of claim 8, wherein the preset limit information further comprises load tolerance information and performance tolerance information;
the second determination unit is further configured to:
and in response to determining that the machine utilization rate represented by the load information is smaller than the machine utilization rate represented by the load limitation information, the request processing time represented by the performance information is smaller than the request processing time represented by the performance limitation information, the difference between the machine utilization rate represented by the load limitation information and the machine utilization rate represented by the load information is larger than the machine utilization rate represented by the load tolerance information, and the difference between the request processing time represented by the performance limitation information and the request processing time represented by the performance information is larger than the request processing time represented by the performance tolerance information, determining adjustment information for expanding the thread of the area server to be adjusted by a preset step length.
10. The apparatus of any of claims 6-9, further comprising:
an obtaining unit, configured to obtain the preset time period, the load limiting information, the performance limiting information, the load tolerance information, the performance tolerance information, and the preset step size through a configuration file of the server in the area to be adjusted.
11. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-5.
12. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
CN202110068684.9A 2021-01-19 2021-01-19 Method and device for dynamically adjusting regional server thread Pending CN114090225A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110068684.9A CN114090225A (en) 2021-01-19 2021-01-19 Method and device for dynamically adjusting regional server thread

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110068684.9A CN114090225A (en) 2021-01-19 2021-01-19 Method and device for dynamically adjusting regional server thread

Publications (1)

Publication Number Publication Date
CN114090225A true CN114090225A (en) 2022-02-25

Family

ID=80295926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110068684.9A Pending CN114090225A (en) 2021-01-19 2021-01-19 Method and device for dynamically adjusting regional server thread

Country Status (1)

Country Link
CN (1) CN114090225A (en)

Similar Documents

Publication Publication Date Title
CN109447635B (en) Information storage method and device for block chain
US11314451B2 (en) Method and apparatus for storing data
CN109388626B (en) Method and apparatus for assigning numbers to services
CN110391938B (en) Method and apparatus for deploying services
CN110019496B (en) Data reading and writing method and system
CN108011949B (en) Method and apparatus for acquiring data
CN113010405A (en) Application program testing method and device
CN110288625B (en) Method and apparatus for processing image
CN112398669A (en) Hadoop deployment method and device
CN112685481B (en) Data processing method and device
CN109413212B (en) Method and apparatus for processing requests
CN111278085A (en) Method and device for acquiring target network
CN112667368A (en) Task data processing method and device
CN113783916B (en) Information synchronization method and device
CN112732979B (en) Information writing method, information writing device, electronic equipment and computer readable medium
CN114090225A (en) Method and device for dynamically adjusting regional server thread
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium
CN112784139A (en) Query method, query device, electronic equipment and computer readable medium
CN112527454A (en) Container group scheduling method and device, electronic equipment and computer readable medium
CN108882229B (en) Information processing method and device
CN111694672A (en) Resource allocation method, task submission method, device, electronic equipment and medium
CN113076175A (en) Memory sharing method and device for virtual machine
CN114647686A (en) Data processing method, device, equipment, medium and product
CN111404824B (en) Method, apparatus, electronic device, and computer-readable medium for forwarding request
CN110858240A (en) Front-end module loading method and device

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