Presto-[11]-Administration-Resource Groups
来源:互联网 发布:公交卡套淘宝 编辑:程序博客网 时间:2024/05/17 07:01
原文
https://prestodb.io/docs/current/admin/resource-groups.html
Resource groups默认不生效,需要设置experimental.resource-groups-enabled=true
以组(可嵌套)的形式管理查询,组织排队情况
manager来配置resource groups和相关的角色选择,并且这是pluggable的,
添加etc/resource-groups.properties 添加如下内容,可使能一个内嵌的manager,读取JSON配置文件:
resource-groups.configuration-manager=fileresource-groups.config-file=etc/resource_groups.json
修改resource-groups.config-file的值指向一个JSON config file,可以是绝对路径,或相对Presto的相对目录
Resource Group Properties
name
(required): 组名maxQueued
(required): 最大排队查询数,超过该值,新的查询将被拒绝hardConcurrencyLimit
(required):处于运行中状态的最大查询数softMemoryLimit
(required): 在接收一个新查询排队前该组可能使用的最大分布内存 ,可以是绝对值如1GB,或集群内存比例
softCpuLimit (optional): 该组周期性(see
cpuQuotaPeriod
)使用CPU time 的最大值hardCpuLimit
(optional): 该组周期性(seecpuQuotaPeriod
)使用CPU time 的最大值schedulingPolicy
(optional): 标识如何调度查询,子组合适符合条件来启动他们的查询,可以是下面的3值之一:fair
(default): 排队中的查询以first-in-first-out形式调度,如果子组中有排队,轮流执行 .weighted
: 依据优先级权重执行 (通过query_priority指定
session property). 子组依据schedulingWeight
.参数被调度query_priority
: 所有的子组必须设置优先级query_priority
. Queued queries 严格按照优先级被选中执行.
schedulingWeight
(optional): weight of this sub group. See above. Defaults to1
.jmxExport
(optional): If true, group statistics are exported to JMX for monitoring. Defaults tofalse
.queuedTimeLimit
(optional): maximum amount of time a query may be in the queue for this group before it is marked as failed.runningTimeLimit
(optional): maximum amount of time a query in this group can execute (not including queued time) before it is marked as failed.subGroups
(optional): list of sub groups.
Selector Properties
user
(optional): regex to match against user name. Defaults to.*
source
(optional): regex to match against source string. Defaults to.*
queryType (optional): string to match against the type of the query submitted.
query type :
DATA_DEFINITION: Queries that alter/create/drop the metadata of schemas/tables/views, and that manage prepared statements, privileges, sessions, and transactions.
DELETE: DELETE queries.
DESCRIBE: DESCRIBE, DESCRIBE INPUT, DESCRIBE OUTPUT, and SHOW queries.
EXPLAIN: EXPLAIN queries.INSERT: INSERT and CREATE TABLE AS SELECT queries.
SELECT: SELECT queries.
group
(required): 这些查询运行的组.
Global Properties
cpuQuotaPeriod
(optional): cpu quotas 强制period
Selectors被有序执行,首个匹配的将被应用。下面的配置有5个resource group templates,adhoc_${USER}
group, ${USER}
会把submitted中的用户名替代进去,${SOURCE}也类似,source name can be set as follows
- CLI: use the
--source
option.- JDBC: set the
ApplicationName
client info property on theConnection
instance.
有3个selectors定义那些queries在那些resource group中运行
- The first selector places queries from
bob
into the admin group.- The second selector states that all data definition queries that come from a source that includes “pipeline” should run in the user’s personal data definition group, which belongs to the
globa.data_definition
parent group.- The third selector states that all queries that come from a source that includes “pipeline” should run in the user’s personal pipeline group, which belongs to the
global.pipeline
parent group.- The last selector is a catch all, which puts all queries into the user’s adhoc group.
All together these selectors implement the policy that bob
is an admin and all other users are subject to the following limits:
- Users are allowed to have up to 2 adhoc queries running. Additionally, they may run one pipeline.
- No more than 5 “pipeline” queries may run at once.
- No more than 100 total queries may run at once, unless they’re from the admin.
{ "rootGroups": [ { "name": "global", "softMemoryLimit": "80%", "hardConcurrencyLimit": 100, "maxQueued": 1000, "schedulingPolicy": "weighted", "jmxExport": true, "subGroups": [ { "name": "data_definition_${USER}", "softMemoryLimit": "10%", "hardConcurrencyLimit": 3, "maxQueued": 10, "schedulingWeight": 1 }, { "name": "adhoc_${USER}", "softMemoryLimit": "10%", "hardConcurrencyLimit": 2, "maxQueued": 1, "schedulingWeight": 9, "schedulingPolicy": "query_priority" }, { "name": "pipeline", "softMemoryLimit": "20%", "hardConcurrencyLimit": 5, "maxQueued": 100, "schedulingWeight": 1, "jmxExport": true, "subGroups": [ { "name": "pipeline_${USER}", "softMemoryLimit": "10%", "hardConcurrencyLimit": 1, "maxQueued": 100, "schedulingPolicy": "query_priority" } ] } ] }, { "name": "admin", "softMemoryLimit": "100%", "hardConcurrencyLimit": 200, "maxQueued": 100, "schedulingPolicy": "query_priority", "jmxExport": true } ], "selectors": [ { "user": "bob", "group": "admin" }, { "source": ".*pipeline.*", "queryType": "DATA_DEFINITION", "group": "global.data_definition_${USER}" }, { "source": ".*pipeline.*", "group": "global.pipeline.pipeline_${USER}" }, { "group": "global.adhoc_${USER}" } ], "cpuQuotaPeriod": "1h"}
- Presto-[11]-Administration-Resource Groups
- Presto-[8]-Presto Administration-web interface
- Presto-[9]-Administration-Tuning Presto & Properties Reference
- Presto-[10]-Administration-Spill to Disk
- Xcode resource groups and folder references when building for iPhone
- Groups
- groups
- [Presto]什么是Presto
- [Presto]部署运行Presto
- Presto学习-presto介绍
- Presto-[7]-Presto Security
- Hello Presto
- presto编译
- presto 文档
- 初识presto
- presto hbase
- Presto随笔
- Presto必知必会
- POJ
- 数据结构课程设计——学生信息管理系统
- spring工厂方法配置bean及spEl
- apache http与https配置
- 数据挖掘十大算法之一决策树算法C4.5
- Presto-[11]-Administration-Resource Groups
- VERO WorkXplore 3D(CAD数据浏览分析软件)v4.1.1下载附安装教程
- JAVA基础: HashSet\TreeSet
- 基于stm32 Systick 的简单定时器(裸机)-- 数组实现
- 基于STM32F769I-DISCO开发板实现Embedded Wizard界面应用入门指南
- dubbo分布式项目常见的异常及处理方法
- No Identifier specified for entity的解决办法
- 事务声明声明式事务和编程式事务介绍
- hibernate-jpa拦截器使用