summary refs log tree commit diff
diff options
context:
space:
mode:
authoruser <user@node5.net>2025-03-30 21:19:17 +0200
committeruser <user@node5.net>2025-03-30 21:19:17 +0200
commit0410e95557980dff34103fdf91d99a7a845c17f7 (patch)
treebb1ae53c85076b22cf966a91b149397daa143cb1
parent40417be9cccd815eb73bae3b70b9f4b6541b4fa3 (diff)
new article - Docker optimizing idle CPU usage
-rw-r--r--Docker optimizing idle CPU usage/After CPU breakdown.webpbin0 -> 24678 bytes
-rw-r--r--Docker optimizing idle CPU usage/Before CPU breakdown.webpbin0 -> 35602 bytes
-rw-r--r--Docker optimizing idle CPU usage/Thumbnail.webpbin0 -> 1684 bytes
-rw-r--r--Docker optimizing idle CPU usage/index.md112
4 files changed, 112 insertions, 0 deletions
diff --git a/Docker optimizing idle CPU usage/After CPU breakdown.webp b/Docker optimizing idle CPU usage/After CPU breakdown.webp
new file mode 100644
index 0000000..7526e23
--- /dev/null
+++ b/Docker optimizing idle CPU usage/After CPU breakdown.webp
Binary files differdiff --git a/Docker optimizing idle CPU usage/Before CPU breakdown.webp b/Docker optimizing idle CPU usage/Before CPU breakdown.webp
new file mode 100644
index 0000000..62e1aed
--- /dev/null
+++ b/Docker optimizing idle CPU usage/Before CPU breakdown.webp
Binary files differdiff --git a/Docker optimizing idle CPU usage/Thumbnail.webp b/Docker optimizing idle CPU usage/Thumbnail.webp
new file mode 100644
index 0000000..13ec3c4
--- /dev/null
+++ b/Docker optimizing idle CPU usage/Thumbnail.webp
Binary files differdiff --git a/Docker optimizing idle CPU usage/index.md b/Docker optimizing idle CPU usage/index.md
new file mode 100644
index 0000000..0992bfc
--- /dev/null
+++ b/Docker optimizing idle CPU usage/index.md
@@ -0,0 +1,112 @@
+---
+description: Docker homelab energy conception
+created: 2025-03-30
+---
+
+## TLDR
+
+Add this to your docker-compose.yml
+
+```
+healthcheck:
+  disable: true
+```
+
+To check which services need it, use: [Beszel](https://www.beszel.dev/)
+
+---
+
+## Prelude
+
+I self host a bunch of services on my home server.
+And i care about the [energy usage](https://www.youtube.com/watch?v=OOK5xkFijPc).
+Hence i chose a new enough computer to have a somewhat efficient CPU. (specs below)
+
+<pre>
+<span style="color:gray;"></span><span style="font-weight:bold;">       _,met$$$$$gg.
+    ,g$$$$$$$$$$$$$$$P.
+  ,g$$P&quot;     &quot;&quot;&quot;Y$$.&quot;.
+ ,$$P'              `$$$.
+',$$P       ,ggs.     `$$b:
+`d$$'     ,$P&quot;'   </span><span style="color:red;"></span><span style="font-weight:bold;color:red;">.</span><span style="font-weight:bold;color:gray;"></span><span style="font-weight:bold;">    $$$
+ $$P      d$'     </span><span style="color:red;"></span><span style="font-weight:bold;color:red;">,</span><span style="font-weight:bold;color:gray;"></span><span style="font-weight:bold;">    $$P
+ $$:      $$.   </span><span style="color:red;"></span><span style="font-weight:bold;color:red;">-</span><span style="font-weight:bold;color:gray;"></span><span style="font-weight:bold;">    ,d$$'
+ $$;      Y$b._   _,d$P'
+ Y$$.    </span><span style="color:red;"></span><span style="font-weight:bold;color:red;">`.</span><span style="font-weight:bold;color:gray;"></span><span style="font-weight:bold;">`&quot;Y$$$$P&quot;'
+</span><span style="font-weight:bold;color:gray;"></span><span style="font-weight:bold;"> `$$b      </span><span style="color:red;"></span><span style="font-weight:bold;color:red;">&quot;-.__
+</span><span style="font-weight:bold;color:gray;"></span><span style="font-weight:bold;">  `Y$$
+   `Y$$.
+     `$$b.
+       `Y$$b.
+          `&quot;Y$b._
+              `&quot;&quot;&quot;</span>
+<span style="font-weight:bold;"></span><span style="font-weight:bold;color:red;">user</span>@<span style="color:red;"></span><span style="font-weight:bold;color:red;">home-server</span>
+----------------
+<span style="color:red;"></span><span style="font-weight:bold;color:red;">OS</span>: Debian GNU/Linux 12 (bookworm) x86_64
+<span style="color:red;"></span><span style="font-weight:bold;color:red;">Host</span>: HP EliteDesk 800 G3 SFF
+<span style="color:red;"></span><span style="font-weight:bold;color:red;">Kernel</span>: 6.1.0-32-amd64
+<span style="color:red;"></span><span style="font-weight:bold;color:red;">Uptime</span>: 10 days, 19 hours, 29 mins
+<span style="color:red;"></span><span style="font-weight:bold;color:red;">Packages</span>: 2537 (dpkg), 7 (flatpak)
+<span style="color:red;"></span><span style="font-weight:bold;color:red;">Shell</span>: bash 5.2.15
+<span style="color:red;"></span><span style="font-weight:bold;color:red;">Terminal</span>: /dev/pts/1
+<span style="color:red;"></span><span style="font-weight:bold;color:red;">CPU</span>: Intel i5-7500 (4) @ 3.800GHz
+<span style="color:red;"></span><span style="font-weight:bold;color:red;">GPU</span>: Intel HD Graphics 630
+<span style="color:red;"></span><span style="font-weight:bold;color:red;">Memory</span>: 3124MiB / 15400MiB
+
+<span style="color:dimgray;"></span><span style="color:dimgray;background-color:black;">   </span><span style="color:red;background-color:black;"></span><span style="color:red;background-color:red;">   </span><span style="color:green;background-color:red;"></span><span style="color:green;background-color:green;">   </span><span style="color:olive;background-color:green;"></span><span style="color:olive;background-color:olive;">   </span><span style="color:blue;background-color:olive;"></span><span style="color:blue;background-color:blue;">   </span><span style="color:purple;background-color:blue;"></span><span style="color:purple;background-color:purple;">   </span><span style="color:teal;background-color:purple;"></span><span style="color:teal;background-color:teal;">   </span><span style="color:gray;background-color:teal;"></span><span style="color:gray;background-color:gray;">   </span>
+<span style="filter: contrast(70%) brightness(190%);color:dimgray;"></span><span style="filter: contrast(70%) brightness(190%);color:dimgray;background-color:black;">   </span><span style="filter: contrast(70%) brightness(190%);color:red;background-color:black;"></span><span style="filter: contrast(70%) brightness(190%);color:red;background-color:red;">   </span><span style="filter: contrast(70%) brightness(190%);color:green;background-color:red;"></span><span style="filter: contrast(70%) brightness(190%);color:green;background-color:green;">   </span><span style="filter: contrast(70%) brightness(190%);color:olive;background-color:green;"></span><span style="filter: contrast(70%) brightness(190%);color:olive;background-color:olive;">   </span><span style="filter: contrast(70%) brightness(190%);color:blue;background-color:olive;"></span><span style="filter: contrast(70%) brightness(190%);color:blue;background-color:blue;">   </span><span style="filter: contrast(70%) brightness(190%);color:purple;background-color:blue;"></span><span style="filter: contrast(70%) brightness(190%);color:purple;background-color:purple;">   </span><span style="filter: contrast(70%) brightness(190%);color:teal;background-color:purple;"></span><span style="filter: contrast(70%) brightness(190%);color:teal;background-color:teal;">   </span><span style="filter: contrast(70%) brightness(190%);color:gray;background-color:teal;"></span><span style="filter: contrast(70%) brightness(190%);color:gray;background-color:gray;">   </span>
+</pre>
+
+I chose to run it using docker, which has been great, since it allows me to self host many services easily.
+They even update themselves using [Watchtower](https://github.com/containrrr/watchtower).
+
+---
+
+## Observability
+
+However, i lacked [Observability](https://en.wikipedia.org/wiki/Observability_(software)) into resource usage.
+
+### cAdvisor
+
+At first i tried a stack consisting of [Grafana](https://grafana.com/) [Prometheus](https://prometheus.io/), and [cAdvisor](https://github.com/google/cadvisor)
+How ever the only conclusion i came to running this stack was that my CPU load now was ≈ 30% higher (if memory serves me)
+
+This defeats the purpose for usage...
+I'm sure cAdvisor has it's place, but it's suitable for my home lab usage.
+
+### Beszel
+
+Then i found [Beszel](https://www.beszel.dev/) which is docker / system monitoring in a box.
+Using a minimum of system resources.
+
+Running this for a month gave me insights into my resource usage. With averages, and a breakdown per container.
+
+---
+
+## Resource usage BEFORE
+
+![Before CPU breakdown](Before CPU breakdown.webp)
+
+---
+
+## Optimizing
+
+Beszels CPU usage breakdown per container helps you drill down which container is weighing down your system.
+Stoping the ones you don't need and, searching the respective projects github issues helps you find solutions.
+
+As per this github issue:
+[High CPU (5-20%) consumption even when not being used](https://github.com/filebrowser/filebrowser/issues/2676#issuecomment-1708201927)
+
+Adding the following segment to you docker compose files helps lower their CPU usage.
+
+```
+healthcheck:
+  disable: true
+```
+
+---
+
+## Resource usage after
+
+![After CPU breakdown](After CPU breakdown.webp)
+