Doris workload group实战

1.创建测试用户:创建一个用户名为test,密码为test 的用户:

bash 复制代码
create user 'test'@'%' IDENTIFIED  BY 'test';
  1. 给测试用户赋权:给用户test赋予数据库test.* 权限
bash 复制代码
grant SELECT_PRIV,LOAD_PRIV,CREATE_PRIV,ALTER_PRIV ON test.* TO test;
  1. 开启 experimental_enable_workload_group 配置项,在fe.conf中添加如下设置,并重启FE:
bash 复制代码
experimental_enable_workload_group=true
  1. 开启pipline,workload_group只在新优化器上生效
bash 复制代码
set experimental_enable_pipeline_engine = true;
  1. 创建workload group
bash 复制代码
create workload group if not exists test_query
properties (
    "cpu_share"="10",
    "memory_limit"="10%",
    "enable_memory_overcommit"="true",
    "max_concurrency" = "1",
    "max_queue_size" = "2",
    "queue_timeout" = "3000"
);

6.给用户赋予WORKLOAD权限

bash 复制代码
GRANT USAGE_PRIV ON WORKLOAD GROUP 'test_query' TO 'test'@'%';
  1. 使用test用户登录mysql客户端端
bash 复制代码
mysql -utest -h127.0.0.1 -P9030 -ptest
  1. 设置test用户默认workload_group 为test_query,如果不设置默认是normal
bash 复制代码
set property 'default_workload_group'='test_query';
  1. 使用test执行并发查询。验证workload group功能。发现当并发超过2后会报ERROR : errCode = 2, detailMessage = queue failed, reason=query waiting queue is full, queue length=2
bash 复制代码
mysqlslap -h127.0.0.1 -P9030 -utest --concurrency=300 --iterations=1 --create-schema=test --query=test.sql
相关推荐
IT项目管理1 小时前
达梦数据库DMHS介绍及安装部署
linux·数据库
你都会上树?1 小时前
MySQL MVCC 详解
数据库·mysql
大春儿的试验田1 小时前
高并发收藏功能设计:Redis异步同步与定时补偿机制详解
java·数据库·redis·学习·缓存
Ein hübscher Kerl.2 小时前
虚拟机上安装 MariaDB 及依赖包
数据库·mariadb
醇醛酸醚酮酯2 小时前
Qt项目锻炼——TODO清单(二)
开发语言·数据库·qt
GreatSQL社区3 小时前
用systemd管理GreatSQL服务详解
数据库·mysql·greatsql
掘根3 小时前
【MySQL进阶】错误日志,二进制日志,mysql系统库
数据库·mysql
weixin_438335403 小时前
基础知识:mysql-connector-j依赖
数据库·mysql
小明铭同学3 小时前
MySQL 八股文【持续更新ing】
数据库·mysql
Mr_Xuhhh3 小时前
信号与槽的总结
java·开发语言·数据库·c++·qt·系统架构