2

As I distributed similar instance to two different servers, my first server has good configuration but the second server have not enough memory for cache. So I want 80% of the requests being transfered to my first server and the remaining to the second server. How can I configure this using ribbon with spring boot?

Currently, it is working on round robin algorithm. the first request goes on first server and second go on the second one. I want to configure into 4:1.

g00glen00b
  • 41,995
  • 13
  • 95
  • 133

1 Answers1

4

Ribbon offers some prebuilt rules as documented here: https://github.com/Netflix/ribbon/wiki/Working-with-load-balancers

I think WeightedResponseTimeRule can be suitable in your case. Instead of statically defining a ratio, let Ribbon decide depending on the response times of the servers.

Or, you can define your custom rule as described here: Ribbon load balance algorithms

humbaba
  • 318
  • 2
  • 10