Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Headless Mac mini AI server: from toy to production

说明与用途

将 Mac mini 配置为无头 AI 服务器,需要禁用睡眠、使用 launchd 管理进程,并限制 n8n 的并发度。

问题

Running a headless Mac mini as an AI server caused reliability issues—sleep, power management, and lack of proper service orchestration—leading to downtime and debugging headaches.

结果

The Mac mini reliably ran as a background AI server, with no unexpected sleep, stable process restarts, and controlled concurrency for n8n workflows.

工作流

  • 1. Disable system sleep with sudo pmset -a sleep 0 and monitor assertions with pmset -g assertions. 2. Wrap long‑running processes with caffeinate -i to prevent idle sleep. 3. Create a launchd plist (e.g., com.example.aihelper.plist) with ProgramArguments, KeepAlive, WatchPaths, and RunAtLoad. 4. Load the plist using launchctl load or launchctl bootstrap. 5. Tail logs with tail -f /tmp/aihelper.out.log /tmp/aihelper.err.log. 6. Configure n8n concurrency via N8N_CONCURRENCY_PRODUCTION_LIMIT=20 and enable queue mode for production workloads.

证据

If you don't explicitly manage power behavior, you're not running a server. You're running a desktop that occasionally pretends to be one.

来源

A practical pattern is: caffeinate -i ollama serve

来源

Launchd is the real primitive for macOS services

来源

  • 记录日期: 2026-09-21T14:30:36.376Z