“Quota exceeded” means the session, user, or role has consumed more resources than allowed by the assigned ClickHouse quota rules.
The engine fires this error when a query would surpass limits defined in CREATE QUOTA or ALTER QUOTA. Counters include queries, errors, read/write rows, or execution time.
Query the system.quotas_usage
and system.quotas
tables. They show remaining allowance and the exact interval that was breached.
Use CREATE QUOTA
. Define time intervals (second, minute, hour, day, month) and maximum counts per metric.Apply the quota to one or more roles.
Run ALTER QUOTA
to add, change, or drop limits without disconnecting users. Changes take effect immediately.
Create a ROLE, grant it to users, then attach the quota to that role.Quotas always work through roles—even if it is the automatically created role = user name.
Set generous read limits for analytics, strict write limits for ingestion, and isolate automated jobs in their own roles.Monitor system.quotas_usage
daily.
The example below caps SELECT result rows for the api_consumer
role to one million every 24 hours, protecting production capacity.
Counters reset automatically at the end of each interval.To unblock immediately, broaden the limit with ALTER QUOTA or move the user to a different role.
If a user still sees the error after limits were raised, make sure the session’s current_roles
list includes the updated role and that distributed_ddl_task
has finished propagating.
.
Yes. Use ALTER QUOTA … REMOVE LIMITS; or detach the role from the user session with SET ROLE NONE.
Yes. Distributed DDL ensures all replicas share the same counters. Use ON CLUSTER clause when creating or altering quotas.
You can cap queries, errors, result_rows, read_rows, and execution_time for any interval from seconds to months.