Change the algorithm for distributing requests
Change the algorithm for distributing requests
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Balancers.
-
Open the tab Target groups → landing page.
-
On the line Algorithm click .
-
Choose an algorithm:
- Round Robin is a round robin algorithm. The first request is passed to one server, the next request to another and so on until the last server is reached. Then the cycle starts again. Requests are distributed to servers according to the specified weight.
- Least connections — the algorithm takes into account the number of connections to servers. A new request is passed to the server with the smallest number of active connections, the server weight is not taken into account.
-
Optional: to enable the method Sticky Sessions on the line Sticky Sessions click and check the box Sticky Sessions and select a session ID. For the APP-cookie session ID, enter a cookie name.
-
Change it balancing algorithm for the task force:
openstack loadbalancer pool set \
--lb-algorithm <algorithm> \
<pool>Specify:
<algorithm>
— algorithm name:ROUND_ROBIN
orLEAST_CONNECTIONS
<pool>
— ID or group name, can be viewed withopenstack loadbalancer pool list
-
Optional: enable method Sticky Sessions:
openstack loadbalancer pool set \
--session-persistence type=<type>,cookie_name=<name> \
<pool>Specify:
<type>
— session identifier:APP_COOKIE
,HTTP_COOKIE
,SOURCE_IP
cookie_name=<name>
— cookie name. Specify if session ID is selectedAPP_COOKIE
<pool>
— ID or group name, can be viewed withopenstack loadbalancer pool list