/clickhouse-pack:clickhouse-rate-limitsfrom clickhouse-pack
Configure ClickHouse query concurrency, memory quotas, and connection limits with client-side patterns to handle 'too many simultaneous queries' and manage concurrent users.
Ships in clickhouse-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
ClickHouse has no REST API rate limits like a SaaS product. Instead it enforces server-side concurrency limits, memory quotas, and per-user settings that control resource usage. This skill configures those server-side limits and pairs them with client-side controls so an application stays within them under load.
@clickhouse/client Node package for the client-side patterns.Work top-down: cap resources at the server, then make the client respect the cap.
The defaults you tune most often:
| Setting | Default | Controls |
|---|---|---|
max_concurrent_queries | 100 | Queries running simultaneously |
max_connections | 4096 | Max TCP/HTTP connections |
max_memory_usage | ~10GB | Per-query memory |
max_execution_time | 0 (unlimited) | Per-query timeout (seconds) |
ClickHouse Cloud's management API (not the query interface) is separately limited to 10 requests per 10 seconds. Full table in references/implementation.md.
Bind a quota and a settings profile to each application user:
CREATE SETTINGS PROFILE IF NOT EXISTS app_profile
SETTINGS
max_memory_usage = 5000000000, -- 5GB per query
max_execution_time = 30, -- 30s timeout
max_concurrent_queries_for_user = 10 -- 10 parallel queries
TO app_user;
The full quota (CREATE QUOTA … FOR INTERVAL 1 HOUR MAX …) plus verification
queries are in references/implementation.md.
Four client-side patterns keep the app inside the server limits — connection
pooling, an app-level concurrency queue (p-queue), retry-with-backoff on
TOO_MANY_SIMULTANEOUS_QUERIES, and insert buffering to avoid TOO_MANY_PARTS.
Each is a drop-in TypeScript snippet in
references/implementation.md, with the
concurrency queue as the smallest starting point:
import PQueue from 'p-queue';
const queryQueue = new PQueue({ concurrency: 5, timeout: 30_000, throwOnTimeout: true });
const rateLimitedQuery = <T>(sql: string) =>
queryQueue.add(async () => (await client.query({ query: sql, format: 'JSONEachRow' })).json<T>());
Watch live concurrency and confirm limits bind with the queries in
references/examples.md (system.processes,
system.metrics, system.query_log, SHOW QUOTAS).
Applying this skill produces:
| Error | Code | Solution |
|---|---|---|
TOO_MANY_SIMULTANEOUS_QUERIES | 202 | Reduce client concurrency or raise max_concurrent_queries; retry with backoff |
MEMORY_LIMIT_EXCEEDED | 241 | Lower max_threads, add query filters, reduce max_memory_usage scope |
TIMEOUT_EXCEEDED | 159 | Increase max_execution_time or optimize the query |
TOO_MANY_PARTS | 252 | Batch inserts via the insert buffer, wait for merges |
The retry wrapper in references/implementation.md treats codes 202, 159, and network errors as retryable.
Three worked end-to-end scenarios live in references/examples.md:
p-queue limiter.queryWithRetry absorbs code-202 bursts
with exponential backoff + jitter instead of returning 500s.TOO_MANY_PARTS — InsertBuffer batches
a firehose into a few large inserts.For security hardening (users, roles, TLS), see the clickhouse-security-basics
skill. For query-level performance work, see clickhouse-performance-tuning.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
clickhouse, rate-limits, concurrency, quotas, client-patterns
24 skills in this plugin
/clickhouse-ci-integrationRun ClickHouse integration tests in CI with GitHub Actions and Docker
containers. Use when setting up automated testing against a real ClickHouse
instance, configuring CI pipelines, or implementing schema validation in CI.
Trigger with "clickhouse CI", "clickhouse GitHub Actions", "clickhouse
integration tests", "test clickhouse in CI", "clickhouse automated testing".
/clickhouse-common-errorsDiagnose and fix the top 15 ClickHouse errors — query failures, insert problems,
memory limits, and merge issues.
Use when a ClickHouse query or insert throws an exception, a server-side error
appears in logs, or a failed query needs root-cause analysis.
Trigger with "clickhouse error", "fix clickhouse", "clickhouse not working",
"debug clickhouse", "clickhouse exception", "clickhouse syntax error".
/clickhouse-core-workflow-aDesign ClickHouse schemas with MergeTree engines, ORDER BY keys, and
partitioning.
Use when creating new tables, choosing an engine, designing sort keys, or
modeling data for analytical workloads on ClickHouse or ClickHouse Cloud.
Trigger with "clickhouse schema design", "clickhouse table design",
"clickhouse ORDER BY", "clickhouse partitioning", "MergeTree table".
/clickhouse-core-workflow-bInsert, query, and aggregate data in ClickHouse with real SQL patterns.
Use when writing analytical queries, inserting data at scale, building
dashboards, or implementing materialized views for pre-aggregation.
Trigger with "clickhouse query", "clickhouse insert", "clickhouse aggregate",
"clickhouse materialized view", "clickhouse SQL".
/clickhouse-cost-tuningOptimize ClickHouse Cloud costs — compute scaling, storage tiering, compression,
and query efficiency for lower bills.
Use when analyzing ClickHouse Cloud bills, reducing storage costs, or optimizing
compute utilization.
Trigger with "clickhouse cost", "clickhouse billing", "reduce clickhouse spend",
"clickhouse pricing", "clickhouse expensive", "clickhouse storage cost".
/clickhouse-data-handlingHandle data lifecycle in ClickHouse — TTL expiration, data deletion (GDPR),
column-level encryption, and audit logging with real ClickHouse SQL.
Use when implementing data retention, fulfilling GDPR/CCPA deletion requests,
or managing sensitive data in ClickHouse.
Trigger with "clickhouse data retention", "clickhouse TTL", "clickhouse GDPR",
"delete data clickhouse", "clickhouse data lifecycle", "clickhouse PII".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin clickhouse-packOther plugins' skills for the same job