# 00_Recapitulatif

## 260802 - Allegement JVM Komga + StirlingPDF (applique le 2026-08-02 a 22h)

Application des optimisations memoire validees le 2026-08-01, apres verification du backup quotidien (BILAN 5/5 OK). Les deux stacks ont ete redeployees depuis `/home/debian/{komga,stirling}-compose-new.yml`, les composes precedents sauvegardes en `.bak-260802`.

<table id="bkmrk-serviceavantapresres"><tbody><tr><th style="width:150px;">Service</th><th>Avant</th><th>Apres</th><th>Resultat</th></tr><tr><td>**Komga** (stack 7)</td> <td>`-Xmx4g -Xms2g -XX:MaxRAMPercentage=70.0`  
limits 4500M / reservations 3000M  
707 Mio residents</td> <td>`-Xmx1g`  
limits 1500M / reservations 256M</td> <td>**415 Mio** (-292 Mio, -41 %)</td></tr><tr><td>**StirlingPDF** (stack 89)</td> <td>JVM sans limite  
722 Mio residents</td> <td>`-Xmx512m`  
limits 2g</td> <td>**785 Mio** — pas de reduction, mais consommation desormais bornee</td></tr></tbody></table>

**Bilan hote :** swap **3,7 Go -&gt; 2,2 Go** (-1,5 Go), memoire disponible 4,4 -&gt; 4,6 Gi. L'essentiel du gain vient de Komga : c'est le `-Xms2g` qui pre-allouait 2 Go de heap au demarrage.

**Pourquoi StirlingPDF ne baisse pas :** le process `java` conserve 799 Mio de RSS malgre `-Xmx512m` (512 Mio de heap + non-heap : metaspace, code cache, piles de threads), auxquels s'ajoutent LibreOffice (`soffice.bin`, ~98 Mio), `unoserver` et `Xvfb` que Stirling lance pour les conversions. Le benefice obtenu n'est pas une baisse mais un plafond : la consommation ne peut plus deborder.

**Limite portee de 1 Go a 2 Go avant application.** Le plan initial prevoyait 1 Go. Or l'OCR fait tourner ocrmypdf et tesseract comme processus Python *hors JVM* : `-Xmx` ne les borne pas, seul le plafond cgroup du container s'applique. Pic mesure a **894-969 Mio pour une seule page A4 300 dpi** — un plafond de 1 Go aurait provoque un OOM kill des le premier OCR. La version 1 Go est conservee en `/home/debian/stirling-compose-new.yml.orig1g` mais ne doit pas etre utilisee.

**Verifications apres deploiement :** Komga repond 200 et son API `/api/v1/libraries` renvoie bien les bibliotheques ; StirlingPDF valide ses deux fonctions critiques, `compress-pdf` (utilise par les workflows komga-pdf et nas\_geo\_compress) et l'**OCR** (page A4 300 dpi, pic 969 Mio, aucun OOM kill, aucun redemarrage).

**Piege de deploiement :** les projets compose s'appellent `7` et `89` (les IDs de stack Portainer), pas `komga` / `stirlingpdf`. La commande correcte est `sudo docker compose -p 7 -f /var/lib/docker/volumes/portainer_data/_data/compose/7/docker-compose.yml up -d`.

**Rollback :** restaurer le `.bak-260802` de la stack concernee et redeployer de la meme facon.

---

## Vue d ensemble - VPS Jux + Claude Code

34 containers en production sur le VPS. 25 pages de documentation, une par service. 13 services disposent d un MCP actif dans Claude Code. Mis a jour le 2026-05-30.

