Avalanche problem

Avalanche problem

In microservices, the calling relationship between services is intricate and complicated. A request may need to call multiple microservice interfaces to be implemented, which will form a very complex calling link:

A business request needs to call four services A, P, H, I, and these four services may call other services.

If at this time, a service is abnormal:

For example, if an exception occurs in microservice I, the request is blocked, and the user will not get a response,
this thread of tomcat will not be released, so more and more user requests come,
and more and more threads will be blocked:

The number of threads and concurrency supported by the server is limited, and requests have been blocked, which will cause the server resources to be exhausted,
which will cause all other services to be unavailable, resulting in an avalanche effect.

This is like a car production line that produces different cars and needs different parts.
If a part cannot be used for various reasons, it will cause the whole car to be unable to assemble and
fall into a state of waiting for parts until the parts are in place. Continue to assemble.
At this time, if there are many models that require this part,
the entire factory will be in a waiting state and
all production will be paralyzed. The scope of a part continues to expand.

Hystix has two methods to solve the avalanche problem:

  • Thread isolation
  • Service fusing

Guess you like

Origin blog.csdn.net/m0_51684972/article/details/115057765