sissbruecker / linkding

Self-hosted bookmark manager that is designed be to be minimal, fast, and easy to set up using Docker.
MIT License
5.32k stars 261 forks source link

High cpu utilisation - via python manage.py run huey -f #723

Open DD5HT opened 2 months ago

DD5HT commented 2 months ago

I noticed that: python manage.py run huey -f is triggered regularly, creating a high CPU utilization on my machine, is there a simple way to prevent it?

See this screenshot, the previous utilization corresponds to, around 10 services, including grafana, victoria metrics, home assistant and a few other services the new increased utilisation is when running linkding. Screenshot 2024-05-04 at 17-22-19 Node Exporter Full - Dashboards - Grafana

My config:

 linkding:
    container_name: linkding
    image: sissbruecker/linkding:1.30.0-alpine
    ports:
      - "9090:9090"
    volumes:
      - "${DATA_DIR}/linkding:/etc/linkding/data"
    restart: unless-stopped
    environment:
      - LD_CSRF_TRUSTED_ORIGINS=domain
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.linkding.rule=Host(`domain`)"
      - "traefik.http.routers.linkding.entrypoints=web"
    ulimits:
      nofile:
        soft: 1048576
        hard: 1048576
stonebyte commented 1 month ago

I noticed the same. Any advice how to fix it would be welcome.

sissbruecker commented 2 weeks ago

huey is the background task processor, which is used for loading favicons, creating IA or HTML snapshots and some other things in the background. You can disable it completely using this option, but then all the mentioned features won't work either.

You could also check background_tasks.log in the container and see if it's actually doing something. The task processor is triggered about every 10 seconds from what I remember, which is when it checks for new tasks or whether to schedule something. Though it shouldn't consume that much resources just for that.

Doing a quick check, linkding uses less than 1% CPU on my Raspberry Pi 3 according to docker stats. So sounds like there is some abnormal behavior on your side.