High CPU usage by opscenterd

Increasing the nodelist polling period or setting a sleep delay can reduce excessive CPU usage when starting or running opscenterd.

Increasing the nodelist polling period or setting a sleep delay can reduce excessive CPU usage when starting or running opscenterd. In some environments, you might notice CPU usage for the opscenterd spiking dramatically (almost to 100%) upon startup or while already running. Typically, this spike is caused by the retrieval and parsing of cluster topology performed during startup, and every 60 seconds by default while opscenterd is running. When OpsCenter is managing multiple clusters with vnodes enabled, the impact of this CPU spike can cause performance issues or even stop opscenterd from properly starting.

If your environment is experiencing excessive CPU consumption, try the available workarounds to alleviate the issue.

Configuring the polling period for CPU issues while running opscenterd

Increasing the nodelist polling period can reduce CPU usage when running opscenterd.

Increasing the nodelist polling period (nodelist_poll_period) can reduce CPU usage when running opscenterd.

cluster_name.conf

The location of the cluster_name.conf file depends on the type of installation:
  • Package installations: /etc/opscenter/clusters/cluster_name.conf
  • Tarball installations: install_location/conf/clusters/cluster_name.conf

Procedure

  1. Open cluster_name.conf for editing.
  2. Add a [collection] section and set the nodelist_poll_period value:
    [collection]
    nodelist_poll_period = 43200 # this would be every 12 hours
    The nodelist_poll_period represents the interval in seconds that OpsCenter polls the nodes and token lists in a cluster. Polling the node list determines whether there were any topology changes since the last poll. If you do not anticipate any topology changes, set it to a high value.
  3. Optional: If there were any topology changes and the polling interval is set to a high value, restart opscenterd. Otherwise, wait for the next poll.
  4. Optional: Refresh the browser.

Configuring a sleep delay for CPU issues when starting opscenterd

Configuring a delay between clusters during startup helps alleviate opscenterd CPU usage on startup, allowing OpsCenter to function properly.

Configuring a delay between starting clusters helps alleviate opscenterd CPU usage on startup, allowing OpsCenter to function properly. Set the startup sleep time to control how long OpsCenter waits between connecting to clusters on startup.

opscenterd.conf

The location of the opscenterd.conf file depends on the type of installation:
  • Package installations: /etc/opscenter/opscenterd.conf
  • Tarball installations: install_location/conf/opscenterd.conf

Procedure

  1. Open opscenterd.conf for editing.
  2. Under the [clusters] section, set the value of startup_sleep to 5:
    [clusters]
    startup_sleep = 5

    The default value is 0 seconds, which results in no wait time between connecting to each cluster. Depending on your environment, you might need to adjust the value. After configuring the sleep value to a value other than zero, wait until all clusters have started before using the OpsCenter UI or API. Otherwise, OpsCenter can become unresponsive and log multiple errors.

  3. Restart opscenterd.