Change the algorithm for distributing requests
Change the algorithm for distributing requests
Control panel
OpenStack CLI
-
In the dashboard, on the top menu, click Products and select Cloud Servers.
-
Go to Balancers → Target Groups tab.
-
Open the landing page.
-
In the Algorithm row, click .
-
Choose an algorithm:
- Round Robin is a round robin algorithm. The first request is passed to one server, the next request is passed 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 Sticky Sessions method, in the Sticky Sessions row, click , check the Sticky S essions checkbox, and select a session ID. For the APP-cookie session ID, enter a cookie name.
-
Change the balancing algorithm for the target group:
openstack loadbalancer pool set \
--lb-algorithm <algorithm> \
<pool>Specify:
<algorithm>
— algorithm name:ROUND_ROBIN
orLEAST_CONNECTIONS
<pool>
— ID or group name can be viewed with the commandopenstack loadbalancer pool list
.
-
Optional: enable the Sticky Sessions method:
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 with the commandopenstack loadbalancer pool list
.