Skip to content

NPM using 80-90% CPU as soon as it starts #4520

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
javito1081 opened this issue May 2, 2025 · 4 comments
Open

NPM using 80-90% CPU as soon as it starts #4520

javito1081 opened this issue May 2, 2025 · 4 comments
Labels

Comments

@javito1081
Copy link

javito1081 commented May 2, 2025

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug
it started a few days ago, npm is consuming 80-90% of my cpu in 2 process, heres a pic of my htop

https://drive.google.com/file/d/12-ZBtBSNjaHAeP_KC6kEVSnZtHchsYlo/view?usp=sharing

its driving me cracy, i cant make it to be normal again, never seen this b4, logs r useless, theres nothing there, its all like its acting normal

sometimes the name of the command change to nginx worker process is shutting down, but the process id remains the same, if i shutdown npm, my server goes back to normal but that doesnt work all the time, i have it on ubuntu server as a docker with other 12 docker containers, its been runing fine, but the issue started all of a sudden 3 days ago

If i do docker compose -f npm/npm.yml down && docker compose -f npm/npm.yml up -d to restart the container, everything goes back to normal but like i said it doesnt always work, until it starts all over again, sometimes it takes a bit, sometimes it takes longer, but eventually it starts to take 80-90% of my cpu again.

Nginx Proxy Manager Version
v2.12.3

To Reproduce
As soon as i start the container, my cpu goes to 80-90% usage by NPM

Expected behavior
Work as intended with no trafic

Screenshots

Image

Operating System
Ubuntu Server 24.04

Additional context
im using docker compose, heres my file

services:
  npm:
    image: 'docker.io/jc21/nginx-proxy-manager:latest'
    #image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    container_name: nginx-proxy-manager
    ports:
      # These ports are in format <host-port>:<container-port>
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '81:81' # Admin Web Port
      # Add any other Stream port you want to expose
      # - '21:21' # FTP

    # Uncomment the next line if you uncomment anything in the section
    environment:
      # Uncomment this if you want to change the location of
      # the SQLite DB file within the container
      # DB_SQLITE_FILE: "/data/database.sqlite"

      # Uncomment this if IPv6 is not enabled on your host
      DISABLE_IPV6: 'true'

    volumes:
      - ./npm-data:/data
      - ./npm-letsencrypt:/etc/letsencrypt
@javito1081 javito1081 added the bug label May 2, 2025
@theraw
Copy link
Contributor

theraw commented May 2, 2025

try sharing more info

top screenshot
amount of websites
amount of logs
amount of traffic
what changes are done to nginx
is it a vps or dedicated server
if vps what are your cpu units set by provider.
docker container logs
nginx error logs
nginx -T output

@javito1081
Copy link
Author

try sharing more info

top screenshot amount of websites amount of logs amount of traffic what changes are done to nginx is it a vps or dedicated server if vps what are your cpu units set by provider. docker container logs nginx error logs nginx -T output

top screenshot

Image

amount of websites
14

amount of logs

Image
Image
Image

amount of traffic

Image

what changes are done to nginx
havent touch it, like i mention i run it with a docker compose file

is it a vps or dedicated server
its a vm on my dedicated proxmox server

if vps what are your cpu units set by provider.
8 cores, 12gb of ram

docker container logs

root@ubuntu-manga:~# docker logs nginx-proxy-manager
❯ Configuring npm user ...
useradd warning: npm's uid 0 outside of the UID_MIN 1000 and UID_MAX 60000 range.
❯ Configuring npm group ...
❯ Checking paths ...
❯ Setting ownership ...
❯ Dynamic resolvers ...
❯ IPv6 ...
Disabling IPV6 in hosts in: /etc/nginx/conf.d
- /etc/nginx/conf.d/default.conf
- /etc/nginx/conf.d/include/ssl-cache-stream.conf
- /etc/nginx/conf.d/include/proxy.conf
- /etc/nginx/conf.d/include/letsencrypt-acme-challenge.conf
- /etc/nginx/conf.d/include/ssl-ciphers.conf
- /etc/nginx/conf.d/include/ssl-cache.conf
- /etc/nginx/conf.d/include/force-ssl.conf
- /etc/nginx/conf.d/include/block-exploits.conf
- /etc/nginx/conf.d/include/ip_ranges.conf
- /etc/nginx/conf.d/include/assets.conf
- /etc/nginx/conf.d/include/log.conf
- /etc/nginx/conf.d/include/resolvers.conf
- /etc/nginx/conf.d/production.conf
Disabling IPV6 in hosts in: /data/nginx
- /data/nginx/proxy_host/11.conf
- /data/nginx/proxy_host/5.conf
- /data/nginx/proxy_host/8.conf
- /data/nginx/proxy_host/1.conf
- /data/nginx/proxy_host/15.conf
- /data/nginx/proxy_host/9.conf
- /data/nginx/proxy_host/13.conf
- /data/nginx/proxy_host/7.conf
- /data/nginx/proxy_host/3.conf
- /data/nginx/proxy_host/10.conf
- /data/nginx/proxy_host/2.conf
- /data/nginx/proxy_host/4.conf
- /data/nginx/proxy_host/12.conf
- /data/nginx/proxy_host/6.conf
❯ Docker secrets ...

-------------------------------------
 _   _ ____  __  __
| \ | |  _ \|  \/  |
|  \| | |_) | |\/| |
| |\  |  __/| |  | |
|_| \_|_|   |_|  |_|
-------------------------------------
User:  npm PUID:0 ID:0 GROUP:0
Group: npm PGID:0 ID:0
-------------------------------------

❯ Starting nginx ...
❯ Starting backend ...
[5/2/2025] [11:25:01 PM] [Global   ] › ℹ  info      Using Sqlite: /data/database.sqlite
[5/2/2025] [11:25:02 PM] [Migrate  ] › ℹ  info      Current database version: none
[5/2/2025] [11:25:02 PM] [Setup    ] › ℹ  info      Logrotate Timer initialized
[5/2/2025] [11:25:02 PM] [Global   ] › ⬤  debug     CMD: logrotate /etc/logrotate.d/nginx-proxy-manager
[5/2/2025] [11:25:02 PM] [Setup    ] › ℹ  info      Logrotate completed.
[5/2/2025] [11:25:02 PM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[5/2/2025] [11:25:02 PM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[5/2/2025] [11:25:02 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[5/2/2025] [11:25:02 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[5/2/2025] [11:25:02 PM] [SSL      ] › ℹ  info      Let's Encrypt Renewal Timer initialized
[5/2/2025] [11:25:02 PM] [SSL      ] › ℹ  info      Renewing SSL certs expiring within 30 days ...
[5/2/2025] [11:25:02 PM] [IP Ranges] › ℹ  info      IP Ranges Renewal Timer initialized
[5/2/2025] [11:25:02 PM] [Global   ] › ℹ  info      Backend PID 180 listening on port 3000 ...
[5/2/2025] [11:25:02 PM] [SSL      ] › ℹ  info      Completed SSL cert renew process
root@ubuntu-manga:~#

nginx error logs

Image

nginx -T output

nginx t logs.txt

@theraw
Copy link
Contributor

theraw commented May 4, 2025

try tail -f /data/logs/*.log to check amount of requests, maybe you have too much traffic

@javito1081
Copy link
Author

try tail -f /data/logs/*.log to check amount of requests, maybe you have too much traffic

my requests r actually low, but i must post an update, last night i increase the ram on my vm to 16gb, as of now all my issues r gone, ill keep monitoring the situation until tomorrow b4 closing this, but if this was the solution, i hope it works for others as well, i wasnt aware NPM could become so ram hungry lol

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants