Skip to content

Latest commit

 

History

History
32 lines (31 loc) · 3.32 KB

README.md

File metadata and controls

32 lines (31 loc) · 3.32 KB

How balancing works

External requests

external request = request with no upstream described for host
served with default configuration

Internal requests

Balancing

//TODO

Arch

Upstream - configuration(retries amount and policy, timeout etc) + ip and its weight list to balance request with If our default Consul-based implementation described below is not applicable for you - there are 2 extension points:

Data Source

Important. Service name for configuration in consul KV must be equal to service name in consul registration of the service

  1. Configuration format: ApplicationConfig must be set in Consul KV
  2. Client subscribes for Consul KV entries for requried services
  3. Client subsribes on Consul service health to get IP and weight list for required services
  4. We register instances in consul with related weight in any way Consul supports. We recommend do it with nuts-and-bolts - the frameworks will register instance on startup
  5. profit
For hh.ru
  • Раскатка конфигов в Consul: из cassandra_settings/balancer.yml. См. EXP-41677
  • Задача на приведение имени сервиса и апстрима к одному значению: EXP-44785
  • Сервисы, которые сами не умеют регистрироваться регаются скриптом: EXP-37504

Previous LEGACY structure (2.x.x)

  1. Configuration must be provided in any way you want but in specific format. See 2.x.x sources to get right structure of the config
  2. Configuration update is also up to you) You just call updateUpstreams when it's required
  3. profit
For hh.ru
  • Для доставки апстримов мы используем динамические настройки: settings-client
  • Раскатка конфигов в cassandra: из cassandra_settings/balancer.yml через cassandra_settings.yml конфиги И список ip И их весов для апстримов
  • Посмотреть апстримы select * from settings.setting where service='system'