diff --git a/services/obsidian-livesync/plugin.yaml b/services/obsidian-livesync/plugin.yaml index c379d4f..e1a9f20 100644 --- a/services/obsidian-livesync/plugin.yaml +++ b/services/obsidian-livesync/plugin.yaml @@ -59,18 +59,16 @@ services: image: ordo/livesync-bridge:latest wants_secrets: true env: - # ONE-WAY materializer. The bridge's job here is CouchDB -> notes/ files (network-driven, - # always live) so the AI stack (rag-ingestion + memory-vault MCP) can read the vault. The - # REVERSE direction (disk -> CouchDB) needs a file WATCHER, but 9p bind mounts emit no inotify - # events, so the only way to catch host/AI disk writes is chokidar POLLING every file every few - # seconds — on a multi-thousand-file vault that stats ~100k files/min and pegs a core forever - # (~128% CPU idle). The AI-RAG use case never needs disk -> CouchDB (humans edit on devices, - # which sync to CouchDB over the network), so polling is OFF: chokidar sits on inotify and gets - # no events on 9p → ~0 idle CPU, while CouchDB -> disk keeps working. Set USEPOLLING="1" ONLY - # if you edit notes directly on the host filesystem and need those pushed back up to CouchDB - # (INTERVAL is then the poll period; 15s balances CPU vs sync latency on a large vault). - CHOKIDAR_USEPOLLING: "0" - CHOKIDAR_INTERVAL: "15000" + # BIDIRECTIONAL sync. CouchDB -> notes/ is network-driven (always live) so the AI stack + # (rag-ingestion + memory-vault MCP) reads the vault. disk -> CouchDB lets agents (Hermes / + # Claude) and host edits to notes/ flow UP to CouchDB -> every device. That upward direction + # needs a file WATCHER, but 9p bind mounts emit no inotify events, so it must POLL. Polling + # stats every file each tick (O(files)): at 3s on a ~5k-file vault it pegged a core (~128% CPU + # idle). 60s keeps the agent-write workflow (updates reach CouchDB within a minute) at ~6% CPU. + # Lower INTERVAL = faster sync, more CPU; set USEPOLLING="0" for a read-only (RAG-only) mirror + # at ~0 idle CPU if nothing writes to notes/ on the host side. + CHOKIDAR_USEPOLLING: "1" + CHOKIDAR_INTERVAL: "60000" volumes: # The vault's notes/ subfolder <-> the bridge's storage root. Same MEMORY_VAULT_PATH the # memory-vault MCP (RW) and rag-ingestion (RO) mount, so notes land in the ONE shared vault