CN111049670B - Method and device for fusing isolation of micro-service - Google Patents

Method and device for fusing isolation of micro-service Download PDF

Info

Publication number
CN111049670B
CN111049670B CN201911082761.5A CN201911082761A CN111049670B CN 111049670 B CN111049670 B CN 111049670B CN 201911082761 A CN201911082761 A CN 201911082761A CN 111049670 B CN111049670 B CN 111049670B
Authority
CN
China
Prior art keywords
fuse
service
open state
server
state
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
CN201911082761.5A
Other languages
Chinese (zh)
Other versions
CN111049670A (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.)
Jiangsu Suning Cloud Computing Co ltd
SuningCom Co ltd
Original Assignee
Suning Cloud Computing 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 Suning Cloud Computing Co Ltd filed Critical Suning Cloud Computing Co Ltd
Priority to CN201911082761.5A priority Critical patent/CN111049670B/en
Publication of CN111049670A publication Critical patent/CN111049670A/en
Application granted granted Critical
Publication of CN111049670B publication Critical patent/CN111049670B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/0836Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability to enhance reliability, e.g. reduce downtime
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Hardware Redundancy (AREA)

Abstract

The embodiment of the invention discloses a method and a device for fusing isolation of micro-services, relates to the technical field of cloud computing, and can reduce the influence of non-core services on core services. The invention comprises the following steps: after a business interface is called, an independent thread pool is distributed, wherein the business interface corresponds to a business service; acquiring a fuse corresponding to the service interface, and configuring the acquired fuse to a server of the independent thread pool; when a server with fusing measurement reaching a threshold value is detected, switching a fuse of the server with the fusing measurement reaching the threshold value to a fully-open state, and taking the server with the fuse in the fully-open state off line; and detecting whether the server where the fuse switched to the half-open state is located is normal, if so, switching the half-open state to the closed state, and enabling the server where the fuse in the closed state is located to be on line. The invention is suitable for the risk resistance of the micro-service system.

Description

