qdm12/ddns-updater

Bug: Swap memory almost entirely consumed by ddns-updater

Closed this issue · 4 comments

TLDR: Describe your issue in a one liner here
SWAP space almost entirely consumed by ddns-updater no matter what the swap space is on the system after some time of the container running.

  1. Is this urgent: No
  2. DNS provider(s) you use: cloudflare
  3. Program version: 2.6.0
  4. What are you using to run the container: docker-compose
  5. When running htop I see the container showing as a process called 'app'. When digging into it I see the path /updater/app that helped me to originally identify this was coming from ddns-updater and it was an in-container path. Stopping ddns-updater resolved this. I added the memory limits to the compose file to see if I could limit the app's usage, but it barreled past that so I assume that's not doing much, haha.

Logs:
Nothing unusual in the logs.

Configuration file (remove your credentials!):

{
  "settings": [
    {
      "provider": "cloudflare",
      "zone_identifier": "...",
      "domain": "domain1",
      "host": "@",
      "ttl": 600,
      "token": "...",
      "ip_version": "ipv4"
    },
    {
      "provider": "cloudflare",
      "zone_identifier": "...",
      "domain": "domain2",
      "host": "@",
      "ttl": 600,
      "token": "...",
      "ip_version": "ipv4"
    },
    {
      "provider": "cloudflare",
      "zone_identifier": "...",
      "domain": "domain3",
      "host": "@",
      "ttl": 600,
      "token": "...",
      "ip_version": "ipv4"
    }
  ]
}
  ddns-updater:
    image: qmcgaw/ddns-updater
    container_name: ddns-updater
    restart: always
    security_opt:
      - no-new-privileges:true
    network_mode: bridge
    ports:
      - 7821:7821/tcp
    volumes:
      - $DOCKERDIR/ddns-updater:/updater/data
    environment:
      - CONFIG=
      - PERIOD=5m
      - UPDATE_COOLDOWN_PERIOD=5m
      - PUBLICIP_FETCHERS=all
      - PUBLICIP_HTTP_PROVIDERS=all
      - PUBLICIPV4_HTTP_PROVIDERS=all
      - PUBLICIPV6_HTTP_PROVIDERS=all
      - PUBLICIP_DNS_PROVIDERS=all
      - PUBLICIP_DNS_TIMEOUT=3s
      - HTTP_TIMEOUT=10s
      # Web UI
      - LISTENING_ADDRESS=:7821
      - ROOT_URL=/
      # Backup
      - BACKUP_PERIOD=0 # 0 to disable
      - BACKUP_DIRECTORY=/updater/data
      # Other
      - LOG_LEVEL=debug
      - LOG_CALLER=hidden
      - SHOUTRRR_ADDRESSES=
    healthcheck:
      disable: true
    mem_limit: 256m
    memswap_limit: 0m

Host OS:
Ubuntu 22.04.4 LTS x86_64

That's strange, what does docker stats say? Mine uses 9.3MB of ram. Does it increase slowly over time?
How did you identify using htop that ddns-updater was at fault for the swap space being used all up?

By the way, I just changed it from /updater/app to /updater/ddns-updater in commit 8e09cd6 since that was indeed unclear in terms of process name

Appreciate that, it was definitely a bit of a chase to figure out where that was initially, haha. Looks like it calmed back down now. Once my alert goes off again I'll visit docker stats again.
Screenshot 2024-05-24 at 3 04 45 PM

Hey, I think I've resolved my swap space issue, it wasn't the ddns-updater app, but it looked to be gluetun. I added
DOT=off to get rid of unbound and my swap space has drastically improved with only 10% usage at most across my entire stack of containers. Thank you!

That's strange. Unbound does use memory for sure, due to its blocklists mostly, but it should stay at around 500MB.
This is changing soon (after next release) with qdm12/gluetun#137 and memory is a bit reduced as far as I've seen. Feel free to subscribe to that issue 😉