CN111831504A - Monitoring method, monitoring apparatus, computer device, and medium - Google Patents

Monitoring method, monitoring apparatus, computer device, and medium Download PDF

Info

Publication number
CN111831504A
CN111831504A CN201910301559.0A CN201910301559A CN111831504A CN 111831504 A CN111831504 A CN 111831504A CN 201910301559 A CN201910301559 A CN 201910301559A CN 111831504 A CN111831504 A CN 111831504A
Authority
CN
China
Prior art keywords
server
service
degradation
request
module
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
CN201910301559.0A
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 Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke 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 Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201910301559.0A priority Critical patent/CN111831504A/en
Publication of CN111831504A publication Critical patent/CN111831504A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Computer And Data Communications (AREA)

Abstract

The present disclosure provides a monitoring method, comprising: counting the error rate of sending a service request to a server within a first preset time through a fuse; modifying a state of the fuse to open when the error rate exceeds a predetermined threshold; sending a hierarchical degradation request to the server, so that the server allocates a degradation identifier to one or more businesses in the server in response to the hierarchical degradation request; modifying the state of the fuse to be connected, and sending a service request to the server through the fuse, so that the server accesses a secondary server corresponding to the service without the degradation identifier and returns response data; and receiving the response data.

Description

Monitoring method, monitoring apparatus, computer device, and medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a monitoring method, a monitoring apparatus, a computer device, and a medium.
Background
In the prior art, for a situation that any client or server in a micro-service architecture is used as a requester, when a requested server is disconnected due to insufficient performance, the fuse of the requester is restarted and then a service request is sent to the server again in the prior art, and the requested server still performs operation according to the full service therein at this time, and the fuse is disconnected again due to insufficient performance, so that the disconnection-reconnection-disconnection-reconnection cycle is involved.
Disclosure of Invention
In view of the foregoing, the present disclosure provides an improved monitoring method, monitoring apparatus, computer device and medium.
One aspect of the present disclosure provides a monitoring method, including: counting the error rate of sending a service request to a server within a first preset time through a fuse; modifying a state of the fuse to open when the error rate exceeds a predetermined threshold; sending a hierarchical degradation request to the server, so that the server allocates a degradation identifier to one or more businesses in the server in response to the hierarchical degradation request; modifying the state of the fuse to be connected, and sending a service request to the server through the fuse, so that the server accesses a secondary server corresponding to the service without the degradation identifier and returns response data; and receiving the response data.
According to an embodiment of the present disclosure, the method further includes: and when the state of the fuse is modified to be disconnected, acquiring first preset response content according to a first failure rollback rule.
According to an embodiment of the present disclosure, the method further includes: before the hierarchical degradation request is sent to the server, a distributed lock is obtained from a shared storage space, and in a second preset time after one client or the server obtains the distributed lock from the shared storage space, other clients or the server cannot obtain the distributed lock from the shared storage space.
According to an embodiment of the present disclosure, the method further includes: and when the service of the server is attached with the degradation identifier, acquiring second preset response content according to a second failure rollback rule.
According to an embodiment of the present disclosure, the method further includes: before the state of the fuse is modified to be connected, sending a probe request to the server, and when an acknowledgement response to the probe request from the server is received, modifying the state of the fuse to be connected.
Another aspect of the present disclosure provides a monitoring method, including: responding to a layered degradation request sent by a client, and distributing degradation identification to one or more businesses in the server; responding to a service request sent by the client, and accessing a secondary server corresponding to the service without the degradation identifier to acquire corresponding service data; and returning the service data to the client.
According to an embodiment of the present disclosure, the allocating degradation identifiers to one or more services in the server includes: sequencing the services contained in the server according to the service priority; and allocating the degradation identifier to the service with the lowest priority and without the degradation identifier attached currently.
Another aspect of the present disclosure provides a monitoring apparatus, including: the device comprises a statistic module, a disconnection module, a degradation request module, a connection module and a receiving module. The counting module is used for counting the error rate of the service request sent to the service terminal in the first preset time before the fuse. The disconnection module is used for modifying the state of the fuse to be disconnected when the error rate exceeds a preset threshold value. The degradation request module is used for sending a layered degradation request to the server, so that the server responds to the layered degradation request and allocates a degradation identifier to one or more services in the server. And the communication module is used for modifying the state of the fuse into communication, and sending a service request to the server through the fuse, so that the server accesses a secondary server corresponding to the service without the degradation identifier and returns response data. And the receiving module is used for receiving the response data.
Another aspect of the present disclosure provides a monitoring apparatus, including: the system comprises a degradation processing module, an access module and a return module. And the degradation processing module is used for responding to a layered degradation request sent by the client and allocating a degradation identifier to one or more services in the server. And the access module is used for responding to the service request sent by the client and accessing the secondary server corresponding to the service without the degradation identifier to acquire corresponding service data. And the return module is used for returning the service data to the client.
Another aspect of the present disclosure provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method as described above when executing the program.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method as described above when executed.
Another aspect of the disclosure provides a computer program comprising computer executable instructions for implementing the method as described above when executed.
According to the embodiment of the disclosure, in the case that the fuse is disconnected due to insufficient performance of the requested server, the scheme hierarchically reduces the service function of the server through hierarchical degradation operation, so that the performance of the server can support the rest of services without falling into the disconnection-reconnection-disconnection-reconnection cycle in the prior art.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an exemplary system architecture to which the monitoring methods and apparatus may be applied, according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a monitoring method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a flow chart of a monitoring method according to another embodiment of the present disclosure;
FIG. 4A schematically illustrates an architecture diagram of a monitoring method according to an embodiment of the disclosure;
FIG. 4B schematically illustrates a flow diagram for a client initiating a tiered destage request according to an embodiment of the disclosure;
FIG. 4C is a flow diagram that schematically illustrates a hierarchical destaging operation by a server, in accordance with an embodiment of the present disclosure;
FIG. 5 schematically illustrates a block diagram of a monitoring device according to an embodiment of the disclosure;
FIG. 6 schematically illustrates a block diagram of a monitoring device according to another embodiment of the present disclosure;
FIG. 7 schematically illustrates a block diagram of a monitoring device according to another embodiment of the present disclosure;
FIG. 8 schematically illustrates a block diagram of a monitoring device according to another embodiment of the present disclosure; and
FIG. 9 schematically shows a block diagram of a computer device according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The embodiment of the disclosure provides a monitoring method and a device capable of applying the method. The method can be applied to any client or any server in the micro-service architecture, and comprises an error monitoring phase, a disconnection phase, a degradation request phase and a recovery phase. In the error monitoring stage, the error rate of service requests sent to the server within first preset time is counted through the fuse, and when the error rate exceeds a preset threshold value, the disconnection stage is started, and the state of the fuse is modified to be disconnected. In the stage of the degradation request, a hierarchical degradation request is sent to a server, so that the server responds to the hierarchical degradation request to allocate a degradation identifier to one or more businesses in the server. And then in a recovery stage, sending a service request to the server through the fuse, and receiving response data which is accessed by the server and returned by a secondary server corresponding to the service without the degradation identifier.
Fig. 1 schematically illustrates an exemplary system architecture 100 to which the monitoring methods and apparatus may be applied, according to an embodiment of the disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, and 103, a network 104, primary servers 104 and 105, and secondary servers 106 to 111, where different secondary servers may provide data related to different services.
The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the servers 104, 105.
Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few. The primary server 104 may communicate with the secondary servers 106, 107, 108 via various wired or wireless communication links, and the primary server 105 may communicate with the secondary servers 109, 110, 111 via various wired or wireless communication links.
The terminal devices 101, 102, 103 may be various electronic devices including, but not limited to, a smart phone, a personal computer, a tablet computer, a smart watch, etc., without limitation.
Client applications (hereinafter referred to as "clients") having various functions may be installed in the terminal apparatuses 101, 102, 103. The functional support of any client in the terminal devices 101, 102, 103 may be decomposed into discrete multi-layer servers, for example, the client a needs to obtain the service data 1-6 when executing the function, and the client a may communicate with the primary servers 104, 105 through the network 104. The primary server 104 can access the secondary servers 106, 107 and 108 respectively to obtain corresponding service data 1-3, and then return the service data to the client a. The primary server 105 can access the secondary servers 109, 110, and 111 respectively to obtain corresponding service data 4-6, and then return the service data to the client a.
The architecture formed by the one or more clients and the multi-level servers can be called a micro-service architecture, and aims to divide a large-scale service into a plurality of supporting micro-services, perform distributed management and have high fault tolerance. The monitoring method and the monitoring device according to the embodiment of the disclosure can be used for monitoring the operation conditions of all levels of service terminals in the micro-service architecture so as to ensure the normal operation of the micro-service architecture.
It should be understood that the terminal devices, the network, the number of primary and secondary servers, and the number of levels of servers in fig. 1 are merely illustrative. Any number may be provided according to practical requirements.
Fig. 2 schematically shows a flowchart of a monitoring method according to an embodiment of the present disclosure, which may be applied to a client or a server in a micro-service architecture.
As shown in fig. 2, the method includes counting, by a fuse, an error rate of service requests transmitted to a service terminal within a first predetermined time in operation S201.
When the method shown in fig. 2 is applied to a client in the micro service architecture, the server in operation S201 refers to any server that can directly communicate with the client, and when the method shown in fig. 2 is applied to a server a in the micro service architecture, the server in operation S201 refers to any secondary server B that can directly communicate with the server a and is depended on by the server a, and the server a may be a first-level server that directly communicates with the client, or may be another-level server, which is not limited herein. The condition that errors occur when the service request is sent to the service end within the first preset time refers to the condition that high delay or request failure occurs. Fuses are tools that provide service isolation, fusing, degradation mechanisms in a service architecture for maintaining high availability of the microservice architecture.
In operation S202, when the error rate exceeds a predetermined threshold, the state of the fuse is modified to open.
In this operation, when the error rate of sending the service request to the server S exceeds a predetermined threshold, it indicates that the server S has a fault, and if the service request is continuously sent to the server S, a large amount of blocking may be generated, so that the resource of the server S is exhausted, and therefore, the state of the fuse needs to be temporarily modified to be disconnected. When a service request is sent, the state of the fuse is checked first, and when the state of the fuse is disconnected, the service request is not sent to the server S any more.
In operation S203, a hierarchical degradation request is sent to the server, so that the server assigns a degradation identifier to one or more services in the server in response to the hierarchical degradation request.
The operation sends a hierarchical degradation request to the server S after the state of the fuse is modified to be disconnected. One or more services are included in the server S, and different services may depend on different secondary servers of the server S. The hierarchical degradation request is used for informing the server S to hierarchically allocate the degradation identifier to one or more services according to a certain rule.
In operation S204, the state of the fuse is modified to be connected, and a service request is sent to the server through the fuse, so that the server accesses a secondary server corresponding to a service without a degradation identifier and returns response data.
The operation is that after the degradation identifier is distributed by the server S, the fuse is restored to a connected state, when a service request is sent, the state of the fuse is checked firstly, and when the state of the fuse is connected, the service request is sent to the server S. At this time, the server S only performs the function corresponding to the service without the degradation flag, that is, layered degradation of the server S is achieved rather than overall degradation.
In operation S205, the response data is received.
It can be seen that, the method shown in fig. 2 is described from the perspective of taking any client or server in the micro-service architecture as a requester, and when a fuse is disconnected due to insufficient performance of a requested server, the prior art restarts the requested server after the fuse is disconnected and then resends a service request to the server, and the requested server still performs operation according to its internal full service at this time, and the fuse is disconnected again due to insufficient performance soon. The scheme reduces the service function of the service end hierarchically after the fuse is disconnected, so that the performance of the service end can support the rest services, and the service end does not fall into the disconnection-reconnection-disconnection-reconnection cycle in the prior art.
Further, in order to ensure that the service request can also be responded when the fuse is opened, in an embodiment of the present disclosure, the monitoring method according to an embodiment of the present disclosure further includes: and when the state of the fuse is modified to be disconnected, acquiring first preset response content according to a first failure rollback rule. For example, for a client, when a service request is sent, the state of a fuse in the client is checked, and if the state of the fuse is disconnected, the client acquires a preset template as response content to display.
In an embodiment of the present disclosure, the monitoring method according to an embodiment of the present disclosure further includes: before sending a hierarchical degradation request to the server, acquiring a distributed lock from a shared storage space, wherein within a second preset time after one client or server acquires the distributed lock from the shared storage space, other clients or servers cannot acquire the distributed lock from the shared storage space. The shared storage space can be shared by each client and server in the micro-service architecture, and any client or server in the micro-service architecture can access the shared storage space to obtain the distributed lock from the shared storage space.
For example, for a client, after determining that the server S has failed, the state of the fuse is modified to open. And then, acquiring a distributed lock from the shared storage space request, wherein if the distributed lock is acquired, the client can perform the hierarchical degradation request if the distributed lock indicates that no other client or server performs the hierarchical degradation request within the current second preset time, and if the distributed lock is not acquired, the distributed lock indicates that other clients or servers perform the hierarchical degradation request within the current second preset time and the distributed lock needs to be acquired after the hierarchical degradation requests of other clients or servers are finished.
In the embodiment, only one client or server in the micro-service architecture is limited to perform the hierarchical degradation request in a period of time through the distributed lock, so that the situation that all services are degraded due to the fact that one server simultaneously responds to a plurality of hierarchical degradation requests is avoided.
Further, in some specific cases, if all services in a requested service end are degraded, in order to ensure that the service request can be responded when the fuse is opened, in an embodiment of the present disclosure, the monitoring method according to an embodiment of the present disclosure further includes: and when the service of the server is attached with the degradation identifier, acquiring second preset response content according to a second failure rollback rule.
This embodiment is equivalent to setting a bottom-of-pocket policy (michelsaneous services), and when the server cannot respond to the service request of the requester, the server may also respond with second preset response content set locally in the requester.
In an embodiment of the present disclosure, the monitoring method according to an embodiment of the present disclosure further includes: before the state of the fuse is modified to be connected, a probe request is sent to the server side, and when an acknowledgement response to the probe request from the server side is received, the state of the fuse is modified to be connected. For example, for a client, after determining that the server S has a fault, the state of the fuse is modified to be open, and a hierarchical degradation request is sent to the server S. After the sending of the hierarchical downgrading request is finished, in order to determine whether the server S has completed the hierarchical downgrading operation, in a case that the state of the fuse is kept to be disconnected, a probe request is sent to the server S, and specifically, the probe request may be one service request with a smaller number, for example, 3 service requests are sent to the server S. If the responses respectively made by the server S to the 3 service requests are received and no delay exists, the confirmation response of the server S to the probe request is received, and the state of the fuse is modified to be connected.
Fig. 3 schematically shows a flowchart of a monitoring method according to another embodiment of the present disclosure, which may be applied to any server in the micro service architecture.
As shown in fig. 3, the method includes, in operation S301, assigning a downgrade identifier to one or more services in the local server in response to a hierarchical downgrade request sent by a client.
When the method shown in fig. 3 is applied to a first-level server in the micro-service architecture, the first-level server receives a hierarchical degradation request sent by a client, and when the method shown in fig. 3 is applied to other second-level servers in the micro-service architecture, the second-level server receives a hierarchical degradation request sent by a previous-level server. Based on the same processing logic, fig. 3 illustrates the present server as a first-class server. The service end comprises one or more services, and different services can depend on different secondary service ends of the service end. After receiving the hierarchical degradation request, the service terminal hierarchically allocates the degradation identifier to one or more services according to a certain rule.
In operation S302, in response to a service request sent by the client, a secondary server corresponding to a service to which no degradation identifier is attached is accessed to obtain corresponding service data.
In operation S303, the service data is returned to the client.
It can be seen that the method shown in fig. 3 is described from the perspective that any one server in the micro-service architecture is used as a requested party, and corresponds to the method shown in fig. 2, and the two interact to form a complete monitoring process. The scheme is suitable for the scene of fuse disconnection caused by insufficient performance of the server, replaces overall degradation with layered degradation, reduces the load of the server on the premise of ensuring normal work of main services, and maintains high availability of a micro-service architecture.
In an embodiment of the present disclosure, the allocating degradation identifiers to one or more services in the local server includes: and sequencing the services contained in the service end according to the service priority, and distributing degradation identifiers to the services with the lowest priority and without the degradation identifiers at present. The service end distributes degradation identification for the service according to the service priority, so that the service with low priority is degraded first, and the service of the main process is not affected.
A monitoring method according to an embodiment of the present disclosure is described below with reference to fig. 4A to 4C in conjunction with specific embodiments.
Fig. 4A schematically shows an architecture diagram of a monitoring method according to an embodiment of the disclosure.
As shown in fig. 4A, in this example, the client A, B is used as a requesting party, the server S is used as a requested party, and the Redis database is used as a shared storage space. According to the scheme, a Hystrix (Netflix open source fault-tolerant framework) fuse is used for providing a relevant function of calling a failure rollback rule (fallback) after disconnection and a function of a distributed lock in a Redis database, and on the basis, fine layered degradation under a distributed environment of a micro-service framework is achieved. The client A, B may include a Hystrix fuse module and a hierarchical downgrade request module, and the server S may include a server hierarchical downgrade module and a server downgrade configuration module (not shown).
The Hystrix fuse module is used for sending a service request sent by the client A, B to the server S when the state of the fuse is connected, modifying the state of the fuse into disconnection when the error rate of the service request exceeds a preset threshold value, and requesting to return first preset response content according to a first failure rollback rule. And after a period of time, putting a small part of the traffic monitoring server S into the network to monitor whether the server S is available, if the server S is available, modifying the state of the fuse to be connected, and otherwise, keeping the state of the fuse to be disconnected. The hierarchical destaging request module is mainly used for initiating hierarchical destaging requests and ensuring that the hierarchical destaging requests are not repeatedly initiated within a certain time by utilizing distributed locks in the Redis database. The server-side hierarchical degradation module is mainly used for monitoring a hierarchical degradation request sent by the client A, B and hierarchically degrading the inside of the server S according to the local degradation configuration. The service terminal degradation configuration module is used for dividing the service and the flow of the service terminal, dividing the main flow and the non-main flow into layers, configuring the priority, initializing local degradation configuration when the service terminal is started, and judging whether to enter the corresponding service module or not by the subsequent service terminal based on the degradation mark in the configuration when the service request is responded.
Fig. 4B schematically illustrates a flow diagram of a client initiating a hierarchical destage request according to an embodiment of the disclosure.
Since the logic of client a and client B initiating the hierarchical destage request is the same, client a is taken as an example for explanation. As shown in fig. 4B, the client a sends a service request to the server S, and when it is counted that the error rate of the service request in the first predetermined time exceeds a predetermined threshold, the state of the fuse in the client a is modified to be disconnected, a first failure rollback rule is entered, and based on the first failure rollback rule, on one hand, first preset response content is returned to the client a, and on the other hand, a hierarchical degradation request module is triggered. The degradation request module tries to acquire a distributed lock (Redis distributed hierarchical degradation lock) in a Redis database through asynchronous call and sets timeout time, if the acquisition of the distributed lock is successful, a hierarchical degradation request is initiated to a server S, and if the acquisition of the distributed lock is failed, the hierarchical degradation request is not sent. And after the distributed lock is released due to expiration, if the state of the fuse is still disconnected, triggering the degradation request module again to initiate a hierarchical degradation request according to the process.
Fig. 4C schematically shows a flowchart of a hierarchical downgrading operation performed by a server according to an embodiment of the present disclosure.
As shown in fig. 4C, after receiving the hierarchical destaging request, the server S obtains a local destaging configuration, where the current destaging level is recorded in the local destaging configuration: the service end S comprises a service a, a service b and a service c, wherein the service a corresponds to the priority 1 and is not degraded currently, the service b corresponds to the priority 2 and is not degraded currently, and the service c corresponds to the priority 3 and is degraded currently. The priorities 1-3 represent the priorities from high to low. At this time, firstly, whether all services in the server S are degraded is judged based on the local degradation configuration, if yes, a second failure rollback rule may be entered, a second preset response content may be returned to the client based on the second failure rollback rule, if not, a degradation identifier may be allocated to the currently undegraded service, and the allocation principle is as follows: and allocating a degradation identifier to the service with the lowest priority level which is not degraded currently. In this example, if the service with the lowest priority that is not currently lowered in the server S is the service b, the degradation identifier is assigned to the service b, and the local degradation configuration is updated.
After the fuse of the client is reconnected, the service end S does not go to the service and the process marked as degraded after receiving the service request. In this example, the service data of the service a is provided by the secondary service S1 of the service S, the service data of the service b is provided by the secondary service S2 of the service S, and the service data of the service c is provided by the secondary service S3 of the service S. After receiving the service request, the server S no longer accesses the servers S2 and S3, and only accesses the server S1 to obtain the service data of the service a and returns the service data to the client. After the server S is restarted, all the degradation identifiers are cleared, and the service is distributed with the degradation identifiers according to the priority based on the hierarchical degradation request sent by the client.
According to the scheme, when the server fails, the service in the server is hierarchically degraded, so that part of non-main flow functions of the server are closed, the performance of the server is improved to a certain extent, higher concurrent service requests can be supported without frequent fusing, and the overall stability and usability of the micro-service architecture are improved. And in the layered degradation process, the function or flow of the service end is gradually closed according to the priority level, so that the main flow function of the service section is reserved to the maximum extent, and the availability of the service function is ensured.
Fig. 5 schematically illustrates a block diagram of a monitoring device 500 configured in any client or any server of the microservice architecture, according to an embodiment of the present disclosure.
As shown in fig. 5, the monitoring apparatus 500 includes: a statistics module 510, a disconnection module 520, a degradation request module 530, a connectivity module 540, and a reception module 550.
The counting module 510 is configured to count an error rate of sending the service request to the server within a first predetermined time before the fuse.
The disconnection module 520 is configured to modify a state of the fuse to open when the error rate exceeds a predetermined threshold.
The downgrade request module 530 is configured to send a hierarchical downgrade request to the server, so that the server assigns a downgrade identifier to one or more services in the server in response to the hierarchical downgrade request.
The communication module 540 is configured to modify the state of the fuse into a communication state, and send a service request to the server through the fuse, so that the server accesses a secondary server corresponding to a service without a degradation identifier and returns response data.
And a receiving module 550 is configured to receive the response data.
Fig. 6 schematically shows a block diagram of a monitoring device 600 configured in any client or any server of the microservice architecture according to another embodiment of the present disclosure.
As shown in fig. 6, the monitoring apparatus 600 includes: a statistics module 610, a disconnection module 620, a degradation request module 630, a connectivity module 640, and a reception module 650. The statistics module 610, the disconnection module 620, the degradation request module 630, the connection module 640, and the receiving module 650 respectively have the same functions as the statistics module 510, the disconnection module 520, the degradation request module 530, the connection module 540, and the receiving module 550, and repeated parts are not described again.
In an embodiment of the present disclosure, the monitoring apparatus 600 further includes a first rollback module 660, configured to obtain preset response content according to the first failure rollback rule when the disconnection module 620 modifies the state of the fuse to disconnection.
In an embodiment of the present disclosure, the monitoring apparatus 600 further includes a locking module 670, configured to acquire a distributed lock from the shared storage space before the degradation request module 630 sends the hierarchical degradation request to the server, and within a second predetermined time after one client or server acquires the distributed lock from the shared storage space, other clients or servers cannot acquire the distributed lock from the shared storage space.
In an embodiment of the present disclosure, the monitoring apparatus 600 further includes a second rollback module 680, configured to obtain preset response content according to a second failed rollback rule when all the services of the server are accompanied by downgrade identifiers.
In one embodiment of the present disclosure, the monitoring apparatus 600 further includes a probe module 690, configured to send a probe request to the server before the connectivity module 640 modifies the state of the fuse to connectivity, and notify the connectivity module 640 to modify the state of the fuse to connectivity when receiving an acknowledgement response from the server for the probe request.
Fig. 7 schematically shows a block diagram of a monitoring device 700 configured in any of the servers of the microservice architecture, according to another embodiment of the present disclosure.
As shown in fig. 7, the monitoring apparatus 700 includes: a destage handling module 710, an access module 720, and a return module 730.
The degradation processing module 710 is configured to, in response to a hierarchical degradation request sent by a client, assign a degradation identifier to one or more services in the local server.
The access module 720 is configured to, in response to the service request sent by the client, access the secondary server corresponding to the service without the degradation identifier to obtain corresponding service data.
And the returning module 730 is configured to return the service data to the client.
Fig. 8 schematically illustrates a block diagram of a monitoring device 800 configured in any of the servers of the microservice architecture, according to another embodiment of the present disclosure.
As shown in fig. 8, the monitoring apparatus 800 includes: a destage handling module 810, an access module 820, and a return module 830. The degradation processing module 810, the access module 820, and the return module 830 respectively have the same functions as the degradation processing module 710, the access module 720, and the return module 730, and repeated parts are not described herein again.
In one embodiment of the present disclosure, the destage handling module 810 includes an ordering submodule 811 and a marking submodule 812.
The sorting submodule 811 is configured to sort the services included in the server according to the service priorities. And, the marking submodule 812 is configured to assign a downgrade identifier to the traffic with the lowest priority and not currently accompanied by a downgrade identifier.
It should be noted that the implementation, solved technical problems, implemented functions, and achieved technical effects of each module/unit/subunit and the like in the apparatus part embodiment are respectively the same as or similar to the implementation, solved technical problems, implemented functions, and achieved technical effects of each corresponding step in the method part embodiment, and are not described herein again.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any number of the statistics module 610, the disconnection module 620, the destage request module 630, the connectivity module 640, the reception module 650, the first rollback module 660, the locking module 670, the second rollback module 680, and the heuristics module 690 may be combined in one module for implementation, or any one of the modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the disclosure, at least one of the statistics module 610, the disconnection module 620, the downgrade request module 630, the connectivity module 640, the reception module 650, the first fallback module 660, the locking module 670, the second fallback module 680, and the heuristics module 690 may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of three implementations of software, hardware, and firmware, or in a suitable combination of any of them. Alternatively, at least one of the statistics module 610, the disconnection module 620, the destage request module 630, the connectivity module 640, the reception module 650, the first rollback module 660, the locking module 670, the second rollback module 680, and the heuristics module 690 may be implemented, at least in part, as a computer program module that, when executed, may perform a corresponding function.
Also for example, any of the destage processing module 810, the access module 820, and the return module 830 may be combined in one module for implementation, or any one of them may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the disclosure, at least one of the degradation handling module 810, the access module 820, and the return module 830 may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, at least one of the destage handling module 810, the access module 820, and the return module 830 may be implemented at least in part as a computer program module that, when executed, may perform corresponding functions.
Fig. 9 schematically shows a block diagram of a computer device adapted to implement the above described method according to an embodiment of the present disclosure. The computer device shown in fig. 9 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present disclosure.
As shown in fig. 9, a computer apparatus 900 according to an embodiment of the present disclosure includes a processor 901 which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. Processor 901 may comprise, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 901 may also include on-board memory for caching purposes. The processor 901 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 903, various programs and data necessary for the operation of the apparatus 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. The processor 901 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 902 and/or the RAM 903. Note that the programs may also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, device 900 may also include an input/output (I/O) interface 905, input/output (I/O) interface 905 also connected to bus 904. Device 900 may also include one or more of the following components connected to I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure 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 storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The computer program, when executed by the processor 901, performs the above-described functions defined in the system of the embodiment of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: 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), 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 disclosure, 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. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 902 and/or the RAM 903 described above and/or one or more memories other than the ROM 902 and the RAM 903.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. 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 or flowchart illustration, and combinations of blocks in the block diagrams 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.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (11)

