High Idle CPU usage
Describe the bug This is something I've noticed recently. It seems that bazarr when idling causes my CPU to spike constantly. I've checked the logs and noticed some ffprobe errors for a bluray video file. I've switched to mediainfo after that and these errors are gone now but the CPU usage is still abnormal for an idling app.
name: downloaders
x-common-labels: &common-labels
com.centurylinklabs.watchtower.enable: "true"
x-cert-label: &cert-label
server.custom.cert: "true"
x-common: &common
labels: *common-labels
extra_hosts:
- "host.docker.internal:host-gateway"
- "${LAXSS_PLEX_DOMAIN}:host-gateway"
- "${LAXSS_DOMAIN}:host-gateway"
- "${LAXSS_DOWNLOAD_STATION_DOMAIN}:host-gateway"
restart: unless-stopped
networks:
- downloaders_network
x-common-env: &common-env
TZ: ${TZ}
x-linuxserver-arr-mods-env: &linuxserver-arr-mods-env
DOCKER_MODS: linuxserver/mods:universal-package-install
INSTALL_PACKAGES: openssl
x-media-volume: &media-volume ${LAXSS_MEDIA_PATH}:/media
x-modcache: &modcache ${LAXSS_MODCACHE_PATH}:/modcache
x-ssl-pfx: &ssl-pfx ${LAXSS_PFX_CERT_PATH}:${CONTAINER_PFX_PATH}:ro
x-ssl-cert: &ssl-cert ${LAXSS_SSL_CERT_PATH}:${CONTAINER_SSL_CERT_PATH}:ro
x-ssl-key: &ssl-key ${LAXSS_PRIVATE_KEY_PATH}:${CONTAINER_PRIVATE_KEY_PATH}:ro
services:
postgres:
<<: *common
image: postgres:17
container_name: downloaders_postgres
command: postgres -c 'max_connections=200'
shm_size: 512m
labels:
- wud.watch=false
- com.centurylinklabs.watchtower.enable=false
healthcheck:
test: ["CMD-SHELL", "/pg_healthcheck.sh"]
start_period: 10s
interval: 30s
timeout: 20s
retries: 3
volumes:
- postgres-data:/var/lib/postgresql/data
- /volume1/docker/docker-scripts/init-multiple-databases.sh:/docker-entrypoint-initdb.d/init-multiple-databases.sh:ro
- /volume1/docker/docker-scripts/pg_healthcheck.sh:/pg_healthcheck.sh:ro
environment:
POSTGRES_MULTIPLE_DATABASES: ${POSTGRES_MULTIPLE_DATABASES}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
<<: *common-env
bazarr:
<<: *common
image: lscr.io/linuxserver/bazarr:latest
container_name: bazarr
healthcheck:
test: |
curl -ILfs --max-time 3 http://localhost:${BAZARR_PORT}/system/ping > /dev/null \
|| exit 1
start_period: 10s
interval: 30s
timeout: 20s
retries: 3
depends_on:
postgres:
condition: service_healthy
radarr:
condition: service_healthy
sonarr:
condition: service_healthy
environment:
PUID: ${BAZARR_PUID}
PGID: ${DOWNLOADERS_PGID}
POSTGRES_ENABLED: true
POSTGRES_HOST: ${POSTGRES_HOST}
POSTGRES_PORT: ${POSTGRES_PORT}
POSTGRES_DATABASE: ${BAZARR_MAINDB_NAME}
POSTGRES_USERNAME: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
WEBUI_PORTS: ${BAZARR_PORT}/tcp,${BAZARR_PORT}/udp
<<: *common-env
volumes:
- ${CONFIG_BASE_FOLDER}/bazarr/config:/config
- *media-volume
- *modcache
ports:
- ${BAZARR_PORT}:${BAZARR_PORT}
To Reproduce Steps to reproduce the behavior:
- Deploy the bazarr with a similar compose
- Track the CPU usage
Expected behavior When idling, bazarr should not consume too much system resources.
Screenshots
Software (please complete the following information):
- Bazarr: 1.5.2
- Radarr version 5.26.2.10099
- Sonarr version 4.0.15.2941
- OS: DSM 7.2.2
Additional context Add any other context about the problem here.
We'll need a debug log to see what's happening during the high CPU usage period.
I've restarted the container and let it run for about half an hour. During that time, the CPU usage was high all the time. The debug logs are attached.
There's absolutely nothing happening within Bazarr itself (except from logging some websocket messages from Sonarr/Radarr).
Can you verify if you're able to reproduce with lscr.io/linuxserver/bazarr:development ?
Tried the development image, it is still high.
Have you confirmed that the Bazarr python process is responsible for this high cpu usage?
I'll go over your log again but I haven't see anything suspicious.
Could it be because of mediainfo? Could you try with ffprobe instead?
I was using ffprobe initially but had to switch to mediainfo, it was failing to read a couple of Blu-ray releases. But I remember the cpu was even higher with ffprobe.
I dont have much worth to add here. Issue persists for me as well. Running linuxserver images on ubuntu server 24.04. High CPU usage in idle is constant.
For me thats super critical issue, running Bazarr increase my server temperature by 30C. Under normal load its avg 70C, with Bazarr running its core reaches 100*C. I would love to help debug this if possible, but I dont see anything except weird SignalR behaviour while exiting Bazarr. Like its blocking Bazarr process all the time.
Maybe those sleeps in signalR queues too many CPU tasks and instead of constant 2% cpu utilization it peaks after every sleep for 100%?
Other than checking your config.yaml for something that could be causing this, there's not much I can do. I'm unable to reproduce this issue and Bazarr is averaging to 00.1% CPU usage for years now.
WEBUI_PORTS in your environment variable isn't a thing. LSIO doesn't document this variable and we don't use it anyway. Is there other stuff like that that you've been adding?
Are you both using postgres database?
Nothing uncommon except postgres - yes, im using it for bazarr (and other arrs too).
Now when looking at compose, I needed to add mem_limit: 4g because of memory leak consuming 64GB of ram by Bazarr after a while. 1.5.3-development is just try to fix it, originally it happened on 1.5.2.
bazarr:
image: lscr.io/linuxserver/bazarr:1.5.3-development
container_name: bazarr
mem_limit: 4g
logging:
driver: loki
options:
loki-url: http://xxx:3100/loki/api/v1/push
mode: non-blocking
max-buffer-size: 4m
loki-retries: "3"
volumes:
- /var/lib/bazarr:/config
- xxx:/data/media/movies
- xxxs:/data/media/tv
environment:
- TZ=Europe/xxx
- PUID=123
- PGID=456
networks:
- traefik_default
- default
Now when looking at compose, I needed to add
mem_limit: 4gbecause of memory leak consuming 64GB of ram by Bazarr after a while.
Let me guess: you're using the subtitles synchronization feature? I've seen really strange issues when container memory is limited and ffsubsync must load the whole audio track in memory to align speech segments with subtitles track. Often the audio track of BR RIP take memory that what's available and the process just crash.
Subtitles synchronization and embedded subtitles extraction are ressources intensive tasks. Try to disable that if you're facing recurring CPU and memory issues.
It was short, 20 minute test, but everything seems fine.
If that really helped - its bit weird. It was the python bazarr process that caused cpu peaks, not ffmpeg. When bazarr runs something external it runs another process with different cmd, but peaking process was main one without any additional params in cmd during idle.
Anyway - I will test this for longer period and thank you so much for tip. I can barely notice idle bazarr activity with sub sync disabled.
@Preclowski let see if it's really fixed and we'll see if we can catch it somehow. Let me know.
@Preclowski let see if it's really fixed and we'll see if we can catch it somehow. Let me know.
It helped. Previously it was high cpu since bootstrap, now its over 3h and everything is perfectly calm.
@Salvora are you using subtitle sync?
No, I dont use those sync features but only use postgres as database.
It back, after all day. Last log (debug disabled) from 5 hours ago. Bazarr is doing nothing and consumes 100% CPU. Result of top inside container.
BAZARR Finished searching for missing Series Subtitles. Check History for more information.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
343 abc 20 0 1148220 291972 36224 S 83.0 0.4 229:17.68 python3
17 root 20 0 220 0 0 S 0.0 0.0 0:00.00 s6-supervise
1 root 20 0 440 0 0 S 0.0 0.0 0:00.03 s6-svscan
36 root 20 0 220 0 0 S 0.0 0.0 0:00.00 s6-supervise
19 root 20 0 208 0 0 S 0.0 0.0 0:00.00 s6-linux-init-s
38 root 20 0 220 0 0 S 0.0 0.0 0:00.00 s6-supervise
39 root 20 0 220 0 0 S 0.0 0.0 0:00.00 s6-supervise
47 root 20 0 208 0 0 S 0.0 0.0 0:00.00 s6-ipcserverd
37 root 20 0 220 0 0 S 0.0 0.0 0:00.00 s6-supervise
148 root 20 0 1632 768 768 S 0.0 0.0 0:00.53 busybox
149 abc 20 0 13256 10872 4608 S 0.0 0.0 0:03.19 python3
2233 root 20 0 2636 2176 1664 S 0.0 0.0 0:00.02 bash
2246 root 20 0 4104 3072 1280 R 0.0 0.0 0:00.00 top
Hmm... Im using bazarr exporter. I disabled it to verify if that may be issue somehow. No more ideas.
Is there a chance that postgres has been restarted and Bazarr may have trouble reconnect to it?
Im positive that my postgres instance is stable. With bazarr its on the same machine so potential network issues also should not be a problem.
Now I see some issue correlation with onedr0p exportarr . When I told you yesterday it started to work properly, exporter was disabled. After confirmation later I reenabled exporter and... some time later It again started to drain CPU. This morning I disabled bazarr exporter and it seems to work fine again. Im not using any kind of backfilling or extended metrics, just standard instance of exporter 2.3.0.
Im going to verify that for some time and I will.l create issue in exportarr repo.
Assuming its actually related to metrics exporter, I just can add that radarr with 2500 movies or sonarr with 7000 episodes doesnt cause any spikes.
Thank you for looking into this
@morpheus65535 I got it. Bazarr is constantly returning 499 errors after 7.9s. Im almost sure its Exportarr asking API for metrics and Bazarr is closing connection before returning response.
Im not sure if Exportarr is making too much requests or timeouts on Bazarr are too short, or maybe both, but 8 seconds of timeout seems unexpected. Maybe increasing it to 30s can solve the issue?
@Salvora may I ask you if you are using Exp0rtarr?
Edit: my metrics are missing episode metrics. I have all the data for movies, but episodes metrics were never fetched. I assume its API endpoint related to episode metrics returning 499 after 8 seconds and burning CPU.
Nope, I am not using it :). My postgres is also in the same stack. I can get inside the container to run some commands for debugging if anyone has any advice about what to check.
@Preclowski exportarr is probably to aggressive and do way too much API call. onedr0p should review this to reduce impact on webserver. I'll follow the issue you've opened with him. Let me know if I miss something where I could help.
Nope, I am not using it :). My postgres is also in the same stack. I can get inside the container to run some commands for debugging if anyone has any advice about what to check.
Can you provide ps -a output from within the container please?
I've seen similar issues for as long as I've used Bazarr. I have limited my docker containers resources because there were times where it was taking out my entire server by maxing out the CPU.
deploy:
resources:
limits:
cpus: '0.2'
memory: 512M
reservations:
cpus: '0.2'
memory: 512M
I setup cadvisor+prometheus+grafana the other day after more unknown botttlenecks in my server and bazarr so far has stood out but because of the resource limits its been held back.
0.2 of my 4 cores means its local 100% is 5% of my host total. And 5% is roughly what I see bazarr hit often.
Last 12 hours of my CPU usage for bazarr
using this data I do see some correlations with the logs.
The 10am-12am(ish) bulk ends abruptly at 12:45.
and the logs show this
2025-08-21 12:06:52,500 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:52,999 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:53,593 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:54,094 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:54,507 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:54,997 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:55,496 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:55,902 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:56,290 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:56,890 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:57,195 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:57,710 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:57,999 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:58,397 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:58,993 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:59,299 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:06:59,707 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:00,104 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:00,707 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:01,102 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:01,694 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:02,097 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:02,505 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:03,097 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:03,491 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:56,103 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:56,600 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:57,105 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:57,720 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:58,299 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:58,898 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:59,206 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:07:59,691 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:08:00,100 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:44,544 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:44,905 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:45,215 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:45,800 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:46,001 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:46,196 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:46,404 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:46,599 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:46,801 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:46,998 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:47,193 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:47,595 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:48,100 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:09:48,603 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error (Path does not exist) trying to get video information for this file: VIDEO_FILE
2025-08-21 12:13:35,151 - root (7f75df22db30) : INFO (get_providers:204) - Using opensubtitlescom again after 10 minutes, (disabled because: AttributeError)
2025-08-21 12:13:40,807 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='api.opensubtitles.com', port=443): Max retries exceeded with url: /api/v1/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75e1a524b0>: Failed to resolve 'api.opensubtitles.com' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:13:50,811 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='api.opensubtitles.com', port=443): Max retries exceeded with url: /api/v1/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75e1a51790>: Failed to resolve 'api.opensubtitles.com' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:14:00,826 - root (7f75df22db30) : INFO (get_providers:408) - Throttling opensubtitlescom for 10 minutes, until 25/08/21 12:24, because of: AttributeError. Exception info: "''NoneType' object has no attribute 'request'' ~ opensubtitlescom.py@584"
2025-08-21 12:14:05,835 - root (7f75df22db30) : INFO (get_providers:476) - Using subf2m again after 10 minutes, (disabled because: ConnectionError)
2025-08-21 12:14:12,602 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /subtitles/searchbytitle?query=SEARCH_TERM(Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75e31ee630>: Failed to resolve 'subf2m.co' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:14:22,607 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /subtitles/searchbytitle?query=SEARCH_TERM(Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75def3af60>: Failed to resolve 'subf2m.co' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:14:32,628 - root (7f75df22db30) : INFO (get_providers:408) - Throttling subf2m for 10 minutes, until 25/08/21 12:24, because of: ConnectionError. Exception info: "'HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /s' ~ subf2m.py@183"
2025-08-21 12:15:07,633 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error ('.scr' is not a valid video extension) trying to get video information for this file: FILE_NAME
2025-08-21 12:15:08,127 - root (7f75df22db30) : ERROR (utils:55) - BAZARR Error ('.scr' is not a valid video extension) trying to get video information for this file: FILE_NAME
2025-08-21 12:24:01,299 - root (7f75df22db30) : INFO (get_providers:204) - Using opensubtitlescom again after 10 minutes, (disabled because: AttributeError)
2025-08-21 12:24:06,999 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='api.opensubtitles.com', port=443): Max retries exceeded with url: /api/v1/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75e1a525d0>: Failed to resolve 'api.opensubtitles.com' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:24:17,002 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='api.opensubtitles.com', port=443): Max retries exceeded with url: /api/v1/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75e1a2d040>: Failed to resolve 'api.opensubtitles.com' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:24:27,019 - root (7f75df22db30) : INFO (get_providers:408) - Throttling opensubtitlescom for 10 minutes, until 25/08/21 12:34, because of: AttributeError. Exception info: "''NoneType' object has no attribute 'request'' ~ opensubtitlescom.py@584"
2025-08-21 12:24:33,011 - root (7f75df22db30) : INFO (get_providers:204) - Using subf2m again after 10 minutes, (disabled because: ConnectionError)
2025-08-21 12:24:39,794 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /subtitles/searchbytitle?query=SEARCH_TERM(Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75deb5e2a0>: Failed to resolve 'subf2m.co' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:24:49,799 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /subtitles/searchbytitle?query=SEARCH_TERM(Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75deb5d160>: Failed to resolve 'subf2m.co' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:24:59,889 - root (7f75df22db30) : INFO (get_providers:408) - Throttling subf2m for 10 minutes, until 25/08/21 12:34, because of: ConnectionError. Exception info: "'HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /s' ~ subf2m.py@183"
2025-08-21 12:34:27,302 - root (7f75df22db30) : INFO (get_providers:204) - Using opensubtitlescom again after 10 minutes, (disabled because: AttributeError)
2025-08-21 12:34:34,396 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='api.opensubtitles.com', port=443): Max retries exceeded with url: /api/v1/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75de688830>: Failed to resolve 'api.opensubtitles.com' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:34:44,400 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='api.opensubtitles.com', port=443): Max retries exceeded with url: /api/v1/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75de688ec0>: Failed to resolve 'api.opensubtitles.com' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:34:54,414 - root (7f75df22db30) : INFO (get_providers:408) - Throttling opensubtitlescom for 10 minutes, until 25/08/21 12:44, because of: AttributeError. Exception info: "''NoneType' object has no attribute 'request'' ~ opensubtitlescom.py@584"
2025-08-21 12:35:00,201 - root (7f75df22db30) : INFO (get_providers:204) - Using subf2m again after 10 minutes, (disabled because: ConnectionError)
2025-08-21 12:35:06,897 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /subtitles/searchbytitle?query=SEARCH_TERM(Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75e2273cb0>: Failed to resolve 'subf2m.co' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:35:16,900 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /subtitles/searchbytitle?query=SEARCH_TERM(Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75e2270500>: Failed to resolve 'subf2m.co' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:35:26,909 - root (7f75df22db30) : INFO (get_providers:408) - Throttling subf2m for 10 minutes, until 25/08/21 12:45, because of: ConnectionError. Exception info: "'HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /s' ~ subf2m.py@183"
2025-08-21 12:44:57,792 - root (7f75df22db30) : INFO (get_providers:204) - Using opensubtitlescom again after 10 minutes, (disabled because: AttributeError)
2025-08-21 12:45:04,599 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='api.opensubtitles.com', port=443): Max retries exceeded with url: /api/v1/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75deb3e870>: Failed to resolve 'api.opensubtitles.com' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:45:14,604 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='api.opensubtitles.com', port=443): Max retries exceeded with url: /api/v1/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75deb3cd10>: Failed to resolve 'api.opensubtitles.com' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:45:24,614 - root (7f75df22db30) : INFO (get_providers:408) - Throttling opensubtitlescom for 10 minutes, until 25/08/21 12:55, because of: AttributeError. Exception info: "''NoneType' object has no attribute 'request'' ~ opensubtitlescom.py@584"
2025-08-21 12:45:29,619 - root (7f75df22db30) : INFO (get_providers:476) - Using subf2m again after 10 minutes, (disabled because: ConnectionError)
2025-08-21 12:45:38,196 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /subtitles/searchbytitle?query=SEARCH_TERM(Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75df810ce0>: Failed to resolve 'subf2m.co' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:45:48,201 - retry.api (7f75df22db30) : WARNING (api:40) - HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /subtitles/searchbytitle?query=SEARCH_TERM(Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75df811580>: Failed to resolve 'subf2m.co' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 12:45:58,230 - root (7f75df22db30) : INFO (get_providers:408) - Throttling subf2m for 10 minutes, until 25/08/21 12:55, because of: ConnectionError. Exception info: "'HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /s' ~ subf2m.py@183"
2025-08-21 12:47:34,811 - root (7f75df22db30) : INFO (series:143) - BAZARR Finished searching for missing Series Subtitles. Check History for more information.
2025-08-21 13:06:12,020 - root (7f75df45eb30) : ERROR (check_update:33) - Error trying to get releases from Github. Connection Error.
2025-08-21 15:36:33,301 - root (7f75de8fcb30) : INFO (get_providers:204) - Using opensubtitlescom again after 10 minutes, (disabled because: AttributeError)
2025-08-21 15:36:33,305 - root (7f75de8fcb30) : INFO (get_providers:204) - Using subf2m again after 10 minutes, (disabled because: ConnectionError)
2025-08-21 15:36:40,204 - retry.api (7f75de8fcb30) : WARNING (api:40) - HTTPSConnectionPool(host='api.opensubtitles.com', port=443): Max retries exceeded with url: /api/v1/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75dee21e20>: Failed to resolve 'api.opensubtitles.com' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 15:36:50,208 - retry.api (7f75de8fcb30) : WARNING (api:40) - HTTPSConnectionPool(host='api.opensubtitles.com', port=443): Max retries exceeded with url: /api/v1/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75dee236b0>: Failed to resolve 'api.opensubtitles.com' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 15:37:00,225 - root (7f75de8fcb30) : INFO (get_providers:408) - Throttling opensubtitlescom for 10 minutes, until 25/08/21 15:47, because of: AttributeError. Exception info: "''NoneType' object has no attribute 'request'' ~ opensubtitlescom.py@584"
2025-08-21 15:37:10,239 - retry.api (7f75de8fcb30) : WARNING (api:40) - HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /subtitles/searchbytitle?query=SEARCH_TERM(Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75e1a52150>: Failed to resolve 'subf2m.co' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 15:37:20,243 - retry.api (7f75de8fcb30) : WARNING (api:40) - HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /subtitles/searchbytitle?query=SEARCH_TERM(Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75de602150>: Failed to resolve 'subf2m.co' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 15:37:30,271 - root (7f75de8fcb30) : INFO (get_providers:408) - Throttling subf2m for 10 minutes, until 25/08/21 15:47, because of: ConnectionError. Exception info: "'HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /s' ~ subf2m.py@183"
2025-08-21 15:47:00,806 - root (7f75de8fcb30) : INFO (get_providers:204) - Using opensubtitlescom again after 10 minutes, (disabled because: AttributeError)
2025-08-21 15:47:07,501 - retry.api (7f75de8fcb30) : WARNING (api:40) - HTTPSConnectionPool(host='api.opensubtitles.com', port=443): Max retries exceeded with url: /api/v1/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75de652120>: Failed to resolve 'api.opensubtitles.com' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 15:47:17,505 - retry.api (7f75de8fcb30) : WARNING (api:40) - HTTPSConnectionPool(host='api.opensubtitles.com', port=443): Max retries exceeded with url: /api/v1/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75e1e0bd70>: Failed to resolve 'api.opensubtitles.com' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 15:47:27,523 - root (7f75de8fcb30) : INFO (get_providers:408) - Throttling opensubtitlescom for 10 minutes, until 25/08/21 15:57, because of: AttributeError. Exception info: "''NoneType' object has no attribute 'request'' ~ opensubtitlescom.py@584"
2025-08-21 15:47:32,534 - root (7f75de8fcb30) : INFO (get_providers:476) - Using subf2m again after 10 minutes, (disabled because: ConnectionError)
2025-08-21 15:47:42,101 - retry.api (7f75de8fcb30) : WARNING (api:40) - HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /subtitles/searchbytitle?query=SEARCH_TERM(Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75df4ff200>: Failed to resolve 'subf2m.co' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 15:47:52,104 - retry.api (7f75de8fcb30) : WARNING (api:40) - HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /subtitles/searchbytitle?query=SEARCH_TERM(Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75dfb59070>: Failed to resolve 'subf2m.co' ([Errno -3] Try again)")), retrying in 5 seconds...
2025-08-21 15:48:02,120 - root (7f75de8fcb30) : INFO (get_providers:408) - Throttling subf2m for 10 minutes, until 25/08/21 15:58, because of: ConnectionError. Exception info: "'HTTPSConnectionPool(host='subf2m.co', port=443): Max retries exceeded with url: /s' ~ subf2m.py@183"
You can see at 12:47 it announces that its finshied searching for missing series subtitles.
Then it picks back up searching at 15:36 which is when the next search batch kicks off on the graph too
@joeShuff have you tried to fix you "Path does not exist" and "NameResolutionError" error? It seems pretty obvious to me that if you have a long standing issue, you can at least try to fix what's within your power. Once fixed, we'll see if you still have high CPU usage.
ps -a
root@866ee0145c27:/# ps -a
PID TTY TIME CMD
31530 pts/0 00:00:00 ps
root@866ee0145c27:/# ps -a
PID TTY TIME CMD
31534 pts/0 00:00:00 ps
root@866ee0145c27:/# ps -fp 166
UID PID PPID C STIME TTY TIME CMD
abc 166 151 95 Aug21 ? 1-11:29:17 /lsiopy/bin/python3 -u /app/bazarr/bin/bazarr/main.py --no-update --co
then
/lsiopy/bin/python3-u/app/bazarr/bin/bazarr/main.py--no-update--config/configroot@866ee0145c27:/# lsof -p 166
1 /package/admin/s6-2.13.2.0/command/s6-svscan 0 /dev/null
1 /package/admin/s6-2.13.2.0/command/s6-svscan 1 pipe:[643828443]
1 /package/admin/s6-2.13.2.0/command/s6-svscan 2 pipe:[643828444]
1 /package/admin/s6-2.13.2.0/command/s6-svscan 3 /run/service/.s6-svscan/lock
1 /package/admin/s6-2.13.2.0/command/s6-svscan 5 /run/service/.s6-svscan/control
1 /package/admin/s6-2.13.2.0/command/s6-svscan 6 /run/service/.s6-svscan/control
1 /package/admin/s6-2.13.2.0/command/s6-svscan 7 anon_inode:[signalfd]
17 /package/admin/s6-2.13.2.0/command/s6-supervise 0 /dev/null
17 /package/admin/s6-2.13.2.0/command/s6-supervise 1 pipe:[643828443]
17 /package/admin/s6-2.13.2.0/command/s6-supervise 2 pipe:[643828444]
17 /package/admin/s6-2.13.2.0/command/s6-supervise 3 /run/service/s6-linux-init-shutdownd/supervise/lock
17 /package/admin/s6-2.13.2.0/command/s6-supervise 4 /run/service/s6-linux-init-shutdownd/supervise/control
17 /package/admin/s6-2.13.2.0/command/s6-supervise 5 /run/service/s6-linux-init-shutdownd/supervise/control
17 /package/admin/s6-2.13.2.0/command/s6-supervise 6 anon_inode:[signalfd]
27 /package/admin/s6-linux-init-1.1.3.0/command/s6-linux-init-shutdownd 0 /dev/null
27 /package/admin/s6-linux-init-1.1.3.0/command/s6-linux-init-shutdownd 1 pipe:[643828443]
27 /package/admin/s6-linux-init-1.1.3.0/command/s6-linux-init-shutdownd 2 pipe:[643828444]
27 /package/admin/s6-linux-init-1.1.3.0/command/s6-linux-init-shutdownd 4 /run/service/s6-linux-init-shutdownd/fifo
27 /package/admin/s6-linux-init-1.1.3.0/command/s6-linux-init-shutdownd 5 /run/service/s6-linux-init-shutdownd/fifo
36 /package/admin/s6-2.13.2.0/command/s6-supervise 0 /dev/null
36 /package/admin/s6-2.13.2.0/command/s6-supervise 1 pipe:[643828443]
36 /package/admin/s6-2.13.2.0/command/s6-supervise 2 pipe:[643828444]
36 /package/admin/s6-2.13.2.0/command/s6-supervise 3 /run/s6-rc:s6-rc-init:pfbMJL/servicedirs/s6rc-oneshot-runner/supervise/lock
36 /package/admin/s6-2.13.2.0/command/s6-supervise 4 /run/s6-rc:s6-rc-init:pfbMJL/servicedirs/s6rc-oneshot-runner/supervise/control
36 /package/admin/s6-2.13.2.0/command/s6-supervise 5 /run/s6-rc:s6-rc-init:pfbMJL/servicedirs/s6rc-oneshot-runner/supervise/control
36 /package/admin/s6-2.13.2.0/command/s6-supervise 6 anon_inode:[signalfd]
37 /package/admin/s6-2.13.2.0/command/s6-supervise 0 /dev/null
37 /package/admin/s6-2.13.2.0/command/s6-supervise 1 pipe:[643828443]
37 /package/admin/s6-2.13.2.0/command/s6-supervise 2 pipe:[643828444]
37 /package/admin/s6-2.13.2.0/command/s6-supervise 3 /run/s6-rc:s6-rc-init:pfbMJL/servicedirs/s6rc-fdholder/supervise/lock
37 /package/admin/s6-2.13.2.0/command/s6-supervise 4 /run/s6-rc:s6-rc-init:pfbMJL/servicedirs/s6rc-fdholder/supervise/control
37 /package/admin/s6-2.13.2.0/command/s6-supervise 5 /run/s6-rc:s6-rc-init:pfbMJL/servicedirs/s6rc-fdholder/supervise/control
37 /package/admin/s6-2.13.2.0/command/s6-supervise 6 anon_inode:[signalfd]
38 /package/admin/s6-2.13.2.0/command/s6-supervise 0 /dev/null
38 /package/admin/s6-2.13.2.0/command/s6-supervise 1 pipe:[643828443]
38 /package/admin/s6-2.13.2.0/command/s6-supervise 2 pipe:[643828444]
38 /package/admin/s6-2.13.2.0/command/s6-supervise 3 /run/s6-rc:s6-rc-init:pfbMJL/servicedirs/svc-bazarr/supervise/lock
38 /package/admin/s6-2.13.2.0/command/s6-supervise 4 /run/s6-rc:s6-rc-init:pfbMJL/servicedirs/svc-bazarr/supervise/control
38 /package/admin/s6-2.13.2.0/command/s6-supervise 5 /run/s6-rc:s6-rc-init:pfbMJL/servicedirs/svc-bazarr/supervise/control
38 /package/admin/s6-2.13.2.0/command/s6-supervise 6 anon_inode:[signalfd]
39 /package/admin/s6-2.13.2.0/command/s6-supervise 0 /dev/null
39 /package/admin/s6-2.13.2.0/command/s6-supervise 1 pipe:[643828443]
39 /package/admin/s6-2.13.2.0/command/s6-supervise 2 pipe:[643828444]
39 /package/admin/s6-2.13.2.0/command/s6-supervise 3 /run/s6-rc:s6-rc-init:pfbMJL/servicedirs/svc-cron/supervise/lock
39 /package/admin/s6-2.13.2.0/command/s6-supervise 4 /run/s6-rc:s6-rc-init:pfbMJL/servicedirs/svc-cron/supervise/control
39 /package/admin/s6-2.13.2.0/command/s6-supervise 5 /run/s6-rc:s6-rc-init:pfbMJL/servicedirs/svc-cron/supervise/control
39 /package/admin/s6-2.13.2.0/command/s6-supervise 6 anon_inode:[signalfd]
47 /package/admin/s6-2.13.2.0/command/s6-ipcserverd 0 socket:[643836090]
47 /package/admin/s6-2.13.2.0/command/s6-ipcserverd 2 pipe:[643828443]
47 /package/admin/s6-2.13.2.0/command/s6-ipcserverd 3 anon_inode:[signalfd]
150 /bin/busybox 0 /dev/null
150 /bin/busybox 1 pipe:[643828443]
150 /bin/busybox 2 pipe:[643828444]
150 /bin/busybox 3 socket:[643840200]
31507 /bin/bash 0 /dev/pts/0
31507 /bin/bash 1 /dev/pts/0
31507 /bin/bash 2 /dev/pts/0
31507 /bin/bash 255 /dev/pts/0
@Salvora I don't see anything weird here... Have you tried to deploy a new test container to see if it start using 100% CPU by itself? Maybe disable postgres in your docker container and let it create a "normal" sqlite database to see the impact? Of course you'll be able to move back to postgres after that.
I'll have to deploy and configure a postgres instance to test if there's an issue there. I'll try to find time for that in the upcoming days/weeks.
So I've looked into this and I think this issue is related (and fixed in waitress 3.0.1) by this PR https://github.com/Pylons/waitress/pull/435.
I've patched my bazarr to run with waitress 3.0.2 and I haven't had this issue for 3 days now, whereas usually this problem would manifest itself within 24 hours. But if this is the cause and as it's a race condition, it's hard to reproduce. So my test might not be conclusive. So maybe some more people who have this issue could test it out too?
This is probably also the cause of https://github.com/morpheus65535/bazarr/issues/1914
There is also a second bug I found pertaining to SignalR Core in signalrcore/transport/websockets/websocket_transport.py . Which I don't think is the cause of this problem. But could, on lower spec systems, cause temporary CPU spikes when either sonarr or radarr get disconnected. The reconnection_checker spawns a reconnect thread every second per service disconnected. As it doesn't get killed when the websocket is closed because of an exception. This could possibly starve a system for resources. Although they eventually get cleaned up when the services reconnect again, so it won't cause long term issues.
This does however mean the reconnect interval here is completely moot: https://github.com/morpheus65535/bazarr/blob/2a00e87aee409d7137ae3ef61e57fd74e937fe4a/bazarr/app/signalr_client.py#L170
It's fixed by this patch. But this should obviously be fixed upstream.
For now I'll keep running bazarr with waitress 3.0.2 and keep you posted if this problem shows up again. As far as I can see the version bump didn't introduce other problems, so it looks like a safe fix.