Method and device for fusing isolation of micro-service
Technical Field
The invention relates to the technical field of cloud computing, in particular to a method and a device for fusing isolation of micro-services.
Background
The basic principle of fuses generally applied on a server is as follows: the protected function call is wrapped in a breaker object, which monitors for faults. Once the fault reaches a certain threshold, the fuse trips and all further calls to the breaker return with errors. Wherein, the fuse tripping means: when the number of the faults that the service invoker calls the service of the service provider reaches a set threshold value within a certain period of time, the service fusing degradation is carried out, so that a locally set degradation strategy is executed between the service invokers, and the remote invocation is not initiated any more.
The current fuse scheme mainly performs fusing based on service dimensionality, and plays a good anti-risk role in large-scale online business systems such as various e-commerce platforms and ticket purchasing platforms. However, if a service is deployed on multiple servers (at present, such a service is often referred to as a "micro service"), each server has a local part of the service, and when the local server fails and reaches a fusing threshold, the service is fused as a whole; it is also possible that a local server fails without reaching the fusing threshold, resulting in a sustained failure of the service. In a large internet e-commerce company with a huge user base, due to real-time processing of requests sent by massive clients, once the micro-service fails, an avalanche effect can be easily caused, and millions of users are affected, so that great economic loss is caused.
Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for fuse isolation of a microservice, which can reduce the influence of a non-core service on a core service.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention provides a method, including:
after a business interface is called, an independent thread pool is distributed, wherein the business interface corresponds to a business service;
acquiring a fuse corresponding to the service interface, and configuring the acquired fuse to a server of the independent thread pool;
when a server with fusing measurement reaching a threshold value is detected, switching a fuse of the server with the fusing measurement reaching the threshold value to a fully-open state, and taking the server with the fuse in the fully-open state off line;
and detecting whether the server where the fuse switched to the half-open state is located is normal, if so, switching the half-open state to the closed state, and enabling the server where the fuse in the closed state is located to be on line.
In a second aspect, an embodiment of the present invention provides an apparatus, including:
the thread management module is used for allocating an independent thread pool after calling a service interface, and the service interface corresponds to a service;
the configuration module is used for acquiring the fuses corresponding to the service interfaces and configuring the acquired fuses to the servers of the independent thread pool;
the fuse state management module is used for switching the fuse of the server with the fusing metric reaching the threshold value to a fully open state and disconnecting the server with the fuse in the fully open state when the server with the fusing metric reaching the threshold value is detected; and detecting whether the server where the fuse switched to the semi-open state is located is normal, if so, switching from the semi-open state to the closed state, and putting the server where the fuse in the closed state is located on line.
In the embodiment, the fusing degradation is carried out based on the server dimension by adopting the service, the dependence on a fusing mechanism is increased by a service scheduling load balancing strategy, and the server is subjected to dynamic offline, pre-online and online faults, so that the problem that the global fusing degradation is caused by local faults or the local faults are continuously influenced by the local faults due to the fact that the fusing degradation is carried out based on the service overall fault rate in the prior art is solved. The core service of the server side adopts an independent thread pool, achieves thread isolation with other services, avoids the influence of other services on the core service, and solves the problem that the influence of other services on the core service is caused by the adoption of a public thread pool by the server side in the prior art.
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 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 it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a system architecture according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a method provided by an embodiment of the present invention;
fig. 3, 4 and 5 are schematic diagrams of specific examples provided by the embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the present invention is further described in detail with reference to the accompanying drawings and the detailed description below. Reference will now be made in detail to the embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention. As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or coupled. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items. It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The method flow in this embodiment may be specifically executed in a system as shown in fig. 1, where the method flow includes: a server cluster and a client. The server may be a blade, a workstation, a super computer, or other devices, and a server cluster system for data processing is formed by a plurality of servers. In practical applications, the server may be connected to a business system, such as SCM (Supply Chain Management).
An embodiment of the present invention provides a method for fuse isolation of a microservice, as shown in fig. 2, including:
and S101, after calling a service interface, allocating an independent thread pool.
In this embodiment, the server allocates an independent thread pool for the core service, where a core service mark is added to the service contract in advance; and the configuration of an independent thread pool is added on the micro service management platform; and a service executor of the server determines whether to rebuild the thread pool according to whether the configuration of the latest independent thread pool changes, the specific thread pool is created in a lazy mode, and the thread pool is created or rebuilt when the service is called, so that the independent thread pool is prevented from occupying thread resources too much.
In practical applications, a service interface may be understood as a technical-level expression, and a service may be understood as a service-level expression, for example, a lower-order interface is also called a lower-order service. And thus can be understood as a traffic interface corresponding to a traffic service.
S102, acquiring the fuse corresponding to the service interface, and configuring the acquired fuse to the server of the independent thread pool.
The thread pool occupied by each service interface can be deployed on a plurality of servers, and each server of the thread pool occupied by each service interface corresponds to one fuse. The fuses may be run at the consuming side, that is, when the consuming side calls a service interface, the fuses of each server in the thread pool occupied by the service interface are instantiated first.
In this embodiment, the client may also be referred to as a consumer side, i.e., a device side that runs and uses the fuse. The consumption end and the service end correspond to each other, namely, one service end provides services for a plurality of consumption ends, and the fuses are instantiated on the consumption ends. In the service layer, the consumption end calls the service, and the service end provides the service. On the hardware level, the consumption end and the service end are both provided with corresponding server equipment, and the system program is realized on the server equipment. The consumption end calls the business service, and the consumption end can also provide the business service as the service end of other consumption ends, so the concepts of the consumption end and the service end are opposite.
The fuse factory is a program written by JAVA language, has a component with a fusing function and is used for instantiating (commonly called as producing) fuses.
The fuse state component is a state component of the fuse for representing the state of the respective fuse in real time. The fusing measurement component is used for recording the calling condition of the business service, such as: how many times a hundred calls failed. The "component" described in this embodiment is specifically a program written in JAVA language.
The fuse container (ConcurrentMap) is used for storing fuses, and the fuses produced by a fuse factory are stored in the fuse container and can be reused.
S103, when the server with the fusing metric reaching the threshold value is detected, the fuse of the server with the fusing metric reaching the threshold value is switched to a fully-open state, and the server with the fuse in the fully-open state is offline.
And S104, detecting whether the server where the fuse switched into the half-open state is located is normal, if so, switching the half-open state into the closed state, and enabling the server where the fuse in the closed state is located to be on line.
Specifically, the method for performing fusing degradation pairs at the client based on the server dimension where the service is located includes: the fuse state includes: closed, half-opened and full-opened. The fuse initialization state is closed. As shown in FIG. 3, when a server in which the service is located fails, the fuse state of the failed server in which the service is located programs the fully open state, and the fuse measure reaches a threshold value. At the same time, the request for accessing the service is not distributed to the server, the fuse is switched from a fully open state to a half open state over a period of time, the half open state is intended to detect whether the server is normal, and if so, the fuse state is switched to a closed state. If abnormal, the fuse state transitions to a fully open state. In the embodiment, the three states of closing, half opening and full opening of the fuse are mutually converted, the server with the problem is fused and disconnected, and then detection is carried out periodically, so that the fault server which is automatically on-line and recovered is achieved.
In this embodiment, after the service interface of the service is called, allocating an independent thread pool includes:
and after the service interface of the service is called, confirming the core service according to whether the core service mark exists in the micro service corresponding to the service interface. And allocating an independent thread pool for the core service.
The micro service without the core service mark is a secondary service, the access amount of the secondary service is larger than that of the core service, and the secondary service thread pool is isolated from the independent thread pool. For example: the order placing is core service, the order inquiring and order solarizing service is secondary service, the access amount of the secondary service is far larger than that of the core service, the core service and the secondary service are isolated through a thread pool, and the abnormal times of the core service are reduced as much as possible. Specifically, the isolation of the secondary service thread pool from the independent thread pool refers to: the secondary service thread pool and the independent thread pool respectively contain respective thread resources, the thread resources contained in the secondary service thread pool and the independent thread pool are not overlapped, and the use of the secondary service thread pool does not involve the thread resources in the independent thread pool.
In this embodiment, the obtaining fuses corresponding to the service interfaces and corresponding the obtained fuses to the servers of the independent thread pool respectively includes:
and reading the fusing configuration information after the service interface is called. And creating fuses according to the configuration information, distributing the created fuses to the servers of the independent thread pool, and loading the fuse state components of the servers. And then, the client loads the fusing measurement component and records the execution result of the fuse state component. In this embodiment, the client may adopt BitSet. And when the service interface is off-line, cleaning the corresponding fuse.
As shown in fig. 4, the fuses described in this embodiment need to utilize the fuse factory, the blowing configuration deployed in the SCM, the fuse state components, the blowing metrics components throughout the creation-run-delete process. Specifically, the SCM acts as a unified configuration management system, while the 3 instances of the fuse factory, fuse state component, and fuse metrics component are implemented on the consumer side. The states of the fuse include: closed, half-open and full open states, the initialization state is the closed state. The transition process between the three states is shown in fig. 5, and includes:
for each server, when a fuse is in a closed state, if the fuse state component monitors that the failure rate exceeds a standard, switching to a fully-open state, wherein the failure rate comprises the failure rate of the server for processing the micro-service corresponding to the service interface. And after the fully-open state of the fuse lasts for a preset time, if the fuse is not in a half-open state, the fully-open state is switched to a closed state. The term "exceeding" in this embodiment means that the failure rate is greater than a predetermined value, and it is determined that the failure rate is not exceeding when the failure rate is less than or equal to the predetermined value.
Further, after the fully open state of the fuse lasts for a preset time, the fully open state is switched to a half open state. Detecting the failure rate of a server with a fuse in a half-open state, switching the fuse to be in a closed state if the failure rate of the server in the half-open state does not exceed the standard, and switching the fuse to be in a full-open state if the failure rate of the server in the half-open state exceeds the standard.
The creating fuses according to the configuration information comprises: the fuse factory listens for a blown configuration deployed on the SCM and imports the blown configuration into a fuse container (ConcurrentMap).
Further comprising: and deleting the fuse corresponding to the service interface after the independent thread pool is released.
The fusing configuration described in this embodiment specifically includes: closed state measures container size, closed state failure rate; the half-open state measures the size of the container, the failure rate of the half-open state, the maximum concurrency allowed by the half-open state and whether the half-open state exists or not; a fully open state duration; the blown configuration may be deployed at an SCM (Supply Chain Management). Specifically, the fuse configuration is that a fuse factory instantiates (commonly called as producing) fuses according to the fuse configuration, if the fuse configuration changes, an SCM (unified configuration management system) can inform a consumer end in real time, and therefore the previously instantiated fuses are invalid and the fuses need to be instantiated again according to the new fuse configuration.
In this embodiment, the fusing and the service degradation are in one-to-one correspondence, and a service degradation scheme is simultaneously applied to a service related to a server with the fusing, where the service degradation scheme should include: a service fault display, alarm and compensation mechanism; counting the service influence range according to the alarm data; the compensation mechanism is to satisfy the idempotent requirement.
In this embodiment, the main design concept of the technical scheme adopted at the client is as follows: fusing degradation is carried out on the basis of the server dimension where the service is located through a client, the dependency between micro services is very complex at present, one service may depend on many other services, the micro services are distributed at the same time, one service is deployed on different servers, fusing degradation is carried out on the basis of the server dimension where the service is located, the fusing measurement of each server where each service is located is different, many fusing measurement objects are stored in a memory of the client, the occupation of the memory is huge, and the occupation of the memory is greatly reduced by adopting BitSet as a fusing measurement container at the client.
The load balance of service scheduling depends on a fusing mechanism, and the fault servers are dynamically off-line, pre-on-line and on-line, so that the influence of the fault servers on the service is automatically reduced. Moreover, fusing and service degradation are in one-to-one correspondence, a service degradation scheme must be specified on a local service with fusing, and the service degradation scheme should include: a service fault display, alarm and compensation mechanism; counting the service influence range according to the alarm data; the compensation mechanism is to satisfy the idempotent requirement.
The main design idea of the technical scheme adopted at the server side is as follows: and when the service is called, whether the thread pool is rebuilt is determined according to whether the configuration of the latest independent thread pool changes or not.
In the embodiment, the fusing degradation is carried out on the client side by adopting the service based on the server dimension, the dependence on a fusing mechanism is increased by a service scheduling load balancing strategy, and the servers with faults of dynamic offline, pre-online and online are solved, so that the problem that the global fusing degradation is caused by local faults or the local faults are continuously influenced by the local faults due to the fact that the fusing degradation is carried out on the basis of the service overall fault rate in the prior art is solved. The core service of the server side adopts an independent thread pool, achieves thread isolation with other services, avoids the influence of other services on the core service, and solves the problem that the influence of other services on the core service is caused by the adoption of a public thread pool by the server side in the prior art.
In practical application, the fusing degradation of the client is more accurate depending on the service, the server with problems is fused and degraded, and the service without problems continues to provide the service. For example: order services are deployed on three servers, requesting 60 times, load balancing to each server for 20 requests. The fused switch sets the threshold from closed to open: the number of requests was 60, and the abnormality rate was 5%. The number of abnormal requests that need to occur by adopting the existing scheme is: 60 × 5% =3 times; the number of abnormal requests generated by adopting the scheme is as follows: 20 × 5% =1 time.
The existing scheme opens the fusing switch after 3 times of abnormal requests, and service degradation is realized by adopting a degradation scheme. According to the scheme, the fusing switch of the abnormal server is opened and dynamically offline only when 1 abnormal request occurs, other servers normally provide services, and the adoption of a degradation scheme is reduced. The reason is that: large internet companies typically have 50% redundancy in system capacity, and individual server failures are not enough to affect the whole.
The present embodiments also provide a device for fuse isolation of microservices, comprising:
and the thread management module is used for allocating an independent thread pool after calling a service interface, and the service interface corresponds to the service.
And the configuration module is used for acquiring the fuses corresponding to the service interfaces and configuring the acquired fuses to the servers of the independent thread pool.
And the fuse state management module is used for switching the fuse of the server with the fusing metric reaching the threshold value to a fully-open state and taking the server with the fuse in the fully-open state off line when the server with the fusing metric reaching the threshold value is detected. And detecting whether the server where the fuse switched to the semi-open state is located is normal, if so, switching from the semi-open state to the closed state, and putting the server where the fuse in the closed state is located on line.
The thread management module is specifically used for confirming the core service according to whether the core service mark exists in the micro service corresponding to the service interface after the service interface of the service is called. And allocating an independent thread pool for the core service. The micro service without the core service mark is a secondary service, the access amount of the secondary service is larger than that of the core service, and the secondary service thread pool and the independent thread pool are isolated from each other.
The configuration module is specifically configured to read the fusing configuration information after the service interface is called. Fuses are created according to the configuration information, the created fuses are distributed to the servers of the independent thread pools, and fuse state components of the servers are loaded. And the client loads the fusing measurement component and records the execution result of the fuse state component.
The fuse state management module is specifically configured to switch to a fully open state when the fuse is in a closed state and if the fuse state component monitors that a failure rate exceeds a standard, where the failure rate includes a failure rate of the server processing the micro service corresponding to the service interface. And after the fully-open state of the fuse lasts for a preset time, if the fully-open state of the fuse is not in a half-open state, the fully-open state is switched to a fully-open state and a closed state. The states of the fuse include: closed, half-open and full-open states, and the initialization state is a closed state.
And when the fully-open state of the fuse lasts for a preset time, switching to a half-open state. Detecting the failure rate of a server with a fuse in a half-open state, switching the fuse to a closed state if the failure rate of the server in the half-open state does not exceed the standard, and switching the fuse to a full-open state if the failure rate of the server in the half-open state exceeds the standard.
The configuration module is specifically configured to monitor a fuse configuration deployed on an SCM by a fuse factory and import the fuse configuration into a fuse container (convurrentmap). And deleting the fuse corresponding to the service interface after the independent thread pool is released.
In the embodiment, the fusing degradation is carried out on the client side by adopting the service based on the server dimension, the dependence on a fusing mechanism is increased by a service scheduling load balancing strategy, and the server is subjected to dynamic offline, online in advance and online fault, so that the problem that in the prior art, the fusing degradation is carried out on the service based on the service overall fault rate to cause the global fusing degradation, or the local fault range is too small to reach the fusing threshold value to cause the local fault to continuously influence the service is solved. The core service of the server side adopts an independent thread pool, achieves thread isolation with other services, avoids the influence of other services on the core service, and solves the problem that the influence of other services on the core service is caused by the adoption of a public thread pool by the server side in the prior art.
All the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, the apparatus embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the description of the method embodiments for relevant points. The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are also within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (6)

