CN110730135B - Method and device for improving performance of server, storage medium and server - Google Patents

Method and device for improving performance of server, storage medium and server Download PDF

Info

Publication number
CN110730135B
CN110730135B CN201910840664.1A CN201910840664A CN110730135B CN 110730135 B CN110730135 B CN 110730135B CN 201910840664 A CN201910840664 A CN 201910840664A CN 110730135 B CN110730135 B CN 110730135B
Authority
CN
China
Prior art keywords
server
sub
web container
restarting
performance index
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.)
Active
Application number
CN201910840664.1A
Other languages
Chinese (zh)
Other versions
CN110730135A (en
Inventor
胡鹏强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201910840664.1A priority Critical patent/CN110730135B/en
Publication of CN110730135A publication Critical patent/CN110730135A/en
Application granted granted Critical
Publication of CN110730135B publication Critical patent/CN110730135B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44552Conflict resolution, i.e. enabling coexistence of conflicting executables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/101Server selection for load balancing based on network conditions

Abstract

The invention provides a method, a device, a storage medium and a server for improving the performance of the server, wherein the method comprises the following steps: acquiring a sub-server list, wherein the sub-server list comprises sub-server information of each sub-server connected with a central server and project deployment information of a web container on the sub-server; monitoring the performance index parameter value of each sub server on the sub server list according to the sub server information; acquiring a timed restart task corresponding to the web container according to the project deployment information of the web container on the sub-server; determining whether the web container on the sub-server triggers restarting or not based on the monitored performance index parameter value or/and the timed restarting task corresponding to the web container; and if the web container on the sub server is determined to trigger restarting, restarting the web container. The invention can improve the performance of the server under the condition of ensuring the project deployment stability on the sub-server.

Description

Method and device for improving performance of server, storage medium and server
Technical Field
The invention relates to the technical field of computer application, in particular to a method, a device, a storage medium and a server for improving the performance of the server.
Background
In existing project development, projects are deployed on servers using Tomcat. Tomcat refers to a web container for deploying developed code engineering to make the engineering an application or system, so that the engineering can be externally provided with services and externally accessed. When an application or system deployed in a server with a web container Tomcat service process is blocked or a front end has more than expected concurrent access, the response of the application or system is often slowed down, the performance of the server is reduced, and the use of a user is affected, and at this time, the performance of the server needs to be improved.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a storage medium, and a server for improving server performance, so as to solve the problem in the prior art that when an application or a system deployed in a server having a web container Tomcat service process is blocked or a front end has more than expected concurrent access, the response of the application or the system is often slowed down, the server performance is degraded, and this may affect the use of a user.
A first aspect of an embodiment of the present invention provides a method for improving server performance, including:
acquiring a sub-server list, wherein the sub-server list comprises sub-server information of each sub-server connected with a central server and project deployment information of a web container on the sub-server;
monitoring the performance index parameter value of each sub server on the sub server list according to the sub server information;
acquiring a timed restart task corresponding to the web container according to the project deployment information of the web container on the sub-server;
determining whether the web container on the sub-server triggers restarting or not based on the monitored performance index parameter value or/and the timed restarting task corresponding to the web container;
and if the web container on the sub server is determined to trigger restarting, restarting the web container.
A second aspect of the embodiments of the present invention provides an apparatus for improving server performance, including:
the server list acquisition unit is used for acquiring a sub-server list, wherein the sub-server list comprises sub-server information of each sub-server connected with the central server and project deployment information of a web container on the sub-server;
the performance index monitoring unit is used for monitoring the performance index parameter value of each sub-server on the sub-server list according to the sub-server information;
the restarting task obtaining unit is used for obtaining a timing restarting task corresponding to the web container according to the project deployment information of the web container on the sub-server;
the restarting triggering judging unit is used for determining whether the web container on the sub-server triggers restarting or not based on the monitored performance index parameter value or/and the timed restarting task corresponding to the web container;
and the container restarting unit is used for restarting the web container if the web container on the sub server is determined to trigger restarting.
A third aspect of the embodiments of the present invention provides a server, including a memory and a processor, where the memory stores a computer program operable on the processor, and the processor executes the computer program to implement the following steps:
acquiring a sub-server list, wherein the sub-server list comprises sub-server information of each sub-server connected with a central server and project deployment information of a web container on the sub-server;
monitoring the performance index parameter value of each sub server on the sub server list according to the sub server information;
acquiring a timed restart task corresponding to the web container according to the project deployment information of the web container on the sub-server;
determining whether the web container on the sub server triggers restarting or not based on the monitored performance index parameter value or/and the timed restarting task corresponding to the web container;
and if the web container on the sub server is determined to trigger restarting, restarting the web container.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of:
acquiring a sub-server list, wherein the sub-server list comprises sub-server information of each sub-server connected with a central server and project deployment information of a web container on the sub-server;
monitoring the performance index parameter value of each sub server on the sub server list according to the sub server information;
acquiring a timed restart task corresponding to a web container according to the project deployment information of the web container on the sub-server;
determining whether the web container on the sub-server triggers restarting or not based on the monitored performance index parameter value or/and the timed restarting task corresponding to the web container;
and if the web container on the sub server is determined to trigger restarting, restarting the web container.
In the embodiment of the invention, by acquiring a sub-server list, the sub-server list comprises sub-server information of each sub-server connected with a central server and project deployment information of a web container on the sub-server, monitoring a performance index parameter value of each sub-server on the sub-server list according to the sub-server information, acquiring a timed restart task corresponding to the web container according to the project deployment information of the web container on the sub-server, and finally determining whether the web container on the sub-server triggers restart or not based on the monitored performance index parameter value or/and the timed restart task corresponding to the web container, if determining that the web container on the sub-server triggers restart, restarting the web container.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the embodiments or the prior art description will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings may be obtained according to these drawings without inventive labor.
Fig. 1 is a flowchart of an implementation of a method for improving server performance according to an embodiment of the present invention;
fig. 2 is a flowchart of a specific implementation of determining to trigger a restart of a web container according to an early warning value of a performance index parameter value or/and a timed restart task according to an embodiment of the present invention;
fig. 3 is a flowchart of a specific implementation of a method A1 for improving server performance according to an embodiment of the present invention;
fig. 4 is a flowchart of a specific implementation of the method S105 for improving server performance according to the embodiment of the present invention;
fig. 5 is a flowchart of a specific implementation of a method B1 for improving server performance according to an embodiment of the present invention;
FIG. 6 is a block diagram of an apparatus for improving server performance according to an embodiment of the present invention;
FIG. 7 is a block diagram of an apparatus for improving server performance according to another embodiment of the present invention;
fig. 8 is a schematic diagram of a server provided in an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 shows an implementation process of a method for improving server performance according to an embodiment of the present invention, where the method includes steps S101 to S105. The specific realization principle of each step is as follows:
s101: and acquiring a sub server list, wherein the sub server list comprises sub server information of each sub server connected with a central server and project deployment information of a web container on the sub server.
Specifically, in the embodiment of the present invention, there are multiple sub servers in the distributed system, each sub server is managed by using a central server connection, and one or more web containers are respectively configured on the sub servers. In this embodiment, the web container employs Tomcat. Tomcat is a Web server program similar to IIS, apache, i.e., a kind of Web container. Tomcat supports jsp dynamic web pages. In this embodiment, when a project is deployed by using Tomcat, a jar package used by an application or a system needs to be placed under a lib directory of Tomcat, and then deployed together on a child server. The sub-server information includes a sub-server identifier and a sub-server address, and further includes a container identifier of the configured web container, a path of the container, and container enabling status information, such as a Tomcat web container identifier, a path of the Tomcat web container, and whether the Tomcat web container is enabled, where the Tomcat web container identifier may be container account information. The project deployment information of the web container includes a project identification and a project type of a project deployed on the web container.
In the embodiment of the present invention, a Tomcat (web container) is configured on the child server for deploying the project. Further, since it is easy to waste resources when only one Tomcat runs on one sub-server, in this embodiment, a plurality of tomcats may be configured on the same sub-server. Specifically, when a plurality of Tomcat are sequentially configured on the same sub-server, except for the first Tomcat, the configuration of the other Tomcat needs to modify the port monitored by the Tomcat, so that the problem that the port occupies the repeated and can not be started is avoided, that is, when a plurality of Tomcat service processes are run on the same sub-server, each Tomcat service process corresponds to a different port.
S102: and monitoring the performance index parameter value of each sub-server on the sub-server list according to the sub-server information.
Specifically, the sub-server information includes a sub-server identifier and a sub-server address, and according to the sub-server identifier and the sub-server address, a performance index parameter value of each sub-server on the sub-server list is obtained, and the performance index parameter value is monitored. In the embodiment of the present invention, the performance index parameter values of the sub-servers include a memory usage rate, a CPU usage rate, an I/O data rate, a network data throughput rate of the sub-servers, and a disk space usage rate of the sub-servers. In this embodiment, if Tomcat is used for the web container, the performance index of the web container operation includes a Tomcat sub-thread number, a Tomcat connection number, and a Tomcat error log number.
S103: and acquiring a timed restart task corresponding to the web container according to the project deployment information of the web container on the sub-server.
Specifically, in the embodiment of the present invention, based on the project deployment information of the web container on the sub-server, the progress information of the project deployed by the web container on the sub-server is monitored, and according to the progress information of the project deployed by the web container on the sub-server and a preset restart task table, a timed restart task corresponding to the web container on the sub-server is determined. The preset restart task table is preset and is preset according to the web container and the schedule information of the deployed project of the web container. Specifically, the progress information includes a progress percentage value, and the restart time is determined according to the progress percentage value of the project deployed by the web container, for example, the restart is performed when the progress information is 50%. And constructing a preset restart task table according to a sub-server identifier, a web container identifier and a progress percentage value of a project deployed by a web container corresponding to the web container identifier, wherein the preset restart task table comprises a mapping relation among the sub-server, the web container identifier and a timed restart task. The timed restart task comprises a specified restart time and restart times. Illustratively, the restart time is specified to be within a morning time, a time period when no one is using the deployment service. Namely, the web container is restarted at regular time through presetting a timed restart task containing restart time. Further, in this embodiment, the preset restart task table is dynamically updated according to a progress percentage value of a project deployed on a web container.
Illustratively, the service of the web container Tomcat is automatically restarted at a specified restart time, a timed restart task is set in windows by using an SCHTASKS command, a timed restart task is set in linux by using a cron, that is, the restart time of each Tomcat in each sub-server is specified, and the restart time of the Tomcat is determined according to the schedule information of items deployed by the Tomcat on the sub-servers and a preset restart task table. When the specified restart time is reached, a web container restart is triggered.
S104: and determining whether the web container on the sub-server triggers restarting or not based on the monitored performance index parameter value or/and the timed restarting task corresponding to the web container.
In the embodiment of the present invention, whether to trigger restarting the web container on the sub-server is determined by monitoring the performance index parameter value of each sub-server and the corresponding timed restart task of the web container on the sub-server.
Specifically, if the performance index parameter value of the sub-server reaches an early warning value or/and the web container triggers a timed restart task, it is determined that the web container on the sub-server triggers a restart.
As an embodiment of the present invention, as shown in fig. 2, if the performance index parameter value of the child server reaches the early warning value or/and the web container triggers the timed restart task, determining that the web container on the child server triggers the restart specifically includes:
a1: and if the performance index parameter value of the sub-server reaches an early warning value, determining that the web container on the sub-server is triggered to restart. Specifically, the performance index parameter value of the sub-server is provided with an early warning value, the early warning value is defined by a user, or big data statistical analysis is performed according to historical abnormal events to determine the early warning value. And if the performance index parameter value of the sub-server reaches an early warning value, determining that the web container on the sub-server is triggered to restart.
A2: and if the web container triggers the timed restart task, determining that the web container on the sub-server triggers the restart. Specifically, if the current schedule information of the project deployed by the web container has a corresponding timed restart task, the web container triggers the timed restart task.
A3: and if the web container triggers the timed restart task and the performance index parameter value of the sub-server reaches an early warning value, determining that the web container on the sub-server triggers the restart. Namely, when the web container triggers the timed restart task, the performance index parameter value of the sub-server also reaches the early warning value, and then the web container is determined to be triggered to restart.
In the embodiment of the invention, if the performance index parameter value of the sub-server does not reach the early warning value and the web container does not trigger the timed restart task, the web container on the sub-server is determined not to trigger the restart.
In the embodiment of the invention, the web container on the sub-server is determined not to trigger restarting only when the performance index parameter value of the sub-server does not reach the early warning value and the web container does not trigger the timed restarting task. Specifically, if the performance index parameter value of the sub-server reaches an early warning value, or the web container triggers a timing task, it is determined that the web container on the sub-server triggers restarting. And if the performance index parameter value of the sub-server does not reach the early warning value, or the web container does not trigger the timing task, the web container on the sub-server is not triggered to restart. In this embodiment, in addition to restarting the web container according to the restart time specified in the preset restart task table, the central server monitors the operating conditions of the sub-servers, and determines whether the monitored performance index parameter values of the sub-servers are abnormal. Illustratively, the monitored performance index parameter values include a memory usage rate a, a CPU usage rate b, an I/O data rate c, a Tomcat sub-thread number d, a Tomcat connection number e, a Tomcat error log number f, a server network data throughput rate g, and a server disk space usage rate h. In this embodiment, when a certain specified performance index parameter value of a monitored sub-server exceeds an early warning value, it is determined that a web container on the sub-server triggers a reboot. For example, if the memory usage of the child server exceeds 70%, or, alternatively, the I/O data rate (referring to the amount of data that reads or writes to a file on the server per second) exceeds 500 (MB), or the Tomcat sub-thread count exceeds 600, or the Tomcat connection count exceeds 400, or the Tomcat error log count exceeds 30, or the server network data throughput exceeds 30 (MB), or the server disk space usage exceeds 90%, it is determined that the web container on the child server triggers reboot.
Further, in this embodiment of the present invention, if the web container triggers the timed restart task, before restarting the web container, the last restart time of the web container is obtained, where the last restart time of the web container is the time when the performance index parameter value of the sub-server reaches the early warning value, and triggers the restart of the web container. And if the time difference value between the last restarting time and the current time is within the preset time threshold range, closing the timed restarting task triggered by the web container, and avoiding that the deployment efficiency of the project on the web container is not high due to frequent restarting.
Optionally, in the embodiment of the present invention, more than one performance index of the monitored sub-server is provided, that is, a plurality of performance index parameter values are provided, and fig. 3 shows a specific implementation flow of step A1 of the method for improving the performance of the server provided by the embodiment of the present invention, which is detailed as follows:
a11: and acquiring the weight corresponding to each monitored performance index parameter value according to a preset parameter value weight table, wherein the preset parameter value weight table comprises the mapping relation among the performance indexes, the performance index parameter value intervals and the weights. Specifically, parameter value intervals to which the performance index parameter values belong are determined, and the weights corresponding to the performance index parameter values are determined according to the mapping relation between the performance index parameter value intervals and the weights in the preset parameter value weight table. In this embodiment, the weights corresponding to the performance index parameter values of the same performance index in different parameter value intervals may also be different.
A12: and calculating the weighted sum of the performance index parameter values of the sub-servers according to the monitored performance index parameter values of the sub-servers and the weights thereof. Specifically, the weighted sum is calculated according to the following formula:
Figure GDA0003897682760000091
where Σ Fx denotes the weighted sum, x i Representing the value of the i-th performance indicator parameter, delta i Is an adjustment coefficient, lambda, corresponding to the ith individual performance index parameter value i Representing the weight corresponding to the ith individual performance index parameter value, wherein I is the performance of the sub-serverThe number of index parameter values.
A13: and if the weighted sum of the performance index parameter values of the sub-servers exceeds a preset weighted sum upper limit value, triggering the restart of the web container on the sub-server.
In the embodiment of the invention, the weights of the performance index parameter values of each performance index in different parameter value intervals are respectively set, the weighted sum of the performance index parameter values is calculated according to the weights, and whether the weighted sum exceeds the set weighted sum upper limit value is monitored. And if the current time exceeds the preset time, triggering restart. For example, a represents memory usage, b represents CPU usage, c represents I/O data rate, d represents tomcat sub-thread number, e represents tomcat connection number, f represents tomcat error log number, g represents server network data throughput, h represents server disk space usage, weighted sum is calculated as follows:
∑Fx=a*100*30+b*100*40+c*100*25+d*20+e*30+f*10+g*15+h*100*15。
s105: and if the web container on the sub server is determined to trigger restarting, restarting the web container.
Specifically, in the embodiment of the present invention, if it is determined that the web container on the sub server triggers the restart, the service process of the web container is closed, the start script command of the web container is re-executed, the configuration file of the web container is reloaded, and the restart of the web container is implemented.
Optionally, in this embodiment of the present invention, the method for improving service performance further includes performing a space cleaning operation at regular time. Specifically, an execution script file is configured in each sub-server, and when the execution script file is executed, redundant files (such as logs, temporary files, expired files, and the like) in a specified path can be automatically cleaned.
Optionally, in this embodiment of the present invention, an execution result is returned after the execution of the restart of the web container is completed, and a fail flag and execution error information are returned to the central server when the execution fails, for example. And the central server records all the execution conditions in a daily log file. And inspecting the execution condition of the current day through a record list in the log file. Further, the record list is scanned and read periodically, and if the record list has records which fail to be restarted, the restart of the web container is triggered again in a specified alternative time interval.
As an embodiment of the present invention, the web container is provided with an upper limit value of the restart concurrency number, as shown in fig. 4, the step S105 further includes:
b1: and if the number of the web containers triggering the restart exceeds the restart concurrency number upper limit value, determining the priority of the web containers triggering the restart.
B2: and restarting the web containers in sequence from high to low according to the priority of the web containers.
In the embodiment of the invention, when the number of the web containers triggering the restart exceeds the restart concurrency number, the web containers are restarted from top to bottom in sequence according to the priority of the web containers. The priority of the web container can be preset, and the priority of the web container can also be determined according to the monitored performance index parameter value of the sub-server where the web container is located. The priority of the web container is positively correlated with the performance index parameter value of the sub-server.
Optionally, the project deployment information includes a project association relationship, as shown in fig. 5, a specific implementation flow of the step B1 is as follows:
b11: and if the quantity of the web containers triggering the restart exceeds the upper limit value of the restart concurrency quantity, determining the quantity of the projects related to the projects deployed by the web containers according to the project association relationship.
B12: and acquiring the weight of each monitored performance index of the sub-server according to a preset index weight table.
B13: and determining the priority of the web container of the sub-server according to the parameter value of each performance index of the sub-server, the weight of each performance index and the quantity of items associated with the items deployed by the web container of the sub-server.
In the embodiment of the present invention, the priority of the web container is not only positively correlated with the performance index parameter value of the sub-server, but also correlated with the project deployed by the web container. If the item deployed by the Tomcat web container on a certain sub-server has an association relationship with the items deployed by other Tomcat web containers, acquiring the quantity of the items associated with the items deployed by the Tomcat web container, and determining the priority of the Tomcat web container according to the parameter values and the weights of the performance index of the sub-servers and the quantity of the associated items. The incidence relation comprises at least one of a dependency relation and a depended relation. Specifically, the priority value of the web container of the child server is calculated according to the following formula (2):
Figure GDA0003897682760000111
wherein the Priority l A priority value representing a web container with a container identification l, said values i Representing the ith individual performance index parameter value on the monitored sub-server, wherein the total number of the monitored performance indexes on the sub-server is I, I is a positive integer, and omega i Representing the weight, n, corresponding to the ith performance indicator l Item number associated with item k representing a deployment of a web container with the container identifier l, e representing the number of web container connections, ε k And representing a preset key value of the item k, wherein the preset key value is used for identifying the importance degree of the item k. In this embodiment, the higher the priority value, the higher the priority. And finally, determining the priority of the web container of the sub-server according to the priority value and a preset priority comparison table.
In the embodiment of the invention, the priority value of the web container on the sub-server is calculated through the formula (2), the priority of the web container of the sub-server is determined according to the priority value and a preset priority comparison table, the web containers of the sub-server are sorted from high to low according to the priority, the web containers which do not exceed the upper limit value of the restart concurrency number are selected in sequence for restarting, and the restart conflict is avoided.
In the embodiment of the invention, a sub-server list is obtained, wherein the sub-server list comprises sub-server information of each sub-server connected with a central server and project deployment information of a web container on the sub-server, performance index parameter values of each sub-server on the sub-server list are monitored according to the sub-server information, a timed restart task corresponding to the web container is obtained according to the project deployment information of the web container on the sub-server, and finally whether the web container on the sub-server triggers restart is determined based on the monitored performance index parameter values or/and the timed restart task corresponding to the web container.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 6 shows a block diagram of a device for improving server performance according to an embodiment of the present application, which corresponds to the method described in the foregoing embodiment, and only shows portions related to the embodiment of the present application for convenience of description.
Referring to fig. 6, the apparatus for improving server performance includes: a server list obtaining unit 61, a performance index monitoring unit 62, a restart task obtaining unit 63, a restart trigger determining unit 64, and a container restarting unit 65, wherein:
a server list obtaining unit 61, configured to obtain a sub-server list, where the sub-server list includes sub-server information of each sub-server connected to a central server and project deployment information of a web container on the sub-server;
a performance index monitoring unit 62, configured to monitor a performance index parameter value of each sub-server on the sub-server list according to the sub-server information;
a restart task obtaining unit 63, configured to obtain a timed restart task corresponding to the web container according to the project deployment information of the web container on the sub server;
a restart trigger determining unit 64, configured to determine, based on the monitored performance index parameter value and/or a timed restart task corresponding to the web container, whether the web container on the sub-server triggers a restart;
and the container restarting unit 65 is configured to restart the web container on the child server if it is determined that the web container triggers restarting.
Optionally, the restart trigger determining unit 64 includes:
the restarting judging module is used for determining that the web container on the sub-server is triggered to restart if the performance index parameter value of the sub-server reaches an early warning value or/and the web container triggers a timed restarting task; specifically, if the performance index parameter value of the sub-server reaches an early warning value, determining that a web container on the sub-server triggers restarting; if the web container triggers the timed restart task, determining that the web container on the sub-server triggers the restart; and if the web container triggers the timed restart task and the performance index parameter value of the sub-server reaches an early warning value, determining that the web container on the sub-server triggers the restart. Optionally, more than one performance index of the sub-server is provided, and the restart determining module specifically includes:
the index weight obtaining submodule is used for obtaining the weight corresponding to each monitored performance index parameter value according to a preset parameter value weight table, and the preset parameter value weight table comprises mapping relations among the performance indexes, the performance index parameter value intervals and the weights;
the weighting calculation submodule is used for calculating the weighted sum of the performance index parameter values of the sub-servers according to the monitored performance index parameter values of the sub-servers and the weights of the performance index parameter values;
and the restarting determination submodule is used for triggering restarting of the web container on the sub-server if the weighted sum of the performance index parameter values of the sub-server exceeds a preset weighted sum upper limit value.
Optionally, as shown in fig. 7, the apparatus for improving server performance further includes:
a priority determining unit 71, configured to determine a priority of the web container triggering restart if it is determined that the number of the web containers triggering restart exceeds a restart concurrency number upper limit value;
and the sequencing restarting unit 72 is used for restarting the web containers in sequence from high to low according to the priority of the web containers.
Optionally, the item deployment information includes an item association relationship, and the priority determining unit 71 includes:
the association information determining module is used for determining the project quantity associated with the projects deployed by the web containers according to the project association relationship if the quantity of the web containers triggering the restart exceeds the restart concurrency quantity upper limit value;
the weight determining module is used for acquiring the weight of each monitored performance index of the sub-server according to a preset parameter value weight table;
and the priority determining module is used for determining the priority of the web container of the sub-server according to the parameter value of each performance index of the sub-server, the weight of each performance index and the quantity of items related to the items deployed by the web container of the sub-server.
Optionally, the priority determining module specifically includes:
the priority value operator module is used for calculating the priority value of the web container of the sub server according to the following formula:
Figure GDA0003897682760000141
wherein the Priority l A priority value representing a web container with a container identification l, said values i Representing the ith individual performance index parameter value on the monitored sub-server, wherein the total number of the monitored performance indexes on the sub-server is I, I is a positive integer, and omega i Represents the weight corresponding to the ith performance index, n l Item number associated with item k representing a deployment of a web container with the container identification l, e representing the number of web container connections, ε k And representing a preset key value of the item k, wherein the preset key value is used for identifying the importance degree of the item k.
And the priority determining submodule is used for determining the priority of the web container of the sub-server according to the priority value and a preset priority comparison table.
In the embodiment of the invention, by acquiring a sub-server list, the sub-server list comprises sub-server information of each sub-server connected with a central server and project deployment information of a web container on the sub-server, monitoring a performance index parameter value of each sub-server on the sub-server list according to the sub-server information, acquiring a timed restart task corresponding to the web container according to the project deployment information of the web container on the sub-server, and finally determining whether the web container on the sub-server triggers restart or not based on the monitored performance index parameter value or/and the timed restart task corresponding to the web container, if determining that the web container on the sub-server triggers restart, restarting the web container.
Fig. 8 is a schematic diagram of a server according to an embodiment of the present invention. As shown in fig. 8, the server 8 of this embodiment includes: a processor 80, a memory 81 and a computer program 82 stored in said memory 81 and operable on said processor 80, such as a program to improve the performance of a server. The processor 80, when executing the computer program 82, implements the steps in the above-described embodiments of the method for improving server performance, such as the steps 101 to 105 shown in fig. 1. Alternatively, the processor 80, when executing the computer program 82, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the units 61 to 65 shown in fig. 6.
Illustratively, the computer program 82 may be partitioned into one or more modules/units that are stored in the memory 81 and executed by the processor 80 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 82 in the server 8.
The server 8 may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The server may include, but is not limited to, a processor 80, a memory 81. Those skilled in the art will appreciate that fig. 8 is merely an example of a server 8, and does not constitute a limitation of server 8, and may include more or fewer components than shown, or some components in combination, or different components, e.g., the server may also include input output devices, network access devices, buses, etc.
The Processor 80 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 81 may be an internal storage unit of the server 8, such as a hard disk or a memory of the server 8. The memory 81 may also be an external storage device of the server 8, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) and the like provided on the server 8. Further, the memory 81 may also include both an internal storage unit of the server 8 and an external storage device. The memory 81 is used for storing the computer program and other programs and data required by the server. The memory 81 may also be used to temporarily store data that has been output or is to be output.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A method for improving server performance, comprising:
acquiring a sub-server list, wherein the sub-server list comprises sub-server information of each sub-server connected with a central server and project deployment information of a web container on the sub-server, and the sub-server information comprises sub-server identification and sub-server addresses;
acquiring performance index parameter values of all sub servers on the sub server list according to the sub server identifications and the sub server addresses, and monitoring the performance index parameter values;
monitoring the progress information of the project deployed by the web container on the sub-server based on the project deployment information of the web container on the sub-server, and determining a timed restart task corresponding to the web container on the sub-server according to the progress information of the project deployed by the web container on the sub-server and a preset restart task table;
determining whether the web container on the sub-server triggers restarting or not based on the monitored performance index parameter value or/and the timed restarting task corresponding to the web container;
and if the web container on the sub server is determined to trigger restarting, restarting the web container.
2. The method of claim 1, wherein the determining whether the web container on the sub-server triggers a restart based on the monitored performance index parameter value or/and a timed restart task corresponding to the web container comprises:
and if the performance index parameter value of the sub-server reaches an early warning value or/and the web container triggers a timed restart task, determining that the web container on the sub-server triggers restart.
3. The method of claim 2, wherein the performance index of the sub-server is more than one, and the determining that the web container on the sub-server triggers the reboot if the performance index parameter value of the sub-server reaches an early warning value comprises:
acquiring weights corresponding to each monitored performance index parameter value according to a preset parameter value weight table, wherein the preset parameter value weight table comprises mapping relations among the performance indexes, performance index parameter value intervals and the weights;
calculating the weighted sum of the performance index parameter values of the sub-servers according to the monitored performance index parameter values of the sub-servers and the weights of the performance index parameter values;
and if the weighted sum of the performance index parameter values of the sub-servers exceeds a preset weighted sum upper limit value, triggering the restart of the web container on the sub-server.
4. The method of claim 1, wherein restarting the web container on the child server if it is determined that the web container triggers restarting comprises:
if the number of the web containers triggering restarting exceeds the restarting concurrency number upper limit value, determining the priority of the web containers triggering restarting;
restarting the web containers in sequence from high to low according to the priority of the web containers.
5. The method of claim 4, wherein the project deployment information includes a project association relationship, and the determining the priority of the restart-triggered web container if it is determined that the number of restart-triggered web containers exceeds a restart concurrency number upper limit value includes:
if the quantity of the web containers triggering restarting exceeds the restarting concurrency quantity upper limit value, determining the project quantity related to the projects deployed by the web containers according to the project association relation;
acquiring the weight of each monitored performance index of the sub-server according to a preset index weight table;
and determining the priority of the web container of the sub-server according to the parameter value of each performance index of the sub-server, the weight of each performance index and the quantity of items associated with the items deployed by the web container of the sub-server.
6. The method of claim 5, wherein the determining the priority of the web container of the child server according to the parameter value of each performance index of the child server, the weight of each performance index, and the number of items associated with the items deployed by the web container of the child server comprises:
calculating a priority value of the web container of the child server according to the following formula:
Figure FDA0003897682750000021
wherein the Priority l A priority value representing a web container with a container identification l, said values i Representing the ith individual performance index parameter value on the monitored sub-server, wherein the total number of the monitored performance indexes on the sub-server is I, I is a positive integer, and omega i Representing the weight, n, corresponding to the ith performance indicator l Item number associated with item k representing a deployment of a web container with the container identification l, e representing the number of web container connections, ε k A preset key value representing the item k;
and determining the priority of the web container of the sub-server according to the priority value and a preset priority comparison table.
7. An apparatus for improving server performance, the apparatus comprising:
the server list acquiring unit is used for acquiring a sub-server list, wherein the sub-server list comprises sub-server information of each sub-server connected with a central server and project deployment information of a web container on the sub-server, and the sub-server information comprises sub-server identification and sub-server addresses;
a performance index monitoring unit, configured to obtain performance index parameter values of each sub-server on the sub-server list according to the sub-server identifier and the sub-server address, and monitor the performance index parameter values;
the restarting task obtaining unit is used for monitoring the progress information of the project deployed by the web container on the sub-server based on the project deployment information of the web container on the sub-server, and determining the timing restarting task corresponding to the web container on the sub-server according to the progress information of the project deployed by the web container on the sub-server and a preset restarting task table;
the restarting triggering judging unit is used for determining whether the web container on the sub-server triggers restarting or not based on the monitored performance index parameter value or/and the timed restarting task corresponding to the web container;
and the container restarting unit is used for restarting the web container if the fact that the web container on the sub server triggers restarting is determined.
8. The apparatus for improving server performance according to claim 7, wherein the restart trigger determining unit comprises:
and the restarting judging module is used for determining that the web container on the sub-server triggers restarting if the performance index parameter value of the sub-server reaches an early warning value or/and the web container triggers a timed restarting task.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method for improving server performance according to any one of claims 1 to 6.
10. A server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method for improving the performance of a server according to any one of claims 1 to 6 when executing the computer program.
CN201910840664.1A 2019-09-06 2019-09-06 Method and device for improving performance of server, storage medium and server Active CN110730135B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910840664.1A CN110730135B (en) 2019-09-06 2019-09-06 Method and device for improving performance of server, storage medium and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910840664.1A CN110730135B (en) 2019-09-06 2019-09-06 Method and device for improving performance of server, storage medium and server

