Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

Concurrency Scaling

With Concurrency Scaling, you can support virtually unlimited concurrent users and concurrent queries, with consistently fast query performance. When Concurrency Scaling is enabled, Amazon Redshift automatically adds additional cluster capacity when you need it to process an increase in concurrent read queries. Write operations continue as normal on your main cluster. Users always see the most current data, whether the queries run on the main cluster or on a Concurrency Scaling cluster. You're charged for Concurrency Scaling clusters only for the time they’re in use. For more information about pricing, see Amazon Redshift pricing. You manage which queries are sent to the Concurrency Scaling cluster by configuring WLM queues. When you enable Concurrency Scaling for a queue, eligible queries are sent to the Concurrency Scaling cluster instead of waiting in line.

Concurrency Scaling Candidates

Queries are routed to the Concurrency Scaling cluster only when the main cluster meets the following requirements:

  • EC2-VPC platform

  • Node type must be dc2.8xlarge, ds2.8xlarge, dc2.large, or ds2.xlarge

  • Maximum of 32 compute nodes

  • Not a single-node cluster

A query must meet all the following criteria to be a candidate for Concurrency Scaling.

  • The query must be a read-only query.

  • The query doesn’t reference tables that use an interleaved sort key.

  • The query doesn't use Redshift Spectrum to reference external tables.

  • The query doesn’t reference user-defined temporary tables.

Configuring Concurrency Scaling Queues

You route queries to Concurrency Scaling clusters by enabling a workload manager (WLM) queue as a Concurrency Scaling queue. To enable Concurrency Scaling on a queue, set Concurrency Scaling mode to auto. When the number of queries routed to a Concurrency Scaling queue exceeds the queue's configured concurrency, eligible queries are sent to the Concurrency Scaling cluster. When slots become available, queries are run on the main cluster. The number of queues is limited only by the number of queues permitted per cluster. As with any WLM queue, you route queries to a Concurrency Scaling queue based on user groups or by labeling queries with query group labels. You can also route queries by defining WLM Query Monitoring Rules. For example, you might route all queries that take longer than 5 seconds to a Concurrency Scaling queue.

Monitoring Concurrency Scaling

You can see whether a query is running on the main cluster or a Concurrency Scaling cluster by viewing the Amazon Redshift console, navigating to Cluster, and choosing a cluster. Then choose the Queries tab and view the values in the column Executed on to determine the cluster where the query ran.

To find execution times, query the STL_QUERY table and filter on the concurrency_scaling_status column. The following query compares the queue time and execution time for queries run on the Concurrency Scaling cluster and queries run on the main cluster.

SELECT w.service_class AS queue , q.concurrency_scaling_status , COUNT( * ) AS queries , SUM( q.aborted ) AS aborted , SUM( ROUND( total_queue_time::NUMERIC / 1000000,2 ) ) AS queue_secs , SUM( ROUND( total_exec_time::NUMERIC / 1000000,2 ) ) AS exec_secs FROM stl_query q JOIN stl_wlm_query w USING (userid,query) WHERE q.userid > 1 AND q.starttime > '2019-01-04 16:38:00' AND q.endtime < '2019-01-04 17:40:00' GROUP BY 1,2 ORDER BY 1,2;

Concurrency Scaling System Views

A set of system views with the prefix SVCS provide details from the system log tables about queries on both the main and Concurrency Scaling clusters.

The following views have similar information as the corresponding STL tables or SVL views:

The following views are specific to Concurrency Scaling.

For more information about Concurrency Scaling, see the following topics in the Amazon Redshift Cluster Management Guide.