fix(clickhouse): harden R/W path P0–P3 (cleanup, durability, rollups)

Honest TTL cleanup semantics; enqueue-safe dedup with flush retry and writer
metrics; model insert hooks; latest-per-node and hourly metric/openresty
rollups; small-host pool/async defaults, traffic hourly TTL, and UV labeling.
This commit is contained in:
ryan
2026-07-10 10:34:04 +08:00
parent 9b3555c569
commit 160e63558f
37 changed files with 1779 additions and 269 deletions
+5 -3
View File
@@ -99,6 +99,8 @@ otel:
# ─── ClickHouse (required) ──────────────────────────────────────────────────────
# Client pool sized for small control-plane hosts (e.g. 3c6g). Raise only if
# concurrent analytics queries and writers regularly exhaust the pool.
clickhouse:
enabled: true
hosts:
@@ -106,8 +108,8 @@ clickhouse:
username: "default"
password: "123456"
database: "openflare"
max_idle_conn: 20
max_open_conn: 50
max_idle_conn: 8 # keep warm sockets low to save client + server RAM
max_open_conn: 16 # cap concurrent native sessions on modest CH boxes
conn_max_lifetime: 3600
dial_timeout: 5
block_buffer_size: 100
block_buffer_size: 32 # rows buffered per block; 32 is enough for our batch sizes