Publications (2)

Publication Number Publication Date
CN110730135A CN110730135A (en) 2020-01-24
CN110730135B true CN110730135B (en) 2022-12-09

Family

ID=69217861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910840664.1A Active CN110730135B (en) 2019-09-06 2019-09-06 Method and device for improving performance of server, storage medium and server

Country Status (1)

Country Link
CN (1) CN110730135B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117573425A (en) * 2023-06-06 2024-02-20 扬州万方科技股份有限公司 Container self-recovery method and system based on k8s cluster self-adaptive time hopping

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005059793A1 (en) * 2003-12-01 2005-06-30 Hyungmin Kim Electronic settlement system and method using serial number including identification of software, contents or electronic information, and computer-readable recording medium for recording program for performing the method
WO2017181830A1 (en) * 2016-04-19 2017-10-26 中兴通讯股份有限公司 Synchronous capacity enlargement method and device for server, and storage medium
CN108632375A (en) * 2018-05-09 2018-10-09 四川华创世纪科技有限公司 A kind of online upgrading method for distributed deployment service software program

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399100A (en) * 2017-02-06 2018-08-14 中国移动通信集团公司 A kind of method of adjustment and device of container resource
CN108170517A (en) * 2018-01-08 2018-06-15 武汉斗鱼网络科技有限公司 A kind of container allocation method, apparatus, server and medium
CN109408210B (en) * 2018-09-27 2021-01-05 北京车和家信息技术有限公司 Distributed timed task management method and system
CN109408230B (en) * 2018-10-10 2021-07-20 中国科学院计算技术研究所 Docker container deployment method and system based on energy consumption optimization

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005059793A1 (en) * 2003-12-01 2005-06-30 Hyungmin Kim Electronic settlement system and method using serial number including identification of software, contents or electronic information, and computer-readable recording medium for recording program for performing the method
WO2017181830A1 (en) * 2016-04-19 2017-10-26 中兴通讯股份有限公司 Synchronous capacity enlargement method and device for server, and storage medium
CN108632375A (en) * 2018-05-09 2018-10-09 四川华创世纪科技有限公司 A kind of online upgrading method for distributed deployment service software program

