压测clickhouse性能相关参数

背景:

压测ck性能一直上不去,但是ck负载不大。尝试调整参数,验证是否有性能提升

测试参数

1、background_common_pool_size

Sets the number of threads performing background non-specialized operations like cleaning the filesystem etc. for tables with MergeTree engines. Could be increased at runtime and could be applied at server startup from the default profile for backward compatibility.

2 、 max_threads 验证有效

The maximum number of threads to execute the request. By default, it is determined automatically.

3、background_pool_size
Sets the number of threads performing background merges and mutations for tables with MergeTree engines. You can only increase the number of threads at runtime. To lower the number of threads you have to restart the server. By adjusting this setting, you manage CPU and disk load. Smaller pool size utilizes less CPU and disk resources, but background processes advance slower which might eventually impact query performance.

Before changing it, please also take a look at related MergeTree settings, such as number_of_free_entries_in_pool_to_lower_max_size_of_merge and number_of_free_entries_in_pool_to_execute_mutation.

查看参数;

select * from system.settings where name  like '%background_common_pool_size%'

SHOW [CHANGED] SETTINGS LIKE|ILIKE <name>

show settings like '%background_common_pool_size%'

设置参数

SET param = value
set  background_common_pool_size = 128

加个globa执行也没报错 官方文档上没有global参数。但是阿里云dms 需要加上global 才能全局生效

set global background_common_pool_size = 128

https://help.aliyun.com/zh/clickhouse/user-guide/set-parameters-in-the-user-xml-file?spm=a2c4g.11186623.0.0.6bdc5d7fnAdCqs

https://clickhouse.com/docs/zh/sql-reference/statements/set

如果更改配置文件config以后
查询system.settings里面的参数没生效时因为
这里没改是因为system.settings查询的时候值是从user.xml中获取的,所以一直都原来的值,其实生效的是在config.xml里

压测结果:

调整max_thread为120,60,30,15,6,3,1。CPU使用率变化情况如下,其中为3时,CPU使用率达到最高,吞吐量同时最高。调整线程数为60,cpu和吞吐量没有变化,但rt变小。

https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#background_pool_size

https://blog.csdn.net/qq_35423190/article/details/109999576

  • 8
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值