duyet/clickhouse-monitoring · Archived

clickhouse-best-practices

Production operational practices: insert batching, async writes, query cache, connection pooling, and recommended settings.

First seen Apr 19, 2026

Installation

$ npx skills add duyet/clickhouse-monitoring --skill clickhouse-best-practices

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from duyet/clickhouse-monitoring.

npx skills add duyet/clickhouse-monitoring

Browse all from duyet/clickhouse-monitoring

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 241
License LICENSE
Default branch main
Open issues 5
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,749 B
  • docs SUMMARY.md 156 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 3 installs

SKILL.md

ClickHouse Best Practices

Insert Best Practices

  • Batch 10k-100k rows per insert; max 1-2 inserts/sec per table
  • Sub-1k-row inserts cause part proliferation; insert in sorting-key order to reduce merge work
  • For bulk loads, tune mininsertblocksizerows / maxinsertblocksizerows

Async Inserts

  • SET asyncinsert = 1; SET waitforasyncinsert = 1; (1=durable, 0=fire-and-forget)
  • Tune asyncinsertmaxdatasize (1M) and asyncinsertbusytimeoutms (10s) for batch window

Query Cache (v23.5+)

  • SET allowexperimentalquerycache = 1; SET usequery_cache = 1;
  • TTL: querycachettl; share across users: querycachesharedbetweenusers = 1
  • Control: enablewritestoquerycache, enablereadsfromquerycache

Connection Pooling

  • HTTP: set poolsize, maxqueries; keep-alive is critical
  • TCP: built-in multiplexing; tune max_connections
  • Monitor system.metrics for HTTPConnection/TCPConnection to size pools

Production Settings

  • maxthreads — lower for concurrent loads; maxinsert_threads — raise for parallel inserts
  • maxexecutiontime / maxmemoryusage — per-query limits
  • joinalgorithm — prefer gracehash or auto for large joins
  • inputformatallowerrorsnum / ratio — tolerate parse errors in bulk imports

Query Patterns

  • COLUMNS('pattern') — regex column selection; APPLY func transforms matches
  • clusterAllReplicas('cluster') — aggregate across all replicas
  • FINAL — force merge for ReplacingMergeTree; use sparingly (full scan)