1. A method of monitoring, comprising:
counting the error rate of sending a service request to a server within a first preset time through a fuse;
modifying a state of the fuse to open when the error rate exceeds a predetermined threshold;
sending a hierarchical degradation request to the server, so that the server allocates a degradation identifier to one or more businesses in the server in response to the hierarchical degradation request;
modifying the state of the fuse to be connected, and sending a service request to the server through the fuse, so that the server accesses a secondary server corresponding to the service without the degradation identifier and returns response data; and
the response data is received.
2. The method of claim 1, further comprising: and when the state of the fuse is modified to be disconnected, acquiring first preset response content according to a first failure rollback rule.
3. The method of claim 1, further comprising, prior to said sending a tiered destage request to the server:
and acquiring the distributed lock from the shared storage space, wherein in a second preset time after one client or server acquires the distributed lock from the shared storage space, other clients or servers cannot acquire the distributed lock from the shared storage space.
4. The method of claim 1, further comprising:
and when the service of the server is attached with the degradation identifier, acquiring second preset response content according to a second failure rollback rule.
5. The method of claim 1, further comprising, prior to said modifying the state of the fuse to pass:
and sending a probe request to the server, and modifying the state of the fuse to be connected when receiving a confirmation response aiming at the probe request from the server.
6. A method of monitoring, comprising:
responding to a layered degradation request sent by a client, and distributing degradation identification to one or more businesses in the server;
responding to a service request sent by the client, and accessing a secondary server corresponding to the service without the degradation identifier to acquire corresponding service data; and
and returning the service data to the client.
7. The method of claim 6, wherein the assigning of the degradation indicator to the one or more services in the local server comprises:
sequencing the services contained in the server according to the service priority; and
and allocating the degradation identifier to the service with the lowest priority and without the degradation identifier currently attached.
8. A monitoring device, comprising:
the counting module is used for counting the error rate of sending the service request to the server within the first preset time before the fuse;
a disconnection module for modifying a state of the fuse to open when the error rate exceeds a predetermined threshold;
a degradation request module, configured to send a hierarchical degradation request to the server, so that the server assigns a degradation identifier to one or more services in the server in response to the hierarchical degradation request;
the communication module is used for modifying the state of the fuse into communication, sending a service request to the server through the fuse, enabling the server to access a secondary server corresponding to the service without the degradation identifier and returning response data; and
and the receiving module is used for receiving the response data.
9. A monitoring device, comprising:
the system comprises a degradation processing module, a service module and a data processing module, wherein the degradation processing module is used for responding to a layered degradation request sent by a client and allocating a degradation identifier to one or more services in the service terminal;
the access module is used for responding to a service request sent by the client and accessing a secondary server corresponding to the service without the degradation identifier to acquire corresponding service data; and
and the return module is used for returning the service data to the client.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor when executing the program implementing:
a method of monitoring as claimed in any one of claims 1 to 7.
11. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform:
a method of monitoring as claimed in any one of claims 1 to 7.
CN201910301559.0A 2019-04-15 2019-04-15 Monitoring method, monitoring apparatus, computer device, and medium Pending CN111831504A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910301559.0A CN111831504A (en) 2019-04-15 2019-04-15 Monitoring method, monitoring apparatus, computer device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910301559.0A CN111831504A (en) 2019-04-15 2019-04-15 Monitoring method, monitoring apparatus, computer device, and medium