<table id="bkmrk-pageurlmcp-claude-co"><thead><tr><th>Page</th><th>URL</th><th>MCP Claude Code</th><th>Statut integration</th></tr></thead><tbody><tr><td>[01\_Portainer](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/152)</td><td>[https://portainer.juxjux.ovh](https://portainer.juxjux.ovh)</td><td>`mcp__portainer__*`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[02\_Bookstack](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/153)</td><td>[https://bookstack.juxjux.ovh](https://bookstack.juxjux.ovh)</td><td>`bookstack-mcp-server (npm)`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[03\_Homarr](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/154)</td><td>[https://homarr.juxjux.ovh](https://homarr.juxjux.ovh)</td><td>`mcp__homarr__*`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[04\_Audiobookshelf](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/155)</td><td>[https://audiobookshelf.juxjux.ovh](https://audiobookshelf.juxjux.ovh)</td><td>`mcp__audiobookshelf__*`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[05\_BentoPDF](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/156)</td><td>-</td><td>-</td><td><span style="color:#ffa500;">API directe</span></td></tr><tr><td>[06\_Cadvisor](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/157)</td><td>-</td><td>-</td><td><span style="color:#808080;">via Prometheus</span></td></tr><tr><td>[07\_Calibre-web](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/158)</td><td>-</td><td>-</td><td><span style="color:#ffa500;">OPDS</span></td></tr><tr><td>[08\_Dozzle](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/159)</td><td>-</td><td>-</td><td><span style="color:#808080;">via Portainer MCP</span></td></tr><tr><td>[09\_FileBrowser](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/160)</td><td>[https://files.juxjux.ovh](https://files.juxjux.ovh)</td><td>`mcp__filebrowser__*`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[10\_FreshRSS](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/161)</td><td>[https://freshrss.juxjux.ovh](https://freshrss.juxjux.ovh)</td><td>`mcp__freshrss__*`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[11\_Gitea](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/162)</td><td>-</td><td>-</td><td><span style="color:#ffa500;">API REST directe</span></td></tr><tr><td>[12\_Grafana](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/163)</td><td>[https://grafana.juxjux.ovh](https://grafana.juxjux.ovh)</td><td>-</td><td><span style="color:#ffa500;">API REST directe</span></td></tr><tr><td>[13\_Immich](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/164)</td><td>[https://immich.juxjux.ovh](https://immich.juxjux.ovh)</td><td>`mcp__immich__*`</td><td><span style="color:#008000;">MCP actif (5 containers)</span></td></tr><tr><td>[14\_Jellyfin](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/165)</td><td>[https://jellyfin.juxjux.ovh](https://jellyfin.juxjux.ovh)</td><td>`mcp__jellyfin__*`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[15\_Joplin](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/166)</td><td>-</td><td>-</td><td><span style="color:#808080;">sync server uniquement</span></td></tr><tr><td>[16\_Kavita](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/167)</td><td>[https://kavita.juxjux.ovh](https://kavita.juxjux.ovh)</td><td>`mcp__kavita__*`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[17\_Komga](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/168)</td><td>[https://komga.juxjux.ovh](https://komga.juxjux.ovh)</td><td>`mcp__komga__*`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[18\_Mealie](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/169)</td><td>[https://mealie.juxjux.ovh](https://mealie.juxjux.ovh)</td><td>`mcp__mealie__*`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[19\_Navidrome](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/170)</td><td>[https://navidrome.juxjux.ovh](https://navidrome.juxjux.ovh)</td><td>`mcp__navidrome__*`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[20\_NodeExporter](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/171)</td><td>-</td><td>-</td><td><span style="color:#808080;">via Prometheus</span></td></tr><tr><td>[21\_Prometheus](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/172)</td><td>-</td><td>-</td><td><span style="color:#ffa500;">API REST / PromQL</span></td></tr><tr><td>[22\_Readeck](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/173)</td><td>[https://readeck.juxjux.ovh](https://readeck.juxjux.ovh)</td><td>`mcp__readeck__*`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[23\_Syncthing](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/174)</td><td>[https://syncthing.juxjux.ovh](https://syncthing.juxjux.ovh)</td><td>`mcp__syncthing__*`</td><td><span style="color:#008000;">MCP actif</span></td></tr><tr><td>[24\_Yourls](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/175)</td><td>-</td><td>-</td><td><span style="color:#ffa500;">API REST directe</span></td></tr><tr><td>[25\_StirlingPDF](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/208)</td><td>[https://spdf.juxjux.ovh](https://spdf.juxjux.ovh)</td><td>-</td><td><span style="color:#ffa500;">API directe</span></td></tr><tr><td>[A\_liens entre Claude et le KDRIVE](https://bookstack.juxjux.ovh/books/le-livre-de-claude/page/176)</td><td>[kdrive.infomaniak.com](https://kdrive.infomaniak.com)</td><td>`@infomaniak/mcp-server-kdrive` + API REST</td><td><span style="color:#008000;">MCP actif (kdrive\_search) + API directe</span></td></tr></tbody></table>

## Scripts de maintenance

<table id="bkmrk-fill_bookstack_pages"><tbody><tr><th>fill\_bookstack\_pages.py</th><td>Remplit les pages avec les infos containers (image, ports, volumes)</td><td>`C:\Users\eliob\.claude\fill_bookstack_pages.py`</td></tr><tr><th>fill\_bookstack\_mcp.py</th><td>Ajoute la section integration Claude Code / MCP a chaque page</td><td>`C:\Users\eliob\.claude\fill_bookstack_mcp.py`</td></tr></tbody></table>

## Configuration MCP

Scripts dans `C:\Users\eliob\.claude\`, enregistres dans `C:\Users\eliob\.mcp.json`. Projet Claude Code principal : `C:\Users\eliob`. Endpoint Portainer Docker local : ID **3**.

## 260611-REX VPS par Claude

Releve du 2026-06-11 via Prometheus (PromQL sur localhost:9090) + Portainer MCP.

### Etat global

<table id="bkmrk-ram8.4-%2F-11.41-gb-%287"><tbody><tr><th>RAM</th><td>8.4 / 11.41 GB (73.6%)</td></tr><tr><th>Swap</th><td><span style="color:#cc0000;">3.99 / 4.0 GB (quasi plein)</span></td></tr><tr><th>CPU</th><td>5.2%</td></tr></tbody></table>

### Top consommateurs RAM (RSS)

<table id="bkmrk-containerram-rss-kom"><thead><tr><th>Container</th><th>RAM RSS</th></tr></thead><tbody><tr><td>komga</td><td>1059 MB</td></tr><tr><td>Immich-SERVER</td><td>1011 MB</td></tr><tr><td>Immich-MICROSERVICES</td><td>520 MB</td></tr><tr><td>stirling-pdf</td><td>442 MB</td></tr><tr><td>homarr2026</td><td>355 MB</td></tr><tr><td>jellyfin</td><td>272 MB</td></tr><tr><td>prometheus</td><td>259 MB</td></tr><tr><td>jdownloader</td><td>220 MB</td></tr><tr><td>Kavita</td><td>196 MB</td></tr><tr><td>joplin</td><td>179 MB</td></tr><tr><td>calibre-web-eyrolles</td><td>132 MB</td></tr><tr><td>mealie</td><td>129 MB</td></tr><tr><td>grafana</td><td>125 MB</td></tr><tr><td>cadvisor</td><td>91 MB</td></tr><tr><td>navidrome</td><td>86 MB</td></tr></tbody></table>

Swap sature : komga + Immich representent ~2.5 GB a eux deux. StirlingPDF (442 MB) reste charge entre les appels.

## 260801-REX VPS par Claude

Releve du 2026-08-01 via docker stats + /proc en SSH (PC eliob).

### Etat global

<table id="bkmrk-ram-8.2-%2F-11.41-gb-%28"><tbody><tr><th>RAM</th><td>8.2 / 11.41 GB (71.7%)</td></tr><tr><th>Swap</th><td><span style="color:#cc0000;">4.0 / 4.0 GB (sature a 100%)</span></td></tr><tr><th>CPU</th><td>28% (compression 7z du backup en cours)</td></tr></tbody></table>

### Top consommateurs RAM (RSS)

<table id="bkmrk-container-ram-rss-im"><thead><tr><th>Container</th><th>RAM RSS</th></tr></thead><tbody><tr><td>Immich-SERVER</td><td>1147 MB</td></tr><tr><td>komga</td><td>791 MB</td></tr><tr><td>Immich-MICROSERVICES</td><td>618 MB</td></tr><tr><td>stirling-pdf</td><td>566 MB</td></tr><tr><td>jellyfin</td><td>380 MB</td></tr><tr><td>homarr2026</td><td>313 MB</td></tr><tr><td>Immich-DB</td><td>310 MB</td></tr><tr><td>prometheus</td><td>282 MB</td></tr><tr><td>joplin</td><td>241 MB</td></tr><tr><td>Kavita</td><td>240 MB</td></tr><tr><td>cadvisor</td><td>195 MB</td></tr><tr><td>grafana</td><td>164 MB</td></tr><tr><td>joplin-db</td><td>158 MB</td></tr><tr><td>yourls-db</td><td>157 MB</td></tr><tr><td>audiobookshelf</td><td>140 MB</td></tr></tbody></table>

Swap sature : komga (760 MB) + StirlingPDF (406 MB) en tete des processus swappes, Immich ~330 MB. Des limites memoire ont ete posees depuis juin sur les gros containers (komga 4.4G, Immich 2G, Kavita 4G, joplin 2G). Decouvertes du jour : GNOME/gdm3 tourne a vide sur tty1 depuis le 8 juillet (98 paquets installes, ~150 MB RAM, aucun acces distant configure) ; sauvegardes Immich vides depuis l'origine (pg\_dump sans -d immich, archives de 4 Ko) — corrigees le 2026-08-01, dump reel 307 MB.

### Actions realisees le 2026-08-01 (soir)

<table id="bkmrk-action-detail-gain-f"><thead><tr><th>Action</th><th>Detail</th><th>Gain</th></tr></thead><tbody><tr><td>Fix backup Immich</td><td>`-d immich` ajoute dans `/opt/backups/vps_backup.sh` + run manuel complet 5/5 OK (archive 87 MB sur kDrive, premiere sauvegarde Immich valide)</td><td>donnees enfin sauvegardees</td></tr><tr><td>Fusion Immich</td><td>5 containers → 3 : SERVER unique (API + workers, `NODE_OPTIONS=--max-old-space-size=768`), MICROSERVICES et LEARNING supprimes (recherche semantique et visages non utilises). Ancien compose : `compose/29/docker-compose.yml.bak-260801`</td><td>~900 MB RAM</td></tr><tr><td>Arret cAdvisor</td><td>`docker update --restart=no cadvisor` + stop. Plus de metriques par container dans Prometheus/Grafana (node-exporter conserve le host)</td><td>~200 MB RAM + 4-8% CPU</td></tr><tr><td>GDM/GNOME desactive puis purge</td><td>gdm3 + gnome-shell + Xorg tournaient a vide sur tty1 depuis le 2026-07-08. `systemctl disable --now gdm` puis purge apt de 263 paquets (bureau complet + LibreOffice, jeux...). Verifie avant : ens3 gere par systemd-networkd, NetworkManager non critique. Verifie apres : 30 containers up, nginx/docker/ssh/wg actifs, sites en 200</td><td>~150 MB RAM + 3,5 GB disque</td></tr></tbody></table>

**Resultat global du 2026-08-01** : swap 4,0/4,0 GB (sature depuis juin) → 2,6/4,0 GB ; disque 62% → 59% ; ~1,3 GB de RAM liberes. Immich verifie fonctionnel par Julien.

### Plan du 2026-08-02 a 19h (tache planifiee Claude Code)

Apres verification du backup nocturne (BILAN 5/5 OK), appliquer les deux fixes JVM prepares et valides (fichiers en attente dans `/home/debian/`) :

<table id="bkmrk-service-avant-apres-"><thead><tr><th>Service</th><th>Avant</th><th>Apres</th><th>Gain attendu</th></tr></thead><tbody><tr><td>Komga (stack 7)</td><td>`-Xmx4g -Xms2g` (2 GB pre-alloues, ~760 MB en swap), limites 4500M/3000M</td><td>`-Xmx1g` sans Xms, limites 1500M/256M</td><td>~400-500 MB RAM + ~700 MB swap</td></tr><tr><td>StirlingPDF (stack 89)</td><td>JVM sans plafond (566-643 MB residents + ~406 MB swap)</td><td>`JAVA_TOOL_OPTIONS=-Xmx512m`, limite 1g</td><td>~300-400 MB RAM</td></tr></tbody></table>

Verifications prevues : komga.juxjux.ovh en 200, test compress-pdf sur spdf.juxjux.ovh (fonction critique des workflows komga-pdf et geo\_loud), docker stats, free -h (swap attendu sous ~2 GB). Rollback : restaurer les `.bak-260802`. Nota : BentoPDF n'existe plus sur le VPS (container supprime) — il ne peut de toute facon pas remplacer StirlingPDF (pas d'API serveur, traitement 100% navigateur).