You can configure load balancing for multi-session hosts by configuring load balancing settings in Horizon Console or by creating and configuring load balancing scripts.

By default, Horizon Connection Server uses the following formula to balance the placement of published desktop and application sessions on multi-session hosts:

(connected sessions + pending sessions + disconnected sessions)/(maximum session count)

If the maximum session count is configured as unlimited, load balancing falls back to using the absolute number of the total session count which includes connected, pending and disconnected sessions.

Load Balancing Settings in Horizon Console
VMware Horizon 8 calculates the Server Load Index based on the load balancing settings you configure in Horizon Console. The Server Load Index indicates the load on the server. The Server Load Index can range from 0 through 100, where 0 represents no load and 100 represents full load. A Server Load Index of -1 indicates that load balancing is deactivated. You can view the Server Load Index in the Horizon Console dashboard. Horizon 8 also offers threshold values in the load balancing settings for logon storm handling. See, Load Balancing Settings.
Load Balancing Scripts
You can also override the default behavior of the load balancing settings and control the placement of new published desktop and application sessions by writing and configuring load balancing scripts on the host machine.

You can write your own custom load balancing script to a designated file. You can define this file path by configuring the LBCustomScript option in the /etc/vmware/viewagent-custom.conf configuration file.

You can run these scripts on your own schedule or run these scripts with Horizon 8. For more information on configuring load balancing scripts in Horizon 8, see Configure Load Balancing Settings on a Linux Multi-session Host in Horizon Console.

Load balancing scripts must write the load index to a designated file. To define the file path, configure the LBCustomScriptResult option in /etc/vmware/viewagent-custom.conf. The load index value must be between 0-100.