Dokploy / Dokploy/dokploy

[v0.29.8] [Bug]: High CPU spikes and Node.js TimeoutNegativeWarning loop in core process

Open
#4,661 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage🔍
Dominant language
TypeScript
Stars
37.4k
Forks
3k
Avg merge
1d 3h
Merged PRs (30d)
73

Description

To Reproduce
  1. Run Dokploy on a host with a moderate-to-high number of containers (approx. 20-30+ active containers, including databases and web apps).

  2. Monitor host processes (e.g., using htop).

  3. Observe regular CPU usage spikes (up to 40-50% on a 6-core setup) from the Dokploy core process (node -r dotenv/config dist/server.mjs) occurring approximately every 20 seconds.

  4. Check the Dokploy container logs using docker logs -f .

  5. Observe the TimeoutNegativeWarning error firing, followed by dashboard data size warnings.

Current vs. Expected behavior

Current behavior: The background scheduler or polling loop appears to miscalculate the time for the next execution, resulting in a negative timeout (TimeoutNegativeWarning: -19224216.33660932 is a negative number). Node.js falls back to a 1ms timeout, causing the core process to run a heavy task in a continuous, aggressive loop, which spikes the CPU and raises the server's Load Average. Simultaneously, it attempts to fetch large amounts of data for the dashboard (399 kB).

Expected behavior: The internal cron/polling jobs should calculate timeouts correctly, wait the appropriate amount of time between ticks, and gracefully handle fetching metrics from multiple containers without overloading the host CPU.

Provide environment information
OS: Ubuntu Server 22.04.5 LTS (Jammy Jellyfish)

Dokploy Version: v0.29.8

Infrastructure: VPS (6 cores, 32GB RAM) hosting a Docker Swarm/Compose environment with 30+ containers (including Traefik, Postgres, Redis, SeaweedFS, n8n, and custom Node.js/Python apps).
Which area(s) are affected? (Select all that apply)

Docker, Application, Databases, Docker Compose

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

The issue severely degrades the server's I/O and CPU, raising the load average above 10. Here is the exact output from the Dokploy container logs during the spike:

Starting Deployment Worker
(node:53) TimeoutNegativeWarning: -19224216.33660932 is a negative number.
Timeout duration was set to 1.
(Use `node --trace-warnings ...` to show where the warning was created)
Docker Cleanup 6/15/2026, 11:50:00 PM]  Running docker cleanup
Access log file does not exist
Warning: data for page "/dashboard/home" is 399 kB which exceeds the threshold of 128 kB, this amount of data can reduce performance.
See more info here: https://nextjs.org/docs/messages/large-page-data
Will you send a PR to fix it?

No

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the background scheduler or polling loop in the core process that emits TimeoutNegativeWarning, then reproduce the behavior with a host running 20–30+ containers and inspect docker logs. Done means scheduler timeouts are non-negative and correctly spaced, dashboard metrics polling no longer creates the warning or sustained CPU spikes, and the documented reproduction no longer shows the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, nodejs, typescript
Domain
backend, devops, observability, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.