Configure Horizon Apache Worker Recycling

Overview

In deployments with sustained Horizon usage, the Apache WSGI worker processes that serve the dashboard may accumulate memory over time. This is expected behavior for long-running Python/Django processes. Starting with StarlingX OpenStack r13, worker recycling is enabled by default to prevent unbounded memory growth.

The following parameters control how and when Horizon’s Apache workers are recycled:

Parameter

Description

Default

maximum_requests

Number of requests a worker handles before being recycled. Set to 0 to disable.

10000

restart_interval

Time in seconds before a worker is recycled regardless of request count. Set to 0 to disable.

86400 (24 hours)

graceful_timeout

Time in seconds to wait for in-flight requests to complete before forcefully terminating a recycling worker.

30

These defaults are suitable for most deployments. For systems with higher Horizon usage or stricter memory constraints, you can adjust the recycling thresholds via Helm overrides.

Procedure

  1. Create an override file (for example, horizon-wsgi-override.yaml):

    conf:
      horizon:
        wsgi:
          maximum_requests: 20000
          restart_interval: 43200
          graceful_timeout: 30
    
  2. Apply the override:

    ~(keystone_admin)]$ system helm-override-update stx-openstack horizon openstack --values /path/to/horizon-wsgi-override.yaml
  3. Reapply the application for the changes to take effect:

    ~(keystone_admin)]$ system application-apply stx-openstack

Note

Worker recycling is graceful. In-flight requests are allowed to complete within the graceful_timeout window before the worker is replaced. Users should not experience service interruption.

Note

If both maximum_requests and restart_interval are set to non-zero values, the worker is recycled when either condition is met first. Set either to 0 to disable that specific recycling mechanism.