| name | clickhouse-rate-limits |
| description | Configure ClickHouse query concurrency, memory quotas, and connection limits.
Use when hitting "too many simultaneous queries", managing concurrent users,
or tuning server-side resource limits so an app never starves the cluster.
Trigger with "clickhouse rate limit", "clickhouse concurrency", "clickhouse quota",
"too many simultaneous queries", "clickhouse connection limit".
|
| allowed-tools | Read, Write, Edit |
| version | 1.7.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","database","analytics","clickhouse","olap"] |
| compatibility | Designed for Claude Code |
ClickHouse Rate Limits & Concurrency
Overview
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.
Prerequisites
- ClickHouse admin access (or Cloud console) to create quotas and settings profiles.
- The
@clickhouse/client Node package for the client-side patterns.
- A rough target for peak concurrent queries and per-query memory.
Instructions
Work top-down: cap resources at the server, then make the client respect the cap.
Step 1: Know the server-side limits
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.
Step 2: Cap resources per user (essential skeleton)
Bind a quota and a settings profile to each application user:
CREATE SETTINGS PROFILE IF NOT EXISTS app_profile
SETTINGS
max_memory_usage = 5000000000,
max_execution_time = 30,
max_concurrent_queries_for_user = 10
TO app_user;
The full quota () plus verification
queries are in .