Also Published As

Publication number Publication date
CN110730135A (en) 2020-01-24

Similar Documents

Publication Publication Date Title
CN108459962B (en) Code normalization detection method and device, terminal equipment and storage medium
CN112346829B (en) Method and equipment for task scheduling
US20180062909A1 (en) Log monitoring system
CN109271359B (en) Log information processing method and device, electronic equipment and readable storage medium
CN111381970B (en) Cluster task resource allocation method and device, computer device and storage medium
US10915534B2 (en) Extreme value computation
CN111045881A (en) Slow disk detection method and system
CN111858482A (en) Attack event tracing and tracing method, system, terminal and storage medium
CN110554938B (en) BIOS (basic input output System) testing method, system, terminal and storage medium based on script set
CN113360270B (en) Data cleaning task processing method and device
CN109542462B (en) System environment deployment method, storage medium and server
CN111651595A (en) Abnormal log processing method and device
CN111742309A (en) Automated database query load assessment and adaptive processing
CN110730135B (en) Method and device for improving performance of server, storage medium and server
EP4122163A1 (en) Causality determination of upgrade regressions via comparisons of telemetry data
CN110532187B (en) HDFS throughput performance testing method, system, terminal and storage medium
CN113704577A (en) Data query method and device based on multithreading concurrent processing
Feitelson et al. Experience with the parallel workloads archive
CN107168643B (en) Data storage method and device
CN108255704B (en) Abnormal response method of script calling event and terminal thereof
WO2019062087A1 (en) Attendance check data testing method, terminal and device, and computer readable storage medium
CN116028201A (en) Service system capacity prediction method and device
CN110728838B (en) Meter reading method and device and power acquisition terminal
US20170010935A1 (en) Dumping resources
CN111124854A (en) Method, system, terminal and storage medium for distributing smoking test cases

Legal Events

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