Skip to content

High CPU usage while IDLing #1555

@vgdh

Description

@vgdh

What installation are you running?

Production (netalertx) 📦

Is there an existing issue for this?

The issue occurs in the following browsers. Select at least 2.

  • Firefox
  • Chrome
  • Edge
  • Safari (unsupported) - PRs welcome
  • N/A - This is an issue with the backend

Current Behavior

High CPU usage

Image

Expected Behavior

near-zero usage.
Currently, for example, my OPNsense VM uses the same amount of CPU (under mid network load)

Steps To Reproduce

No response

Relevant app.conf settings

docker-compose.yml

services:
  netalertx:
    container_name: netalertx
    hostname: Net-Alert-X-IR
    image: ghcr.io/jokob-sk/netalertx:latest
    restart: unless-stopped

    network_mode: "host"

    read_only: true                                 # Make the container filesystem read-only
    cap_drop:                                       # Drop all capabilities for enhanced security
      - ALL
    cap_add:                                        # Add only the necessary capabilities
      - NET_ADMIN                                   # Required for ARP scanning
      - NET_RAW                                     # Required for raw socket operations
      - NET_BIND_SERVICE                            # Required to bind to privileged ports (nbtscan)
      - CHOWN                                       # Required for root-entrypoint to chown /data + /tmp before dropping privileges
      - SETUID                                      # Required for root-entrypoint to switch to non-root user
      - SETGID                                      # Required for root-entrypoint to switch to non-root group

    volumes:
      - ./data:/data
      - /etc/localtime:/etc/localtime:ro

    environment:
      - PORT=20211
      - LISTEN_ADDR=0.0.0.0                   # Listen for connections on all interfaces
      - GRAPHQL_PORT=20212                   # GraphQL API port (passed into APP_CONF_OVERRIDE at runtime)

    tmpfs:
      # All writable runtime state resides under /tmp; comment out to persist logs between restarts
      - "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"


    # Resource limits to prevent resource exhaustion
    mem_limit: 2048m            # Maximum memory usage
    mem_reservation: 1024m      # Soft memory limit
    cpu_shares: 512             # Relative CPU weight for CPU contention scenarios
    pids_limit: 512             # Limit the number of processes/threads to prevent fork bombs
    logging:
      options:
        max-size: "10m"         # Rotate log files after they reach 10MB
        max-file: "3"           # Keep a maximum of 3 log files

Debug or Trace enabled

  • I have read and followed the steps in the wiki link above and provided the required debug logs and the log section covers the time when the issue occurs.

Relevant app.log section

Docker Logs

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Waiting for reply⏳Waiting for the original poster to respond, or discussion in progress.bug 🐛Something isn't workinghelp wanted 🆘Extra attention is neededlow priority ⬇️This is a low priority thing. Good idea, but not sure when I get to it. Open to PRs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions