One tenant’s bulk import is exceeding the ingestion budget, but the shared ClickHouse instance still needs to accept other tenants’ data.
Fastest safe approach: use the ClickHouse 26.10 written_rows quota to cap rows attributed to a user over an interval. Pair it with byte or query limits when those measure a separate risk. Before production, test the account mapping, rejection behavior, and usage reporting with representative imports; this quota does not isolate CPU, memory, or disk.
This guide is for DBAs operating self-hosted, multi-tenant ClickHouse and for data-platform teams controlling continuous ingestion. It is also relevant to SaaS leads deciding whether account-level limits are enough for a shared database.
Last updated November 17, 2026. Version and quota details checked against the ClickHouse 26.10 release notes, the current CREATE QUOTA reference, and the system-table documentation cited below.
Start with the limit the workload actually needs
ClickHouse 26.10 adds written_rows to quota controls. The release notes show the capability and an example; use the documentation and your target build to confirm the supported syntax and behavior before deploying it. Do not treat a release example’s limit as a production recommendation. The 26.10 release notes are the version-specific starting point.
A row limit answers a particular question: how many rows may a quota identity write during the configured interval? It does not directly tell you how many bytes those rows occupy, how many insert requests an application made, or how much server capacity the import consumed.
| Control | What it measures | When it helps | What it does not establish |
|---|---|---|---|
written_rows |
Rows attributed to the quota identity | Bounding row-count ingestion for users or roles | Data size, CPU time, memory use, or disk capacity |
written_bytes |
Written data volume, where supported by the target build | Bounding volume when row widths vary | A fixed row count or a guarantee about resource use |
| Query or insert-request counts | Requests processed under the relevant quota setting | Limiting request frequency or repeated small submissions | How much data each request contains |
Treat the three as separate controls. A narrow event row and a wide event row each count as a row, even though their storage and processing costs can differ. Likewise, one bulk insert and many small inserts can deliver the same total number of rows through very different request patterns.
Important: A quota is an ingestion policy, not resource isolation. A user below its row limit can still run expensive queries or compete for memory and disk with other work.
The decision is straightforward: use written_rows when row count is the policy you need to enforce. Add another control only when it addresses a distinct risk. If the requirement is to protect hardware capacity, plan resource limits and workload isolation separately.
Shared tenant accounts need an identity audit first
A quota only helps when ClickHouse attributes activity to the identity the team intends to control. Start by tracing the credentials used in production: application services, scheduled imports, analysts, and administrative jobs may not use the same account.
If several tenants connect through one shared ClickHouse user, a per-user quota sees that shared identity rather than each business tenant. One tenant’s imports may consume the common allowance, or the aggregate account may exceed it even though no individual tenant appears excessive. Decide whether the policy belongs to a user, a role, or another supported quota key, then check that each client actually connects under that identity.
The official CREATE QUOTA syntax and settings reference describes how quotas are defined and assigned. Treat the following as a configuration shape, not copy-and-paste SQL. Replace placeholders, confirm the exact syntax for the installed build, and check the required privileges:
CREATE QUOTA tenant_ingest_quota
FOR INTERVAL <count> <unit>
MAX written_rows = <measured_row_limit>
TO <target_user_or_role>;
Before applying the quota, record the identity and intended interval in the deployment change. Then verify the created definition through the supported administrative interface, such as the relevant SHOW CREATE statement where available. The important checks are whether the quota attaches to the intended principal, whether the interval matches the policy, and whether the setting is recognized by the target version.
For deployments with role-based access, test the role assignment rather than assuming that a user’s effective permissions imply the quota applies as expected. For systems with service accounts, avoid reusing an administrator credential for ingestion. Separate identities make usage attribution, incident review, and later limit changes easier to reason about.
Continuous event feeds need both row and volume thinking
For streaming or frequent micro-batch ingestion, written_rows can put a boundary on row count per interval. But row width can change with optional fields, payload formats, schema evolution, or tenant-specific data. The same number of rows may therefore represent substantially different bytes and downstream storage work.
Build the limit from observed collection records rather than a universal threshold. Sample representative periods, including normal traffic and the peaks the service is expected to accept. For each sample, record rows, bytes, insert frequency, and the relevant tenant identity. Calculate the relationship between rows and bytes for each workload class; do not assume one average remains valid after a schema or payload change.
If byte volume is also a policy concern, evaluate written_bytes alongside written_rows on the target build. The row control can cap record count while a byte control addresses unusually wide records. An insert-count limit may also be relevant when a client sends excessive tiny batches. Avoid stacking settings simply because they exist: each limit needs an owner, a rationale, and a tested response path.
ClickHouse’s asynchronous inserts documentation describes a separate insert path that teams may use for event ingestion. If asynchronous inserts, distributed writes, or materialized views are part of the actual route, test that route rather than inferring its accounting from a direct synchronous insert. Configuration and usage semantics should be verified against the installed version and the exact pipeline.
For capacity planning, relate the ingestion records to the server’s memory, CPU, and NVMe requirements. A quota does not reserve disk space or prevent a busy import from affecting concurrent queries. If the workload is approaching the machine’s capacity, reduce or partition the ingestion load, change the resource plan, or separate workloads; raising a row cap alone does not create more capacity.
Batch imports need a controlled over-limit test
Bulk imports are where a quota’s operational behavior becomes visible. A rejected batch can interact with application retries, checkpoints, and deduplication. Do not assume that a quota rejection means the whole source file was processed or that a retry is safe. The outcome depends on the insert method and client logic.
Run the test in an isolated environment with a disposable identity and representative data. Compare a batch that stays below the configured limit, one close to it, and one designed to cross it. Keep the source records and import procedure consistent so the results are comparable. Record:
- The ClickHouse user or role that performed the insert.
- The quota definition and interval active during the test.
- The client-visible error or completion status.
- Whether the application retried, paused, or marked the batch complete.
- The resulting row count and any duplicate or missing records.
- The quota usage reported before and after each attempt.
Test the application’s retry policy explicitly. A client that retries a rejected request without changing the batch may repeat the same failure. A client that marks a partially handled batch as complete may lose records. Use the application’s own idempotency and checkpoint design to determine the safe recovery step; the quota does not supply that logic.
Do not generalize one test result into a guarantee for every multi-threaded import, distributed write, or multi-target workflow. Repeat the validation for the paths that matter in production. For each path, document whether the client should split the batch, wait for a new interval, route the work to another approved identity, or stop for operator review.
Verify usage before making the limit a production control
A configured quota is not proof that the intended user is being counted. After a controlled import, inspect the quota usage tables and compare the identity, interval, and counters with the test record. Start with the system.quotas_usage reference, which documents the table used to inspect quota usage. Use SELECT * for initial schema discovery if you are unsure which columns the installed build exposes:
SELECT *
FROM system.quotas_usage;
Then narrow the inspection using the columns present in that version. Avoid hard-coding a query based on a different release’s schema. The related system.quota_usage reference and system.quota_limits reference can help distinguish usage records from configured limits; check which table and fields apply to the target build.
Use a short verification sequence before enabling enforcement:
- [ ] Confirm the running ClickHouse version and the quota syntax it supports.
- [ ] Confirm the exact user or role used by the production ingestion client.
- [ ] Create a test quota with a limit derived from your own collection records.
- [ ] Submit controlled imports below, near, and beyond the boundary.
- [ ] Compare client responses, final data, and quota usage for each import.
- [ ] Repeat with asynchronous, distributed, or materialized-view paths if production uses them.
- [ ] Decide how the application will pause, split, retry, or alert on rejection.
- [ ] Record the rollback action and the owner who can change the limit.
This checklist is the release gate, not a substitute for ongoing monitoring. After rollout, alert on usage approaching the configured boundary and review changes to row width, tenant mix, import frequency, and schema. Re-evaluate the policy when any of those change.
Translate the policy into a server and recovery plan
A row limit controls one dimension of ingestion. The operational plan still needs to account for query concurrency, memory pressure, CPU use, disk consumption, and retention. Review real import and query records together before deciding whether a shared instance remains appropriate.
| Observed workload condition | Quota response | Infrastructure or operations response |
|---|---|---|
| Row count is the tenant policy | Set written_rows for the intended identity and interval |
Monitor actual usage and review the limit when tenant behavior changes |
| Row widths vary materially | Pair row controls with a tested byte-volume policy where supported | Track bytes and storage growth from representative data |
| Import requests are frequent and small | Consider a request-count control if it addresses a defined risk | Review batching and client retry behavior |
| Imports compete with interactive queries | A row cap alone is insufficient | Measure resource contention and consider workload separation |
| Data loss would be unacceptable | A quota offers no recovery protection | Use replication or software RAID where appropriate and keep backups off the server |
There is no hardware RAID in the product configuration described for this service. A database deployment must therefore plan its own redundancy, such as software RAID or replication, and must keep backups off-machine. A write quota is not a backup, a replica, or a recovery test. Run restore exercises and verify that backups can be recovered independently of the database host.
For a resource review before deployment, compare the workload’s measured row widths, peak import pattern, query mix, and recovery requirements with the available server configuration. The cloudgbps server specifications and configuration options are the appropriate places to check current published capabilities; do not infer performance from a quota setting. If recurring capacity or billing assumptions affect the decision, review how server billing works alongside the workload estimate.
FAQ
How do I cap rows written by each ClickHouse user?
Create a quota for the intended interval, set its written_rows maximum, and assign it to the user or role that actually performs inserts. Before applying it to production identities, confirm the account mapping and DDL syntax on the exact ClickHouse build. Then test a representative import and inspect the quota usage tables to confirm attribution.
When should I use written_rows instead of written_bytes?
Use written_rows when the control objective is the count of inserted rows, such as limiting how much each tenant can submit in an interval. Use written_bytes when the concern is volume by bytes. Because row width varies, neither is a reliable substitute for the other; measure your own data and combine limits if both count and volume matter.
What happens when an insert reaches its quota?
The quota can reject work that exceeds the configured limit, but the application-visible result depends on the insert path and how the client submits, retries, or batches data. Test below, near, and beyond the limit in an isolated environment. Record the server response, client behavior, retry outcome, and final row counts before defining production handling.
How can I check ClickHouse quota usage?
Start by inspecting system.quotas_usage on the target build, then compare the quota identity, interval, and counters with the expected import activity. Check the current documentation for the table schema and use system.quota_usage or related quota tables only when they apply to your version. Validate the result with a controlled insert rather than relying on configuration alone.
If the isolated test confirms that account attribution, rejection handling, and usage monitoring match the policy, roll out the quota with a documented rollback path. If the measured ingestion and query load also points to recurring contention, compare the shared-hosting arrangement with a dedicated AMD physical server: shared CPU contention, variable neighbor workloads, and storage or bandwidth charges can complicate predictable database operations. A dedicated server is worth assessing when the workload needs sustained, exclusive resources and a configuration matched to its measured data path—not as a substitute for replication, off-host backups, or restore drills. Check cloudgbps’s current database server options against your own ingestion and recovery records before choosing.
Frequently asked questions
How do I cap rows written by each ClickHouse user?
Create a quota for the intended interval, set its written_rows maximum, and assign it to the user or role that actually performs inserts. Before applying it to production identities, confirm the account mapping and DDL syntax on the exact ClickHouse build. Then test a representative import and inspect the quota usage tables to confirm attribution.
When should I use written_rows instead of written_bytes?
Use written_rows when the control objective is the count of inserted rows, such as limiting how much each tenant can submit in an interval. Use written_bytes when the concern is volume by bytes. Because row width varies, neither is a reliable substitute for the other; measure your own data and combine limits if both count and volume matter.
What happens when an insert reaches its quota?
The quota can reject work that exceeds the configured limit, but the application-visible result depends on the insert path and how the client submits, retries, or batches data. Test below, near, and beyond the limit in an isolated environment. Record the server response, client behavior, retry outcome, and final row counts before defining production handling.
How can I check ClickHouse quota usage?
Start by inspecting system.quotas_usage on the target build, then compare the quota identity, interval, and counters with the expected import activity. Check the current documentation for the table schema and use system.quota_usage or related quota tables only when they apply to your version. Validate the result with a controlled insert rather than relying on configuration alone.
AMD EPYC 7543P Dedicated Server
From $455.2/month
