Skip to content

st2 up consumes ~40% CPU while supervising an idle stable catalog #23

Description

@schickling-assistant

Summary

st2 up appears to poll the catalog at a high frequency even when the supervised fleet is stable. In a long-running deployment it averaged about 40% of one CPU core for more than 11 hours.

This report intentionally anonymizes the host, account, catalog paths, agent identities, and project names. The numeric process evidence is retained.

Related issue

Version

  • st2 0.1.0
  • build commit: 46ff6ee
  • Linux, x86_64

Reproduction

  1. Create or use a catalog containing at least one stable agent whose task is already running.

  2. Start the supervisor:

    st2 up --catalog /tmp/example/catalog --host example-host
  3. Leave the catalog and inbox unchanged for several minutes.

  4. Measure the supervisor:

    pid=$(pgrep -n -f 'st2 up')
    pidstat -p "$pid" 1 60
    ps -Lp "$pid" -o pid,lwp,etimes,stat,pcpu,comm,wchan
    cat "/proc/$pid/io"
    grep -E 'Threads|voluntary_ctxt|nonvoluntary_ctxt' "/proc/$pid/status"

Observed in a long-running deployment

After 39,706 seconds:

STAT   %CPU  threads  voluntary switches  involuntary switches
Ssl    41.5  2        4,762,962           1,305,248

/proc/<pid>/io:

rchar: 861,670,861,903
wchar: 614,311,139
syscr: 19,090,736,150
syscw: 10,066,129
read_bytes: 68,096,000
write_bytes: 536,576

The process was sleeping in poll_schedule_timeout, but its cumulative CPU and syscall volume continued to grow while the catalog was stable.

Expected

An idle supervisor should primarily block on filesystem/timer events and consume near-zero CPU. A periodic reconciliation timer should have a bounded, configurable cadence and should not generate billions of read syscalls.

Suggested investigation

  • Measure reconciliation frequency and work performed per pass.
  • Check whether filesystem events produced by ST2 itself retrigger reconciliation.
  • Add counters or debug logs for watch wakeups, timer wakeups, and reconciliations.
  • Add an idle-load regression test that runs a stable catalog for 30–60 seconds and asserts bounded reconciliation count and CPU time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:reconcileSupervisor run loop, lifecycle, restart, park, and teardown · Set: manualorigin:agentFiled or primarily produced by an AI agent · Set: manualtype:bugSomething broken or a regression · Set: manual

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions