OpenShift запрос Roundrobin для всех модулей - PullRequest
1 голос
/ 06 апреля 2019

Мы хотим иметь циклический запрос для всех модулей, развернутых в openshift.Я настроил ниже аннотации в Конфигурации маршрута, но последовательность вызовов ко всем модулям случайна:

haproxy.router.openshift.io/balance : roundrobin
haproxy.router.openshift.io/disable_cookies: 'true'

У нас есть 3 модуля вращения.Мы хотим, чтобы запросы имели последовательность pod1, pod2, pod3, pod1, pod2, pod3, pod1 ....

Но реальное поведение после установки выше аннотаций в случайном порядке, как: pod1, pod1, pod2, pod2, pod3, pod1, pod2, pod2 .... что неверно.

Нужно ли нам конфигурировать какую-либо конфигурацию openshift, чтобы она идеально подходила для округления?

1 Ответ

0 голосов
/ 07 апреля 2019

Если вы хотите получить доступ через pod1, pod2, pod3 по порядку, вы должны использовать leastconn в той же группе pod.

leastconn   The server with the lowest number of connections receives the
              connection. Round-robin is performed within groups of servers
              of the same load to ensure that all servers will be used. Use
              of this algorithm is recommended where very long sessions are
              expected, such as LDAP, SQL, TSE, etc... but is not very well
              suited for protocols using short sessions such as HTTP. This
              algorithm is dynamic, which means that server weights may be
              adjusted on the fly for slow starts for instance.

roundrobin из HAProxy будет распределять запросв равной степени, но это может не защитить порядок доступа к серверу в группе.

roundrobin  Each server is used in turns, according to their weights.
              This is the smoothest and fairest algorithm when the server's
              processing time remains equally distributed. This algorithm
              is dynamic, which means that server weights may be adjusted
              on the fly for slow starts for instance. It is limited by
              design to 4095 active servers per backend. Note that in some
              large farms, when a server becomes up after having been down
              for a very short time, it may sometimes take a few hundreds
              requests for it to be re-integrated into the farm and start
              receiving traffic. This is normal, though very rare. It is
              indicated here in case you would have the chance to observe
              it, so that you don't worry.

Подробнее о параметрах алгоритма баланса см. Баланс HAProxy (алгоритм) .

...