Publications (1)

Publication Number Publication Date
CN111831504A true CN111831504A (en) 2020-10-27

Family

ID=72914542

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910301559.0A Pending CN111831504A (en) 2019-04-15 2019-04-15 Monitoring method, monitoring apparatus, computer device, and medium

Country Status (1)

Country Link
CN (1) CN111831504A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112449017A (en) * 2020-11-25 2021-03-05 深圳市欢太科技有限公司 Server and control method thereof
CN112527544A (en) * 2020-11-23 2021-03-19 聚好看科技股份有限公司 Server, and method and device for triggering fusing
CN112965848A (en) * 2021-03-05 2021-06-15 北京百度网讯科技有限公司 Fusing degradation method, device, equipment and medium for micro service

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201722A (en) * 2016-07-12 2016-12-07 乐视控股(北京)有限公司 The load regulation method of server and system
CN106776099A (en) * 2017-01-11 2017-05-31 北京皮尔布莱尼软件有限公司 One kind service fusing shielding system and method
US20180146033A1 (en) * 2016-11-23 2018-05-24 Level 3 Communications, Llc Overload handling in a content delivery network (cdn)
CN108427581A (en) * 2018-02-07 2018-08-21 平安普惠企业管理有限公司 System micro services method and terminal device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201722A (en) * 2016-07-12 2016-12-07 乐视控股(北京)有限公司 The load regulation method of server and system
US20180146033A1 (en) * 2016-11-23 2018-05-24 Level 3 Communications, Llc Overload handling in a content delivery network (cdn)
CN106776099A (en) * 2017-01-11 2017-05-31 北京皮尔布莱尼软件有限公司 One kind service fusing shielding system and method
CN108427581A (en) * 2018-02-07 2018-08-21 平安普惠企业管理有限公司 System micro services method and terminal device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527544A (en) * 2020-11-23 2021-03-19 聚好看科技股份有限公司 Server, and method and device for triggering fusing
CN112527544B (en) * 2020-11-23 2022-04-29 聚好看科技股份有限公司 Server, and method and device for triggering fusing
CN112449017A (en) * 2020-11-25 2021-03-05 深圳市欢太科技有限公司 Server and control method thereof
CN112449017B (en) * 2020-11-25 2023-08-18 深圳市欢太科技有限公司 Service end and control method thereof
CN112965848A (en) * 2021-03-05 2021-06-15 北京百度网讯科技有限公司 Fusing degradation method, device, equipment and medium for micro service

