Configuring streaming servers for load balancing

The MinistraPRO backend acts as a load balancer to distribute streams from available streaming servers to MinistraPRO applications.

Information

The Prometheus monitoring system must be installed and configured to receive metrics from Flussonic streamers.

Streaming servers participate in load balancing only when the following conditions are met:

  • The streaming server status is Up.

  • The maximum capacity of active clients on the server is not reached.

The balancing priority depends on the following:

  • The ratio of current to maximum number of clients.

  • Server monitoring (servers with enabled monitoring have higher priority).

Add a streaming server

With load balancing enabled, clients are distributed among the streaming servers in individual succession. For example, if you have three streaming servers in a channel, the first client is allocated to server one, the second to server two, the third to server three, the fourth to server one again, and so on.

To add a streaming server

  1. Navigate to Streaming servers > Servers list.
  2. Select + Add server.

  3. Add the relevant data for the server.

    Learn more: Add server details

  4. Select Save.

Enable monitoring for a load balancing server

Monitoring is not required for load balancing to work, but with monitoring enabled, you get access to client metrics, such as server status and client count.

By default, every two minutes the backend receives information about the status of the stream servers and the number of clients from Prometheus.

Information

Jobs in Prometheus retrieve data from the streaming server and, in turn, cron jobs in MinistraPRO collect data from Prometheus.

The monitoring_server.ini configuration file contains the details of the Prometheus monitoring server.

To enable the collection of metrics

  1. Open the monitoring_server.ini configuration file.

  2. Modify the file to match the following example:

    [monitoring_server]
    
    monitoring_server[url]='https://prometheus.example.com/api/v1/query'
    
    ; auth type or empty, currently only 'basic' authorization type is supported
    
    monitoring_server[auth]=basic
    
    monitoring_server[user]='basic_auth_login'
    
    monitoring_server[password]='basic_auth_password'
    
    monitoring_server[timeout] = 30
    
    monitoring_server[connect_timeout] = 30
    
    monitoring_server[read_timeout] = 30
    
    monitoring_server[job_name] = 'job_name'
    
    monitoring_server[client_count_metric_name] = 'streamer_clients'

    Where:

    • [url] is the API endpoint for the monitoring server.

    • [user] and [password] are your monitoring server credentials.

    • [job_name] is the name of the metrics collection job.

    • [client_count_metric_name] is the name of the metric.

  3. Save and close the configuration file.

Information

If the response from the monitoring server contains no data, the status of the streaming server changes to Down.

If no response is received rom the monitoring server, or the response contains an error, the status and number of clients for the specified streaming server do not change.

Add server details

General information

Setting

Description

Title

The name of the load balancing server.

Information

The title of the streaming server in the admin interface must match the instance parameter for the Prometheus job.

URL

The URL of the load balancing server.

Maximum of users

The maximum number of users that this load balancing server can support.

Multi-filter

If the server matches the specified filter, then the content will be retrieved for the user.

Learn more: Creating multi filters

Enable monitoring

Enables monitoring of streams that use this load balancing server.

By default, the Enable monitoring check box is selected.

When monitoring is enabled on the server for the first time, the server status is Down until the next execution of the UP_STATE request to the monitoring server.

If monitoring is disabled, the server status is always Up and the client count does not refresh.

 

Additional information

You can automatically update your streaming server with the details you enter in MinistraPRO by connecting through the streaming server API.

Information

Currently, only Flussonic is supported.

Learn more: Flussonic integration

Setting

Description

Use stream-server API

The streaming server software that you are connecting to.

API host

The URL of the streaming server.

API login

The administrator login name for the streaming server.

API password

The password of the administrator login for the streaming server.