1. A method for fuse isolation of microservices, comprising:
after a service interface is called, an independent thread pool is distributed;
acquiring a fuse corresponding to the service interface, and configuring the acquired fuse to a server of the independent thread pool;
when a server with fusing measurement reaching a threshold value is detected, switching a fuse of the server with the fusing measurement reaching the threshold value to a fully-open state, and taking the server with the fuse in the fully-open state off line;
detecting whether a server where the fuse switched to the half-open state is located is normal, if so, switching the half-open state to the closed state, and enabling the server where the fuse in the closed state is located to be on line;
the acquiring fuses corresponding to the service interfaces and respectively corresponding the acquired fuses to the servers of the independent thread pools includes:
after the service interface is called, reading fusing configuration information;
creating fuses according to the configuration information, distributing the created fuses to the servers of the independent thread pool, and loading the fuse state components of each server;
loading a fusing measurement component by a client, and recording an execution result of the fuse state component;
the creating fuses according to the configuration information comprises: a fuse factory monitors a fusing configuration deployed on an SCM and imports the fusing configuration into a fuse container ConcurrentMap;
further comprising: deleting the fuse corresponding to the service interface after the independent thread pool is released;
wherein, the fusing configuration specifically includes: closed state measurement container size, closed state failure rate, half-open state measurement container size, half-open state failure rate, half-open state allowed maximum concurrency, whether a half-open state exists or not, and full-open state duration; instantiating, by the fuse factory, the fuse according to a fuse configuration; if the fusing configuration changes, the SCM informs the consuming end in real time, and instantiates the fuses again according to the new fusing configuration when the instantiated fuses are invalid before the fusing configuration changes;
fusing and service degradation are in one-to-one correspondence, a service degradation scheme is simultaneously applied to the service related to the fused server, and the service degradation scheme comprises the following steps: and a service fault display, alarm and compensation mechanism.
2. The method of claim 1, wherein assigning a pool of independent threads after invoking a business interface of a service comprises:
after a service interface of a service is called, confirming a core service according to whether a core service mark exists in a micro service corresponding to the service interface;
allocating an independent thread pool for the core service;
the micro service without the core service mark is a secondary service, the access amount of the secondary service is larger than that of the core service, and the secondary service thread pool and the independent thread pool are isolated from each other.
3. The method of claim 1, wherein the state of the fuse comprises: the device comprises a closed state, a half-open state and a full-open state, wherein the initialization state is the closed state;
for each server, when a fuse is in a closed state, if the fuse state component monitors that the failure rate exceeds a standard, switching the state to a full-open state, wherein the failure rate comprises the failure rate of the server for processing the micro-service corresponding to the service interface;
and after the fully-open state of the fuse lasts for a preset time, if the fuse is not in a half-open state, the fully-open state is switched to a closed state.
4. The method of claim 3, further comprising:
when the fully-open state of the fuse lasts for a preset time, switching to a half-open state;
detecting the failure rate of a server with a fuse in a half-open state, switching the fuse to a closed state if the failure rate of the server in the half-open state does not exceed the standard, and switching the fuse to a full-open state if the failure rate of the server in the half-open state exceeds the standard.
5. A device for fuse isolation of a microservice, comprising:
the thread management module is used for allocating an independent thread pool after calling the service interface;
the configuration module is used for acquiring the fuses corresponding to the service interfaces and configuring the acquired fuses to the servers of the independent thread pool;
the fuse state management module is used for switching the fuse of the server with the fusing metric reaching the threshold value to a fully open state and disconnecting the server with the fuse in the fully open state when the server with the fusing metric reaching the threshold value is detected; detecting whether a server where the fuse switched to the half-open state is located is normal, if so, switching the half-open state to the closed state, and enabling the server where the fuse in the closed state is located to be on line;
the configuration module is specifically used for reading fusing configuration information after the service interface is called; creating fuses according to the configuration information, distributing the created fuses to the servers of the independent thread pool, and loading the fuse state components of each server; loading a fusing measurement component by a client, and recording an execution result of the fuse state component;
the fuse state management module is specifically configured to switch to a fully-open state when the fuse is in a closed state and if the fuse state component monitors that a failure rate exceeds a standard, where the failure rate includes a failure rate of a server processing a micro-service corresponding to the service interface; after the fully-open state of the fuse lasts for a preset time, if the fuse is not in a half-open state, the fully-open state is switched to a fully-open state and a closed state; the states of the fuse include: the device comprises a closed state, a half-open state and a full-open state, wherein the initialization state is the closed state;
when the fully-open state of the fuse lasts for a preset time, switching to a half-open state; detecting the failure rate of a server with a fuse in a half-open state, switching the fuse to a closed state if the failure rate of the server in the half-open state does not exceed the standard, and switching the fuse to a full-open state if the failure rate of the server in the half-open state exceeds the standard;
the configuration module is specifically used for monitoring a fusing configuration deployed on an SCM (Single chip Microcomputer) by a fuse factory and importing the fusing configuration into a ConcurrentMap (secure management map); deleting the fuse corresponding to the service interface after the independent thread pool is released;
wherein, the fusing configuration specifically includes: closed state measurement container size, closed state failure rate, half-open state measurement container size, half-open state failure rate, half-open state allowed maximum concurrency, whether a half-open state exists or not, and full-open state duration; instantiating, by the fuse factory, the fuse according to a fuse configuration; if the fusing configuration changes, the SCM informs the consuming end in real time, and instantiates the fuses again according to the new fusing configuration when the instantiated fuses are invalid before the fusing configuration changes;
fusing and service degradation are in one-to-one correspondence, a service degradation scheme is simultaneously applied to services related to a fused server, and the service degradation scheme comprises the following steps: and a service fault display, alarm and compensation mechanism.
6. The apparatus according to claim 5, wherein the thread management module is specifically configured to, after a service interface of a service is called, determine a core service according to whether a core service flag exists in a micro service corresponding to the service interface; allocating an independent thread pool for the core service; the micro service without the core service mark is a secondary service, the access amount of the secondary service is larger than that of the core service, and the secondary service thread pool and the independent thread pool are isolated from each other.
CN201911082761.5A 2019-11-07 2019-11-07 Method and device for fusing isolation of micro-service Active CN111049670B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911082761.5A CN111049670B (en) 2019-11-07 2019-11-07 Method and device for fusing isolation of micro-service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911082761.5A CN111049670B (en) 2019-11-07 2019-11-07 Method and device for fusing isolation of micro-service

