Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大量导数的同时执行info keyspace 1,导致磁盘空间膨胀问题 #1668

Closed
Gjj455 opened this issue Jul 2, 2023 · 2 comments
Closed
Labels

Comments

@Gjj455
Copy link

Gjj455 commented Jul 2, 2023

1、pika 集群情况:
v3.4.0 classic 模式
定时任务设定情况:集群每晚执行一次info keyspace 1 和compact。0点多定时执行info keyspace 1 便于查看 key数量,3点定时开始执行compact。

2、问题现象等描述:
a、导数
从大概19点开始,业务那边有大量导数,在执行set 命令,少量的get 等其他命令。5点左右,重启了 pika实例,同时也导致了导数任务执行中断。
image
由于实例太多,以下以其中一个实例来说明情况。
b、info keyspace 1
从1点半开始执行info keyspace 1
image
c、磁盘空间使用情况
image
当时直接重启了 pika实例释放空间,未观察到是什么文件增长。
d、机器负载
image
image
image

3、错误信息或日志: pika日志无相关有用日志。
rocksdb 日志有点长,看起来有发生stalling write,是不是得调整下compact相关参数了......
LOG_last_1w.log
image
查了一下 大概从22点37分开始
image

4、疑问点:
a、info keyspace 1 与compact 同时执行时,会导致空间使用量迅速增长。但这里只有set和info keyspace 1 命令在同时执行。是什么原因导致磁盘空间涨的这么快?
b、info keyspace 1 为什么执行的这么慢?一个实例大概300GB的数据,竟然执行了3、4小时。以往没有大量导数时,只需15mins。
c、除了重启实例,如何停止info keyspace 1 的执行。重启实例还是会影响业务,有没有优雅一点的方式?( compact也希望可以有什么命令可以手动停止)

5、以后如何避免
大批量导数任务与 info keyspace 1 还有compact 任务 分开执行?
如果空间足够,会到何时释放?需要留多少磁盘空间才合适?

@yaoyinnan yaoyinnan added the bug label Jul 27, 2023
@luky116
Copy link
Collaborator

luky116 commented Sep 2, 2023

监控不足,不好排查问题

@AlexStocks
Copy link
Collaborator

image

info keyspace 1 会触发磁盘读写操作。

是否可以在 Pika 中添加原子变量,每次写操作时执行数值修改,变磁盘操作为内存变量读写。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants