IMD SolutionComputing LibraryShop main store

Troubleshooting

Why InfluxDB shows a periodic CPU peak on an edge controller

Edge computing and IIoT Published 9 min read By IMD Solution engineering team

Short answer

A CPU peak from an InfluxDB container that repeats on a fixed schedule and survives stopping Node-RED and Grafana is scheduled work, not client load. Suspect the tasks defined around the container first — health checks, metrics scrapes, backups — then prove the cause by stopping the InfluxDB container alone and running a two-way test; fix the task you find, or move the historian stack to a dedicated box.

On this page
  1. Why does InfluxDB peak at 50% CPU every 10 seconds with no clients running?
  2. What scheduled work runs inside or around an InfluxDB 1.8 container?
  3. Can a container health check cause periodic CPU spikes?
  4. How do I isolate the peak to the InfluxDB container?
  5. How much average CPU does a 10-second peak really add?
  6. How do I verify the cause instead of guessing?
  7. When is the fix a different machine?
  8. Questions asked

A CPU peak from an InfluxDB container that repeats on a fixed schedule and survives stopping Node-RED and Grafana is scheduled work, not client load. The stopped-client test is the strongest clue in the report: whatever produces the peak does not care whether anyone is reading or writing, and the host's process view pins the work to the database's container. InfluxDB 1.8's own housekeeping runs on long, configured timers, so the first suspects are the tasks defined around the container — health checks, metrics scrapes, backup jobs — and health checks in particular have a documented history of exactly this symptom. Below are the isolation sequence, the duty-cycle arithmetic that turns a scary spike into an average you can judge, and the decision for each outcome.

Why does InfluxDB peak at 50% CPU every 10 seconds with no clients running? #

A peak that repeats about every 10 seconds with Node-RED and Grafana stopped is scheduled work, not client load: something on a timer — inside the InfluxDB container, its service definition or the host platform — runs on that cadence, and the isolation test below names it.

Three candidates survive the stopped-client test: work scheduled inside the database container, work scheduled around it by the container platform, and writers or pollers elsewhere on the network. The process view telling you the CPU belongs to the database's container locates the work but does not name the task — a health check's probe runs inside the container too, which is why attribution needs the tests below and not the process list alone. One client-side pattern deserves a mention because it fits so well: a dashboard refreshing its queries on a short interval is periodic database load by design, and the Grafana project's tracker documents dashboards ramping up the database's CPU to the point where the container gets killed. Your stopped-Grafana test already rules that pattern out, which is exactly why that test was worth running.

What scheduled work runs inside or around an InfluxDB 1.8 container? #

InfluxDB 1.8 does housekeeping — retention enforcement, shard group management, background storage work — on its own configured timers, while the container platform adds health checks, backups and monitoring scrapes on schedules set in your service definitions; a seconds-scale cycle points at the second group first.

On the database side, the long-scale claim has documentation behind it: the InfluxDB project's tracker records a case where a retention-policy change sat idle because it only applies to newly created shards, and the next shard group was 7 days away. Retention, shard creation and storage maintenance do not fire on a seconds cadence on default settings. Around the container, the platform and the deployment add their own clocks: health checks that run a command inside the container on an interval, metrics collectors polling the engine or the database's HTTP endpoint, backup or sync jobs, and log shippers. Backups normally fire nightly and cannot explain a short cycle; health checks and short-interval scrapers are the two that can. Read your service definitions for both — the health check block of the influxdb service and any sidecar that polls on a timer — and check the network for a second system writing or querying on a schedule, because a monitoring server polling the database's HTTP endpoint every few seconds produces exactly this signature from outside.

Can a container health check cause periodic CPU spikes? #

Yes — a health check is the best-documented suspect: the container engine's own issue tracker records that even a trivial probe command produces a visible CPU spike on every check, and on a small controller a probe on a seconds interval reads exactly like your pattern.

Every check is a fresh process: the engine spawns a command inside the container at the configured interval, and that spawn — namespaces, resource accounting, the command itself — costs real CPU for its short life. In the documented case, an idle container pushed from 0% to 8% CPU at every check in docker stats by a probe that ran nothing but pwd; the check mechanics alone were enough to see. A database probe usually costs more per hit, because it typically requests an HTTP endpoint and adds a connection and a response to each check, so the per-hit share on a small controller scales up from that 8%. The same mechanism is documented for Node-RED containers on an edge PC, where the health check itself turned out to be the CPU cost: how Node-RED Docker healthcheck CPU spikes were stopped on an edge PC shows the diagnosis and the fix. Open the influxdb service definition and read its health check block — the interval and the command it runs. An interval equal to your peak spacing makes the probe the prime suspect.

How do I isolate the peak to the InfluxDB container? #

Stop the InfluxDB container and watch the same CPU display: if the periodic peak vanishes with everything else already stopped, the work is inside the container; if it survives, it belongs to the host, and the sequence below settles which in a few minutes.

Run it in this order, changing nothing but the step in play:

  1. Fix the measurement. Same tool — the host process view (htop) — same view, timestamps on. Do not compare a stats dashboard one day with a process list the next.
  2. Record the baseline. Note the peak height in percent of one core, the peak duration in seconds, and the spacing between peaks, over enough cycles to see all three hold steady.
  3. Keep the clients out. Leave Node-RED and Grafana stopped for the whole test so dashboard refreshes and write bursts cannot masquerade as background work.
  4. Protect the data first. Stopping the database pauses historian writes; before you stop it, confirm its data directory is a volume on host storage, because restarting onto container-internal storage is why an InfluxDB container loses old data after restart. That is the one caution in this procedure — schedule the gap.
  5. Stop only the influxdb container. Peak gone: the work is inside it. Peak still there: it is the host or the platform — go back to the process view and hunt other periodic processes such as log shippers and collectors.
  6. Restart only influxdb. The identical pattern returning, same height and same spacing, confirms the load travels with this container.
  7. Correlate. Line the peak timestamps up against the container's log output and against every scheduled item in your service definitions: the health check block, any metrics scraper, any backup job.
  8. Change one thing at a time. After each change, compare both the height and the spacing against the baseline before touching the next item.

How much average CPU does a 10-second peak really add? #

Multiply the peak by its duty cycle: a 50%-of-one-core burst lasting about half a second of every 10 seconds adds only 2.5% of one core on average, so a spike that looks alarming in htop can be a footnote in total capacity — the duration is the number that decides.

Worked example — illustrative inputs; measure your own before deciding:

  • Inputs: peak height 50% of one core; peak duration about 0.5 s; cycle length 10 s.
  • Average added load = 50% × (0.5 s ÷ 10 s) = 2.5% of one core.
  • On a four-core host that is 2.5% ÷ 4 = 0.625% of total CPU capacity — headroom you keep, and a fair price for historian service once the task is identified and intentional.
  • Second scenario: the same 50% height but a 5 s duration in the same 10 s cycle gives 50% × (5 s ÷ 10 s) = 25% of one core, or 25% ÷ 4 = 6.25% of the host — ten times the first case's average, and long plateaus are the signature of real periodic work such as a scraper that queries data or a storage maintenance pass, not a probe's spawn cost.

For scale, the health-check case in the engine's tracker was a container idling near zero and jumping by 8 percentage points at each check from a probe that ran only pwd — small per hit; a probe that opens a connection to the database costs more per hit than that. So read duration, not just height: a burst well under a second points at the platform task, a plateau of whole seconds points at the database's own work.

How do I verify the cause instead of guessing? #

A verified cause needs a two-way test: remove the one suspected task and the peak must disappear or shift to the task's new interval, then restore it and the identical pattern must return, with the image version, workload and measurement method unchanged throughout.

The decisive move is to make the peak follow a number you set. Change the suspected task's schedule and watch: set a health check interval to 30 s, for example, and a peak that now repeats about every 30 s proves the probe, while a peak still on the old spacing means the probe was a passenger. Then run the return trip: remove the task and the peak must vanish; restore it and the identical pattern must come back. A one-way disappearance is correlation; the round trip, with height and spacing matching on both sides, is cause. Three controls keep the test honest: pin the exact image version for the whole test, keep the workload unchanged, and keep the measurement method unchanged — one changed variable at a time, always against the recorded baseline. Logs close the case: a verified peak lines up with a log line or a task boundary on every cycle, and a peak with no matching entry anywhere stays a hypothesis no matter how regular it looks.