Publications (2)

Publication Number Publication Date
CN111049670A CN111049670A (en) 2020-04-21
CN111049670B true CN111049670B (en) 2023-02-21

Family

ID=70231849

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911082761.5A Active CN111049670B (en) 2019-11-07 2019-11-07 Method and device for fusing isolation of micro-service

Country Status (1)

Country Link
CN (1) CN111049670B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111813568B (en) * 2020-05-25 2024-05-31 北京皮尔布莱尼软件有限公司 Service management system and method
CN111787073B (en) * 2020-06-18 2023-08-22 庞茂林 Current limiting fusing platform for unified service and method thereof
CN112965848A (en) * 2021-03-05 2021-06-15 北京百度网讯科技有限公司 Fusing degradation method, device, equipment and medium for micro service
CN114157551B (en) * 2021-11-29 2023-07-21 中国平安财产保险股份有限公司 Fusing identification method, device, equipment and storage medium suitable for micro-service
CN114285844B (en) * 2021-12-07 2024-07-19 深圳市欧瑞博科技股份有限公司 Method and device for intelligently fusing server interface, electronic equipment and storage medium
CN116016646B (en) * 2022-11-07 2024-05-28 中国工商银行股份有限公司 Service access control method, device, equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108650262A (en) * 2018-05-09 2018-10-12 聚龙股份有限公司 A kind of cloud platform extended method and system based on micro services framework
CN109032783A (en) * 2018-08-01 2018-12-18 杭州朗和科技有限公司 Information interacting method, medium, device and calculating equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108600005A (en) * 2018-04-23 2018-09-28 国云科技股份有限公司 A method of defence micro services avalanche effect

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108650262A (en) * 2018-05-09 2018-10-12 聚龙股份有限公司 A kind of cloud platform extended method and system based on micro services framework
CN109032783A (en) * 2018-08-01 2018-12-18 杭州朗和科技有限公司 Information interacting method, medium, device and calculating equipment

