DJo
DJo

Reputation: 2177

Switch Redshift WLM parameter group

I have the scenario, during the business hours extreme reporting tasks on Redshift (say database queries, tableau extracts, tableau live connections etc) and in the night the ETL tasks start

Is there any way to switch between the WLM parameter groups on a timely basis, so that during business hours I can have the Reporting WLM parameter group and at night I can have the ETL parameter group?

Upvotes: 1

Views: 1052

Answers (1)

Joe Harris
Joe Harris

Reputation: 14035

Yes, you can do this easily with the AWS CLI. The following example comes from our documentation. https://docs.aws.amazon.com/redshift/latest/mgmt/workload-mgmt-config.html#Configuring-the-wlm-json-configuration-Parameter

You will need to schedule an external tool to run this at the desired times. Consider AWS Lambda for this as it has the ability to schedule executions. https://docs.aws.amazon.com/lambda/latest/dg/tutorial-scheduled-events-schedule-expressions.html

Example:

aws redshift modify-cluster-parameter-group 
--parameter-group-name example-parameter-group 
--parameters
'[
   {
      "ParameterName":"wlm_json_configuration",
      "ParameterValue":"[
         {
            "query_group":["report"],
            "query_group_wild_card":1,
            "query_concurrency":4,
            "max_execution_time":20000,
            "memory_percent_to_use":25
         },
         {
            "user_group":["admin","dba"],
            "user_group_wild_card":0,
            "query_concurrency":5,
            "memory_percent_to_use":40
         },
         {
            "query_concurrency":5,
            "memory_percent_to_use":35
         },
         {
            "short_query_queue": true,
            "max_execution_time": 0
        }
      ]",
      "ApplyType":"dynamic"
   }
]'

Upvotes: 1

Related Questions