4.2.1_CE版本并发控制问题

生产环境 ob4.2.1.0_CE,因ob集群经常被客户端oltp请求,高频并发打到CPU 100%,想在ob服务端限制并发数。
根据文档https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000483076
调整了px_workers_per_cpu_quota=1、以及parallel_servers_target=30后,
1-1-1集群,执行中进程超过200+,似乎限制不住并发线程数
测试过程:
4.2.1.0_CE版本压测下来。可以重现,设置px_workers_per_cpu_quota=1,以及parallel_servers_target=30后,限制似乎未生效
压测步骤:
1、设置业务租户px_workers_per_cpu_quota=1,以及parallel_servers_target=30.

2、确认生效
mysql -htestproxy.db.ctripcorp.com -P55944 -uxxxxx@test#test -A -p
mysql> show parameters like ‘%px_workers_per_cpu_quota%’;
±--------±---------±--------------±---------±-------------------------±----------±------±---------------------------------------------------------------------------------------------------------------------------------------------------------±--------±-------±--------±------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level |
±--------±---------±--------------±---------±-------------------------±----------±------±---------------------------------------------------------------------------------------------------------------------------------------------------------±--------±-------±--------±------------------+
| SHAXY | observer | xxxxxxxxxxxx | 2882 | px_workers_per_cpu_quota | NULL | 1 | the ratio(integer) between the number of system allocated px workers vs the maximum number of threads that can be scheduled concurrently. Range: [0, 20] | TENANT | TENANT | DEFAULT | DYNAMIC_EFFECTIVE |
| SHARB | observer | xxxxxxxxxxxx | 2882 | px_workers_per_cpu_quota | NULL | 1 | the ratio(integer) between the number of system allocated px workers vs the maximum number of threads that can be scheduled concurrently. Range: [0, 20] | TENANT | TENANT | DEFAULT | DYNAMIC_EFFECTIVE |
| SHA-ALI | observer | xxxxxxxxxxxx | 2882 | px_workers_per_cpu_quota | NULL | 1 | the ratio(integer) between the number of system allocated px workers vs the maximum number of threads that can be scheduled concurrently. Range: [0, 20] | TENANT | TENANT | DEFAULT | DYNAMIC_EFFECTIVE |
±--------±---------±--------------±---------±-------------------------±----------±------±---------------------------------------------------------------------------------------------------------------------------------------------------------±--------±-------±--------±------------------+
3 rows in set (0.02 sec)

mysql> show global variables like ‘%parallel_servers_target%’;
±------------------------±------+
| Variable_name | Value |
±------------------------±------+
| parallel_servers_target | 30 |
±------------------------±------+
1 row in set (0.00 sec)

3、开始压测200个并发
4、执行中的任务数量,
mysql> select user,db,command,count() from information_schema.processlist where command<>‘sleep’ group by user,db,command order by count() desc;
±--------±-----------±--------±---------+
| user | db | command | count(*) |
±--------±-----------±--------±---------+
| xxxxx | sysbenchdb | Query | 200 |
±--------±-----------±--------±---------+

补充:1-1-1集群,业务租户规格是30C150G内存.

疑问:按文档设置,似乎没有限制住并发数,不知正确配置方法是?

1 个赞

租户资源给的太大了是吧。。想要限制住资源的使用就调小租户资源规格或者使用cgroup来限制

OceanBase分布式数据库-海量数据 笔笔算数

1 个赞

1、调小Unit 的max_cpu规格,可以有效降低线程数。但这样会有点问题,租户的CPU少了,业务压力波动租户访问容易受影响

2、目前测试 cpu_quota_concurrency/workers_per_cpu_quota,这类租户级别的系统参数,目前还没限制住.
https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000218492

1 个赞

parallel_servers_target我记得这个参数意思是当并发sql超过该值进行串行等待,压测sql都是并发sql么,单线程sql不受影响的

你好,该问题在后续压测仍然存在么

是属于单线程sql,并发请求。同时执行100个insert table_xx (xx)values…,不同表,不同参数.

那该参数parallel_servers_target是不会限制单线程sql,并发请求

1 个赞