Also Published As

Publication number Publication date
CN111049670A (en) 2020-04-21

Similar Documents

Publication Publication Date Title
CN111049670B (en) Method and device for fusing isolation of micro-service
US11269718B1 (en) Root cause detection and corrective action diagnosis system
US10048996B1 (en) Predicting infrastructure failures in a data center for hosted service mitigation actions
CN105187249B (en) A kind of fault recovery method and device
CN111913818B (en) Method for determining dependency relationship between services and related device
US20150263983A1 (en) System and Method for Allocating Resources and Managing a Cloud Based Computer System
CN101689114B (en) Dynamic cli mapping for clustered software entities
CN106656630A (en) Electric marketing service application system, and construction method and platform thereof
WO2021208184A1 (en) Method and system for calling-in and recovery of node traffic and central server
CN109873714B (en) Cloud computing node configuration updating method and terminal equipment
CN108769179A (en) A kind of service health state evaluation method and device
CN102891868A (en) Load balancing method and device for distributed system
BR112012018015B1 (en) SYSTEM FOR AUTOMATED RECONFIGURATION OF AN ELECTRICITY DISTRIBUTION SYSTEM
US9823948B2 (en) Efficient resource utilization in data centers
Panteli et al. Quantifying the reliability level of system integrity protection schemes
CN111866210A (en) Virtual IP balance distribution method, system, terminal and storage medium
CN106951445A (en) A kind of distributed file system and its memory node loading method
US20220129601A1 (en) Techniques for generating a configuration for electrically isolating fault domains in a data center
CN114338670A (en) Edge cloud platform and three-level cloud control platform for internet traffic with same
CN212785387U (en) Low-cost multi-cluster arbitration system
CN105391790A (en) Database high-availability method similar to RAC One Node
CN115834668B (en) Cluster node control method, device, equipment, storage medium and program product
CN113656215B (en) Automatic disaster recovery method, system, medium and equipment based on centralized configuration
Kansal et al. Using dark fiber to displace diesel generators
CN106571969B (en) A kind of cloud service usability evaluation method and system

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
CP03 Change of name, title or address

Address after: 210042 No.1, Suning Avenue, Xuanwu District, Nanjing City, Jiangsu Province

Patentee after: Jiangsu Suning cloud computing Co.,Ltd.

Country or region after: China

Address before: 210042 No.1, Suning Avenue, Xuanwu District, Nanjing City, Jiangsu Province

Patentee before: Suning Cloud Computing Co.,Ltd.

Country or region before: China

CP03 Change of name, title or address
TR01 Transfer of patent right

Effective date of registration: 20240506

Address after: 210000, 1-5 story, Jinshan building, 8 Shanxi Road, Nanjing, Jiangsu.

Patentee after: SUNING.COM Co.,Ltd.

Country or region after: China

Address before: 210042 No.1, Suning Avenue, Xuanwu District, Nanjing City, Jiangsu Province

Patentee before: Jiangsu Suning cloud computing Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right