infrastructure

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 3cc676cc3c5b4a0735dd0988040ba2d14726052e
parent c02cce60cba446954a11de3e48038fd0d27939e7
Author: Silas Brack <silasbrack@gmail.com>
Date:   Sat,  4 Jul 2026 14:03:17 +0200

fix: add swap to helios, reduce ClickHouse memory to 500MB

Helios only has 2GB RAM and no swap — ClickHouse was getting
OOM-killed under load. Add 2GB swapfile and cap ClickHouse at
500MB to coexist with other services.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Diffstat:
Mhosts/helios.nix | 5+++++
Mmodules/clickhouse-logs.nix | 2+-
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/hosts/helios.nix b/hosts/helios.nix @@ -48,6 +48,11 @@ device = "/dev/sdb"; fsType = "ext4"; }; + swapDevices = [{ + device = "/var/lib/swapfile"; + size = 2048; + }]; + nix.gc = { automatic = true; dates = "weekly"; diff --git a/modules/clickhouse-logs.nix b/modules/clickhouse-logs.nix @@ -74,7 +74,7 @@ in <listen_host>${cfg.vpnAddress}</listen_host> <http_port>8123</http_port> <tcp_port>9000</tcp_port> - <max_server_memory_usage>1000000000</max_server_memory_usage> + <max_server_memory_usage>500000000</max_server_memory_usage> </clickhouse> ''; };