You can translate the question and the replies:

Resource Manager Query to queue

Hi, Is there a way to automatically send a query to queue if it surprasses for example, 80% of CPU usage? Thank you, Best regards
user
06-02-2020 12:13:14 -0500

3 Answers

Hi, To queue queries if CPU usage is over a certain percentage, I would do the following steps in Resource Manager: 1. Use the **Set maximum number of concurrent queries** feature in [Resource Manager](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/resource_manager/resource_manager). The minimum you can give for the maximum number of concurrent queries is 1. 2. Have the plan execute when CPU usage is equal to or greater than the cutoff percentage (e.g. 80 percent). 3. Create a rule for this plan so that the plan is always effective. In the above scenario, the plan would allow only one query at a time to be executed when CPU usage is at 80 percent or more, while the rest of the queries are queued. You can take a look at the sections ["Defining a Plan"](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/resource_manager/defining_a_plan/defining_a_plan#defining-a-plan) and ["Defining a Rule"](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/resource_manager/defining_a_rule/defining_a_rule) of the Virtual DataPort Administration Guide to learn more about this topic. Hope this helps!
Denodo Team
06-02-2020 20:54:18 -0500
Hi, Useful answer, I have another one about the Resource Manager. Is there a way to limit the CPU usage without affecting the queries with the Resource Manager or any other way? Thank you, Best regards
user
07-02-2020 04:54:29 -0500
Hi, I use Resource Manager to allocate resources and optimize performance in my environment. For example, when a restriction on CPU usage is reached, an action must get triggered to allocate resources accordingly. In the above answer, all of the queries would be executed eventually, but they would just be queued if the CPU usage went over a certain percentage. The server load depends on the number of queries being executed as well as the operations. I would check the queries that have been executed when CPU usage is high and see if they can be optimized. To learn more about query optimization, you can take a look at the following Knowledge Base articles: * ["Best Practices to Maximize Performance I: Modeling Big Data and Analytic Use Cases"](https://community.denodo.com/kb/view/document/Best%20Practices%20to%20Maximize%20Performance%20I:%20Modeling%20Big%20Data%20and%20Analytic%20Use%20Cases?category=Best+practices) * ["Best Practices to Maximize Performance II: Configuring the Query Optimizer"](https://community.denodo.com/kb/view/document/Best%20Practices%20to%20Maximize%20Performance%20II:%20Configuring%20the%20Query%20Optimizer?category=Best+practices) * ["Best Practices to Maximize Performance III: Caching"](https://community.denodo.com/kb/view/document/Best%20Practices%20to%20Maximize%20Performance%20III:%20Caching?category=Best+practices) Hope this helps!
Denodo Team
14-02-2020 21:43:02 -0500
You must sign in to add an answer. If you do not have an account, you can register here