生产环境 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内存.
疑问:按文档设置,似乎没有限制住并发数,不知正确配置方法是?