Similar Documents

Publication Publication Date Title
CN110612705B (en) Method for service deployment under server-free architecture and function management platform
US10503555B2 (en) Selecting type and quantity of application masters that need to be started in advance
CN106817432B (en) Method, system and equipment for elastically stretching virtual resources in cloud computing environment
CN111831504A (en) Monitoring method, monitoring apparatus, computer device, and medium
CN107729176B (en) Disaster recovery method and disaster recovery system for configuration file management system
CN106802939B (en) Method and system for solving data conflict
CN103037011B (en) Based on the magnanimity terminal equipment connecting system of IOCP
CN111722933A (en) Deadlock resolution between distributed processes
US7574439B2 (en) Managing a nested request
CN114185558A (en) Native application master selection method and device based on K8s and storage medium
CN109257396B (en) Distributed lock scheduling method and device
CN116185623A (en) Task allocation method and device, electronic equipment and storage medium
CN111163140A (en) Method, apparatus and computer readable storage medium for resource acquisition and allocation
US20190387050A1 (en) Methods for providing unified control and management of tasks in a multi-platform environment and devices thereof
US9672073B2 (en) Non-periodic check-pointing for fine granular retry of work in a distributed computing environment
CN114385370A (en) Memory allocation method, system, device and medium
US9547590B2 (en) Managing memory
CN112631756A (en) Distributed regulation and control method and device applied to space flight measurement and control software
US9697048B2 (en) Non-uniform memory access (NUMA) database management system
CN110609707B (en) Online data processing system generation method, device and equipment
JP2022552150A (en) Data structures, memory means and devices
CN109257201B (en) License sending method and device
US9184996B2 (en) Thin client system, management server, client environment management method and program
JP6595419B2 (en) API providing apparatus and API request control method
CN113055199A (en) Gateway access method and device and gateway equipment

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