When is the fix a different machine? #

Fix the platform task and keep the controller when the peak follows a health check, scrape or backup you configured; move the historian stack to a dedicated fanless mini PC when the peak is the database's own work and the measured average load leaves the controller no headroom.

Case one, a platform task: tune it and stop there. On a small controller, run health checks at minute-scale intervals unless the service genuinely fails faster — each check spawns a process, so the interval is a CPU budget decision, not a monitoring nicety. Make probes cheap, an endpoint request rather than a heavy script, and drop scrapers you do not actually read.

Case two, the database's own work: this is a capacity decision, and the duty-cycle arithmetic above is the input. A controller that also runs the machine's real-time tasks should not share its CPU with compaction and retention passes; when the measured average load is a real fraction of a core and the box has control duties, move Node-RED, InfluxDB and Grafana onto a dedicated box and size it for the job — sizing one PC for InfluxDB, Telegraf, Grafana and Node-RED walks through that calculation. If you are re-selecting the pieces while you move, the guide on selecting pymodbus, InfluxDB and Grafana for SCADA covers the trade-offs.

So the decision, case by case: the peak follows a task you configured — fix that task's interval or remove it and keep the controller. No configured task matches and the peak tracks the database's own logs — accept it only if the duty-cycle average is probe-scale and the controller carries nothing time-critical; otherwise move the historian stack off and let the controller control.

Questions asked

Does stopping the InfluxDB container for the test lose data?

Writes pause while the container is down. A producer that buffers, such as one with a store-and-forward queue, delivers its backlog when the database returns; a producer without buffering simply drops the points from that window. Pick a test window where a gap in the historian does not matter, and finish the two-way test in one sitting so the baseline and the restart compare like with like.

How long should each stage of the isolation test run?

Capture at least ten peaks per stage: at a 10-second interval that is about two minutes of baseline, the same with the container stopped, and the same after restart. Any task on a longer schedule, such as a nightly backup or a retention pass, needs its own window, because a two-minute test cannot see it. If the interval is unknown, record five minutes before changing anything.

Can an InfluxDB version change cause or fix the peak?

Only by accident, and only after the cause is verified. The project's issue tracker documents high-CPU reports tied to specific releases, including reports that appeared after moving between 1.8 point releases, so changing the image version can add a load pattern as easily as remove one. Pin the exact image version during the test, change it only once the cause is known, and re-run the two-way test after any upgrade.

Why does the spike show under the influxdb process if a health check is to blame?

A probe runs inside the container's resource group, so the engine charges its CPU time to the container, and the host process view shows it in the container's process tree. The probe command itself usually finishes in milliseconds, shorter than the screen refresh, so you see the total spike without catching the probe in the act. Matching the spike to the check's timestamps in the log is how you catch it.

Keep reading

  • How-to

    Deploying Edge Data Store in Docker on a controller PC

    Run Edge Data Store as a Docker container on the controller-class edge PC and let its OPC UA adapter ingest the local server over localhost. Define egress targets, buffering and forwarding schedules in the JSON configuration, size the buffer from tag count, scan rate and outage target—50 tags at 1 event/s across an 8-hour outage is about 288 MB—and sign off only after a live pulled-cable test.

    Edge computing and IIoT

  • Troubleshooting

    Why an InfluxDB container loses old data after restart

    An InfluxDB container that comes back empty after recreation was never writing to your mounted volumes. Its startup log names the real store: /root/.influxdbv2/influxd.bolt and /root/.influxdbv2/engine/data. Bind one host directory to /root/.influxdbv2 and confirm the recreated container opens that bolt file before trusting it with data.

    Edge computing and IIoT

  • Troubleshooting

    Why Ignition tag history records only every 10 seconds

    History that lands only every 10 seconds, dropping peaks shorter than that, is the historical scan class at work: in the case traced here the Default Historical scan class sat at a 10-second interval while 1 second was expected. SQL Express, Windows 7 and the hardware were not involved. Read the interval on the tag's assigned scan class, set it to the rate your data needs, and prove the fix with a brief test peak in a history query.

    Edge computing and IIoT

Why ArchestrA Historian storage shows high CPU usage