Spring boot load balancing

I am working on a spring boot application.

I want to know how I can place a load balancer in front of the application in order to distribute the load on a number of servers.

I found googled and found that there are some Netflix APIs, such as Eureka , Hystrix , Tape and Archaius , that will help you get the work done on balancing the laod.

But it was not possible to find how these terms help to distribute the load on the request and balance at the same time, provide high reliability and availability for all users accessing a particular service.

I am going to, although all this, but can not find the entry point to the system. I don’t really understand where to start.

+4
source share
2 answers

Understanding that your application offers REST services, I suggest you not search the Netflix API. This is great, but it will not help you in your use case. I suggest you take a look at ha-proxy , nginx or httpd for simple load balancing features. The good part is that you do not need to look into the stickiness of the session, since REST does not have a default status.

+4
source

You can use HAProxy

, :

global
   daemon
   maxconn 256

defaults
   mode tcp
   timeout connect 5000ms

listen http-in
   timeout client 180s
   timeout server 180s
   bind 127.0.0.1:80
   server server1 157.166.226.27:8080 maxconn 32 check
   server server2 157.166.226.28:8080 maxconn 32 check
   server server3 157.166.226.29:8080 maxconn 32 check
   server server4 157.166.226.30:8080 maxconn 32 check
   server server5 157.166.226.31:8080 maxconn 32 check
   server server6 157.166.226.32:8080 maxconn 32 check

HTTP-, 80 , round robin. . HAProxy.

+4

Source: https://habr.com/ru/post/1610385/


All Articles