Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[BUG] CPU suddently spikes #122

Open
1 task done
yurividal opened this issue Nov 25, 2024 · 7 comments
Open
1 task done

[BUG] CPU suddently spikes #122

yurividal opened this issue Nov 25, 2024 · 7 comments

Comments

@yurividal
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Every couple of days, this container suddenly spikes on CPU usage, for no apparent reason. The logs don't show anything.

image

Restarting te container is the only way to fix this and bring CPU usage back to normal.

Is there a way to make it more verbose logging, so that I can try to understand what the container is doing when the CPU spikes?!

As mentioned, nothing shows on the container logs, nor on the Unifi Application Logs.

Expected Behavior

CPU Usage should remain stable, unless on periods of database cleanup, or upgrades.
Logs should be more detailed.

Steps To Reproduce

Run container for a few days, observe CPU usage.

Environment

- OS:
- How docker service was installed:

CPU architecture

x86-64

Docker creation

services:
  unifi-network-application:
    image: lscr.io/linuxserver/unifi-network-application:latest
    container_name: unifi-network-application
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - MONGO_USER=unifi
      - MONGO_PASS=<redacted>
      - MONGO_HOST=unifi-db
      - MONGO_PORT=27017
      - MONGO_DBNAME=unifi-db
      - MONGO_TLS=false
    volumes:
      - ./data:/config
    restart: always
    mac_address: <redacted>
    networks:
      homelab-lan:
        ipv4_address: <redacted>
      unifi-controller:
      homelab-internal:
    depends_on:
      - unifi-db

  unifi-db:
    image: docker.io/mongo:4.4
    container_name: unifi-db
    volumes:
      - ./database/data:/data/db
      - ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
    restart: always
    networks:
      - unifi-controller

networks:
  homelab-lan:
    external: true
  unifi-controller:
    driver: bridge
  homelab-internal:
    external: true

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: 8.6.9-ls69
Build-date: 2024-11-12T17:34:23+00:00
───────────────────────────────────────
    
[custom-init] No custom files found, skipping...
[ls.io-init] done.
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: destroy called
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: 8.6.9-ls69
Build-date: 2024-11-12T17:34:23+00:00
───────────────────────────────────────
    
[custom-init] No custom files found, skipping...
[ls.io-init] done.
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@yurividal
Copy link
Author

WAN Usage also seemed to have spiked at the same time. So, seems like the container was downloading something?

image

@j0nnymoe
Copy link
Member

Have you checked what process is causing that usage within the container?

@yurividal
Copy link
Author

yurividal commented Nov 25, 2024

Have you checked what process is causing that usage within the container?

It didnt occur to me to do that.
would a simple "top" inside the container shell give me that?

I'll have to wait until the next time it happens, might be a few days

@yurividal
Copy link
Author

@j0nnymoe it did it again, at precisely the same time today. 11:09 AM.

top, from inside the container shows java as being the process using 100% of the CPU

image

@yurividal
Copy link
Author

yurividal commented Nov 26, 2024

This is the full command, and it runs as user abc:

java -Xmx1024M -Dlog4j2.formatMsgNoLookups=true -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dapple.awt.UIElement=true -XX:+UseParallelGC -XX:+ExitOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/sun.security.util=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED -jar /usr/lib/unifi/lib/ace.jar start

@yurividal
Copy link
Author

when digging deeper into the tree, seems to be related to "schedule-analyt" ?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Issues
Development

No branches or pull requests

2 participants