简体   繁体   中英

Is it possible to limit amount of queries which user can run daily on Redshift

How to limit amount of queries which user can execute per day on Amazon Redshift ? Or if it possible to limit CPU time of the cluster to some amount?

No, it is not possible to limit users by the number of queries nor the amount of CPU time.

Presumably, you are asking this either because a user is hogging resources, or due to a desire to limit rampant tasks, such as a Dashboard making too many requests and therefore impacting other users.

A couple of options:

Write your own limiter

The STL_QUERY system table contains a list of all queries processed by Redshift, including a User ID, Start Time and End Time.

You could write an application that queries this table to determine whether users have exceeded a number of queries or total CPU time. The application could then disable the user or reduce their permissions.

Use Workload Management

Amazon Redshift can define multiple query queues for handling simultaneous requests. Each queue contains a number of slots . Queries run within a slot.

Users can be assigned to specific query queues such that one user's queries do not interfere with another user's queries.

For example, the Dashboard user could all be assigned to one queue while interactive users could be assigned to a different queue. If the dashboards make too many simultaneous queries, they will queue up for available capacity without impacting the interactive users.

However, this only limits the number of simultaneous queries and the amount of RAM allocated. It will not limit based upon the number of queries nor total CPU used.

You can use Query Queues in Redshift to limit the impact of one set of users queries on other users queries. It seems to be divided by memory but it should be able to do what you want.

Further Reading: Defining Query Queues

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM