.. meta::
   :description: Configuration parameters for defining cluster agent
                 settings in ThinLinc, including draining of sessions.

.. _configuration_agents_params:

.. server-config-folder:: /agents

Parameters in /agents/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In this section, we will describe all the parameters used for defining cluster
agent settings. For more information about draining agents of sessions see
:ref:`stop_new_sessions_on_agent`. For more information about load balancing see
:ref:`load_balancing`. For more information about configuring the
agent service see :ref:`configuration_vsmagent`. These configuration parameters
reside in :file:`/opt/thinlinc/etc/conf.d/cluster.hconf`.

.. server-config:: /agents/draining

   A space-separated list of agent hostnames that should not be used for
   creating new sessions. Existing sessions can still be reconnected to
   and will continue to work as before. This can be used to drain an
   agent of sessions over time. The default is no draining agents.

.. server-config:: /agents/weights/<hostname>

   A number that represents the weight for an agent. The hostname of the agent
   is the parameter name, for example ``tla01.cendio.com=200``. The hostname
   must match a hostname included in |agents| for a subcluster. Weights can be
   used to adjust the distribution of users.

   .. |agents| replace::
      :servconf:`agents </subclusters/<name>/agents>`

   The default weight is 100. Users are balanced across agents evenly within
   each subcluster, given that all agents have the same weight. Agents with
   higher weights will get more users, and lower weights will result in fewer
   users comparatively.

   For example, given the following configration:

   .. code:: ini
   
      [/subclusters/Default]
      agents=tla01.cendio.com tla02.cendio.com tla03.cendio.com

      [/agents/weights]
      tla01.cendio.com=200
      tla02.cendio.com=100
      tla03.cendio.com=50

   In a scenario with the above configuration, over time 280 users will be
   distributed roughly with 160 users on ``tla01.cendio.com``, 80 users on
   ``tla02.cendio.com`` and 40 users on ``tla03.cendio.com``.

   .. note::

      The weight must be a positive integer. Negative numbers or zero are
      invalid, and will be ignored. The default weight of 100 will be used.
