[Support]: Lowering CPU usage #11839
-
Describe the problem you are havingSo I was checking out CPU usage on my Unraid server cause I noticed it being unusually high. While this was not a significant consumer of my CPU usage it is drawing around 7-15%. Anyone got any ideas? Version0.13.2-6476F8A Frigate config filemqtt:
host: 192.168.x.xxx # <---- same mqtt broker that home assistant uses
port: 1883
user: mqtt-user
password: mqtt-user
detectors:
coral:
type: edgetpu
device: usb
go2rtc:
streams:
doorbell_cam:
- "ffmpeg:http:https://192.168.x.xxx/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=xxxxx&password=xxxxx#video=copy#audio=copy#audio=opus"
- rtsp:https://reolink_ip/Preview_01_sub
doorbell_cam_sub:
- "ffmpeg:http:https://192.168.x.xxx/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=xxxxx&password=xxxxx"
audio:
# Optional: Enable audio events (default: shown below)
enabled: True
# Optional: Configure the amount of seconds without detected audio to end the event (default: shown below)
max_not_heard: 30
# Optional: Configure the min rms volume required to run audio detection (default: shown below)
# As a rule of thumb:
# - 200 - high sensitivity
# - 500 - medium sensitivity
# - 1000 - low sensitivity
min_volume: 500
# Optional: Types of audio to listen for (default: shown below)
listen:
- bark
- fire_alarm
- scream
- speech
- yell
# Optional: Filters to configure detection.
filters:
# Label that matches label in listen config.
speech:
# Minimum score that triggers an audio event (default: shown below)
threshold: 0.8
objects:
# Optional: list of objects to track from labelmap.txt (default: shown below)
track:
- person
- face
- license_plate
- dog
- cat
- amazon
- fedex
- ups
- package
- motorcycle
#record:
#enabled: True
#retain:
#days: 7
#mode: motion
#events:
#retain:
#default: 30
#mode: motion
#snapshots:
#enabled: True
#retain:
#default: 30
cameras:
doorbell_cam:
ffmpeg:
inputs:
- path: rtsp:https://admin:[email protected]:xxx/h264Preview_01_main
input_args: preset-rtsp-restream
roles:
- audio
- record
- detect
#- path: rtsp:https://admin:[email protected]:554/h264Preview_01_sub
# input_args: preset-rtsp-restream
# roles:
# - detect
webui_url: "https://192.168.x.xxx/" Relevant log outputs6-rc: info: service frigate-log successfully stopped
s6-rc: info: service go2rtc successfully stopped
s6-rc: info: service go2rtc-log: stopping
s6-rc: info: service go2rtc-log successfully stopped
s6-rc: info: service log-prepare: stopping
s6-rc: info: service s6rc-fdholder: stopping
s6-rc: info: service log-prepare successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service s6rc-fdholder successfully stopped
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-fdholder: starting
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service s6rc-fdholder successfully started
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service log-prepare: starting
s6-rc: info: service log-prepare successfully started
s6-rc: info: service nginx-log: starting
s6-rc: info: service go2rtc-log: starting
s6-rc: info: service frigate-log: starting
s6-rc: info: service go2rtc-log successfully started
s6-rc: info: service go2rtc: starting
s6-rc: info: service nginx-log successfully started
s6-rc: info: service frigate-log successfully started
s6-rc: info: service go2rtc successfully started
s6-rc: info: service go2rtc-healthcheck: starting
s6-rc: info: service frigate: starting
s6-rc: info: service go2rtc-healthcheck successfully started
s6-rc: info: service frigate successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
s6-rc: info: service go2rtc-healthcheck: stopping
s6-rc: info: service go2rtc-healthcheck successfully stopped
s6-rc: info: service nginx successfully stopped
s6-rc: info: service nginx-log: stopping
s6-rc: info: service frigate: stopping
s6-rc: info: service nginx-log successfully stopped
2024-06-09 20:20:26.497122885 [INFO] The go2rtc service exited with code 0 (by signal 0)
2024-06-09 20:20:56.669887651 [INFO] Preparing Frigate...
2024-06-09 20:20:56.670277298 [INFO] Starting NGINX...
2024-06-09 20:20:56.673900810 [INFO] Preparing new go2rtc config...
2024-06-09 20:20:56.680363439 [INFO] Starting Frigate...
2024-06-09 20:20:56.830913398 [INFO] Starting go2rtc...
2024-06-09 20:20:56.905744076 20:20:56.905 INF go2rtc version 1.8.4 linux/amd64
2024-06-09 20:20:56.905968271 20:20:56.905 INF [rtsp] listen addr=:8554
2024-06-09 20:20:56.905998418 20:20:56.905 INF [api] listen addr=:1984
2024-06-09 20:20:56.906034672 20:20:56.906 INF [webrtc] listen addr=:8555
2024-06-09 20:20:57.392694804 [2024-06-09 20:20:57] frigate.app INFO : Starting Frigate (0.13.2-6476f8a)
2024-06-09 20:20:59.342777437 [2024-06-09 20:20:59] peewee_migrate.logs INFO : Starting migrations
2024-06-09 20:20:59.475203459 [2024-06-09 20:20:59] peewee_migrate.logs INFO : There is nothing to migrate
2024-06-09 20:20:59.875844467 [2024-06-09 20:20:59] frigate.app INFO : Recording process started: 597
2024-06-09 20:20:59.876937936 [2024-06-09 20:20:59] frigate.app INFO : go2rtc process pid: 89
2024-06-09 20:20:59.890061801 [2024-06-09 20:20:59] detector.coral INFO : Starting detection process: 607
2024-06-09 20:21:02.899904077 [2024-06-09 20:20:59] frigate.app INFO : Output process started: 609
2024-06-09 20:21:02.900168327 [2024-06-09 20:20:59] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb
2024-06-09 20:21:02.911885010 [2024-06-09 20:20:59] frigate.app INFO : Camera processor started for doorbell_cam: 617
2024-06-09 20:21:02.912027340 [2024-06-09 20:21:02] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found
2024-06-09 20:21:02.912131139 [2024-06-09 20:20:59] frigate.app INFO : Capture process started for doorbell_cam: 619
2024-06-09 20:21:02.912223108 [2024-06-09 20:20:59] frigate.app INFO : Audio process started: 627
2024-06-09 20:21:06.670190879 [INFO] Starting go2rtc healthcheck service...
2024-06-09 20:22:01.871524993 [INFO] The go2rtc-healthcheck service exited with code 256 (by signal 15)
2024-06-09 20:22:01.900555156 [INFO] Service NGINX exited with code 0 (by signal 0)
2024-06-09 20:22:01.902153097 [2024-06-09 20:22:01] detector.coral INFO : Signal to exit detection process...
2024-06-09 20:22:01.902228505 [2024-06-09 20:22:01] frigate.app INFO : Stopping...
2024-06-09 20:22:01.902282215 [2024-06-09 20:22:01] root INFO : Waiting for detection process to exit gracefully...
2024-06-09 20:22:01.902344425 [2024-06-09 20:22:01] frigate.ptz.autotrack INFO : Exiting autotracker...
2024-06-09 20:22:01.902353423 [2024-06-09 20:22:01] frigate.watchdog INFO : Exiting watchdog...
2024-06-09 20:22:01.902383465 [2024-06-09 20:22:01] frigate.events.cleanup INFO : Exiting event cleanup...
2024-06-09 20:22:01.902678689 [2024-06-09 20:22:01] frigate.stats INFO : Exiting stats emitter...
2024-06-09 20:22:01.902757900 [2024-06-09 20:22:01] frigate.record.cleanup INFO : Exiting recording cleanup...
2024-06-09 20:22:01.902797897 [2024-06-09 20:22:01] frigate.storage INFO : Exiting storage maintainer...
2024-06-09 20:22:02.442456191 [2024-06-09 20:22:02] frigate.object_processing INFO : Exiting object processor...
2024-06-09 20:22:02.669214579 [2024-06-09 20:22:02] frigate.events.maintainer INFO : Exiting event processor...
2024-06-09 20:22:02.754890582 [2024-06-09 20:22:02] detector.coral INFO : Exited detection process...
2024-06-09 20:22:02.761785416 [2024-06-09 20:22:02] root INFO : Detection process has exited...
2024-06-09 20:22:02.940937195 [2024-06-09 20:22:02] frigate.comms.ws INFO : Exiting websocket client...
2024-06-09 20:22:03.450042164 [2024-06-09 20:22:03] peewee.sqliteq INFO : writer received shutdown request, exiting.
2024-06-09 20:22:03.451219027 [2024-06-09 20:22:03] frigate.record.maintainer INFO : Exiting recording maintenance...
s6-rc: info: service s6rc-fdholder: starting
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service s6rc-fdholder successfully started
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service log-prepare: starting
s6-rc: info: service log-prepare successfully started
s6-rc: info: service nginx-log: starting
s6-rc: info: service go2rtc-log: starting
s6-rc: info: service frigate-log: starting
s6-rc: info: service nginx-log successfully started
s6-rc: info: service go2rtc-log successfully started
s6-rc: info: service go2rtc: starting
s6-rc: info: service frigate-log successfully started
s6-rc: info: service go2rtc successfully started
s6-rc: info: service go2rtc-healthcheck: starting
s6-rc: info: service frigate: starting
s6-rc: info: service go2rtc-healthcheck successfully started
s6-rc: info: service frigate successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
2024-06-09 20:22:41.465788169 [INFO] Preparing Frigate...
2024-06-09 20:22:41.466483621 [INFO] Starting NGINX...
s6-rc: info: service legacy-services successfully started
2024-06-09 20:22:41.469443118 [INFO] Preparing new go2rtc config...
2024-06-09 20:22:41.474461066 [INFO] Starting Frigate...
2024-06-09 20:22:41.675467200 [INFO] Starting go2rtc...
2024-06-09 20:22:41.743271315 20:22:41.743 INF go2rtc version 1.8.4 linux/amd64
2024-06-09 20:22:41.743530285 20:22:41.743 INF [api] listen addr=:1984
2024-06-09 20:22:41.743538583 20:22:41.743 INF [rtsp] listen addr=:8554
2024-06-09 20:22:41.743624301 20:22:41.743 INF [webrtc] listen addr=:8555
2024-06-09 20:22:42.235257987 [2024-06-09 20:22:42] frigate.app INFO : Starting Frigate (0.13.2-6476f8a)
2024-06-09 20:22:44.322864347 [2024-06-09 20:22:44] peewee_migrate.logs INFO : Starting migrations
2024-06-09 20:22:44.326978512 [2024-06-09 20:22:44] peewee_migrate.logs INFO : There is nothing to migrate
2024-06-09 20:22:44.345812536 2024/06/09 20:22:44 [error] 145#145: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.30.3, server: , request: "GET /api/stats HTTP/1.1", upstream: "http:https://127.0.0.1:5001stats", host: "192.168.x.xxx:5000"
2024-06-09 20:22:44.917530857 [2024-06-09 20:22:44] frigate.app INFO : Recording process started: 596
2024-06-09 20:22:44.919210009 [2024-06-09 20:22:44] frigate.app INFO : go2rtc process pid: 89
2024-06-09 20:22:44.938012028 [2024-06-09 20:22:44] detector.coral INFO : Starting detection process: 606
2024-06-09 20:22:47.945624991 [2024-06-09 20:22:44] frigate.app INFO : Output process started: 608
2024-06-09 20:22:47.947724973 [2024-06-09 20:22:44] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb
2024-06-09 20:22:47.947774786 [2024-06-09 20:22:44] frigate.app INFO : Camera processor started for doorbell_cam: 616
2024-06-09 20:22:47.947802136 [2024-06-09 20:22:47] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found
2024-06-09 20:22:47.947829793 [2024-06-09 20:22:44] frigate.app INFO : Capture process started for doorbell_cam: 617
2024-06-09 20:22:47.947854651 [2024-06-09 20:22:44] frigate.app INFO : Audio process started: 621
2024-06-09 20:22:51.466154617 [INFO] Starting go2rtc healthcheck service...
2024-06-09 20:23:48.618767064 192.168.x.xxx - - [09/Jun/2024:20:23:48 -0400] "GET / HTTP/1.1" 200 6636 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36" "-"
2024-06-09 20:23:48.752057767 192.168.x.xxx - - [09/Jun/2024:20:23:48 -0400] "GET /api/config HTTP/1.1" 200 9211 "http:https://192.168.x.xxx:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36" "-"
2024-06-09 20:23:48.872633303 192.168.x.xxx - - [09/Jun/2024:20:23:48 -0400] "GET /api/doorbell_cam/latest.jpg?h=100 HTTP/1.1" 200 3971 "http:https://192.168.x.xxx:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36" "-"
2024-06-09 20:23:48.928589580 192.168.x.xxx - - [09/Jun/2024:20:23:48 -0400] "GET /api/doorbell_cam/latest.jpg?h=462 HTTP/1.1" 200 50854 "http:https://192.168.x.xxx:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36" "-" FFprobe output from your camera# ffprobe 192.168.x.xxx
ffprobe version n5.1-2-g915ef932a3-20220731 Copyright (c) 2007-2022 the FFmpeg developers
built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu- --arch=x86_64 --target-os=linux --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libpulse --enable-libvmaf --enable-libxcb --enable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-mbedtls --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --disable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags=-pie --extra-libs='-ldl -lgomp' --extra-version=20220731
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
192.168.x.xxx: No such file or directory Frigate statsNo response Operating systemUNRAID Install methodDocker Compose Coral versionUSB Network connectionWired Camera make and modelREOLINK Doorbell WiFi Camera Any other information that may be helpfulNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Your CPU usage of 7-15% doesn't seem unreasonable. However, you're actually pulling two streams from your camera unnecessarily - you're using go2rtc to connect to your camera, but then you're not using the go2rtc URL in your Search the docs for "reduce connections to camera" and you'll see how to update your config to use go2rtc correctly. You could also configure hardware acceleration, which would also reduce your CPU usage. Search the docs for "hardware acceleration". |
Beta Was this translation helpful? Give feedback.
use
hwaccel_args: preset-vaapi
instead ofhwaccel_args: preset-intel-qsv-h264