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 it's already running. Typically, this 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 starting up properly.

If your environment is experiencing excessive CPU consumption, try the available workarounds to alleviate the issue.
Note: Future versions of OpsCenter will provide a better solution to reduce the CPU usage of this process and should obviate the need for the interim CPU workarounds.

Configuring the polling period for CPU issues while running opscenterd

Increasing the nodelist polling 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

Increasing the nodelist polling period can reduce CPU usage when running opscenterd. The nodelist_poll_period configuration option is applicable to OpsCenter version 5.0.2+.

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.

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

Configuring a delay between clusters during startup helps alleviate opscenterd CPU usage on startup, allowing OpsCenter to function properly. The startup_sleep configuration option is applicable to OpsCenter version 5.1.1+.

Procedure

  1. Open opscenterd.conf and set startup_sleep to the following:
    [clusters]
    startup_sleep = 5

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

  2. Restart opscenterd.