CPU usage when idle

I have just started using Deepstack, and is running the latest version of docker image deepquestai/deepstack:latest (CPU version).

I noticed that there is a constant CPU utilization. The idle CPU usage is about 3-8%. That is pretty much for a system handling 2-3 request per day. On my server running 10 containers Deepstack alone is using 80% of all CPU time.

The threads using constant CPU is:

  • /app/intelligence.py
  • redis-server

I am using Deepstack with Home Assistant component to detect persons.

Docker configuration:

    container_name: deepstack
    image: deepquestai/deepstack
      PGID: 1000
      PUID: 1000
      TZ: Europe/Stockholm
      VERSION: latest
      - "5000:5000"
    restart: unless-stopped
      - /data/docker/deepstack:/datastore

Hello @Fyz, can you please detail your server specs?

Hello John!

Host system: Ubuntu 18.04.3 LTS // Docker Engine Community
Processor: Core i7-3770
Memory: 12 GB
Storage: SSD in mirror

Docker has been running for 20 hours and this is the htop stats:
20:03.89 python3 /app/intelligence.py (process top #1)
10:57.07 redis-server *:6379 (process top #4)

I have noticed this to … I have set the SLEEP_TIME to .25 and have the same issue

I installed DeepStack gpu docker on Ubuntu 20. After making sure nothing is making any requests to Deepstack, I noticed that it is constantly using about 20% CPU.

This is the output of docker stats

CONTAINER ID   NAME        CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O       PIDS
753f776da135   deepstack   23.67%    3.992GiB / 62.74GiB   6.36%     1.83MB / 58.8kB   156kB / 4.1kB   40

This is on a 6 core / 12 threads computer with 64GB ram - it’s irrelevant though, why is deepstack keep using up cpu even when idle like this?

I monitored the logs, and confirmed that there are no requests being served.

docker image: deepquestai/deepstack:gpu-2021.09.1
I cannot use the latest gpu-2022-01.1 image - the face recognition broke on that

Output of top, note all the top processes belong to deepstack. Nothing else is running on the host server because I’ve stopped all other docker containers, and this server is not running any other services. It’s not a publicly accessible server, just on a LAN 192.168.x.x, with no open ports to the outside world.

top - 22:04:31 up 5 days, 10:03,  4 users,  load average: 0.06, 0.19, 0.39
Tasks: 522 total,   1 running, 520 sleeping,   0 stopped,   1 zombie
%Cpu(s):  1.1 us,  0.6 sy,  0.0 ni, 98.2 id,  0.0 wa,  0.0 hi,  0.1 si,  0.0 st
MiB Mem :  64248.2 total,  11624.6 free,  19047.4 used,  33576.2 buff/cache
MiB Swap:   8192.0 total,   8181.0 free,     11.0 used.  44464.1 avail Mem

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
1518006 root      20   0   10.0g   2.3g 377760 S   7.6   3.7   0:52.30 python3
1518001 root      20   0 9906.0m   2.3g 390100 S   7.3   3.7   0:52.43 python3
1517934 root      20   0   37220   3568   2532 S   3.6   0.0   0:27.15 redis-server
1518005 root      20   0 2421344  93760   7976 S   2.0   0.1   0:11.30 python3
1 Like

Hi everyone, apologies to late response on this issue.

The CPU usage of DeepStack when idle is as a result of the running processes that are waiting to receive requests, and these are

  • the Redis service that serve as data exchange between the Web service layer and the Intelligence layer
  • The Intelligence layer
    - Each API you enable has a running Python service waiting to receive and process the input for inference