From 8f77aad130b47ff2d3e8306de81d5bde62186168 Mon Sep 17 00:00:00 2001 From: f1d094 Date: Sun, 25 Feb 2024 08:04:15 -0800 Subject: [PATCH] Update recordings.md Co-authored-by: Blake Blackshear --- docs/docs/troubleshooting/recordings.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/docs/troubleshooting/recordings.md b/docs/docs/troubleshooting/recordings.md index 870246c20..611ba45e2 100644 --- a/docs/docs/troubleshooting/recordings.md +++ b/docs/docs/troubleshooting/recordings.md @@ -37,9 +37,26 @@ On linux, some helpful tools/commands in diagnosing would be: - iostat -sxy --human 1 1 - vmstat 1 -On modern linux kernels, the system will utilize some swap if enabled. Setting vm.swappiness=1 no longer means that the kernel will only swap in order to avoid OOM. To prevent any swapping inside a container, set allocations memory and memory+swap to be the same and disable swapping by setting the following docker/podman run parameters: +On modern linux kernels, the system will utilize some swap if enabled. Setting vm.swappiness=1 no longer means that the kernel will only swap in order to avoid OOM. To prevent any swapping inside a container, set allocations memory and memory+swap to be the same and disable swapping by setting the following docker/podman run parameters: -`--memory= --memory-swap= --memory-swappiness=0`. +**Compose example** +```yaml +version: "3.9" +services: + frigate: + ... + mem_swappiness: 0 + memswap_limit: + deploy: + resources: + limits: + memory: +``` + +**Run command example** +``` +--memory= --memory-swap= --memory-swappiness=0 +``` NOTE: These are hard-limits for the container, be sure there is enough headroom above what is shown by `docker stats` for your container. It will immediately halt if it hits ``. In general, running all cache and tmp filespace in RAM is preferable to disk I/O where possible.