本文为您介绍使用 OOceanBase 迁移服务(OceanBase Migration Service,OMS)全量迁移时触发防爆阀值,速度降为 0,项目暂停的原因和解决方法。
适用版本
适用于 OMS V3.3.1 及之前版本。
问题描述
OMS 全量迁移触发防爆阀值,速度降为 0,项目暂停进程,日志提示 sleep 10 秒。如下所示:
860 2022-12-28 22:20:25,194 INFO DefaultDebugPlatform-run-split-4 [SplitJob] - waiting srcTable "SCV"."B_L_DISTRICT_POLICYNO" seq : 129727 run : 128724 cnt : 4198
861 2022-12-28 22:20:25,286 WARN Migrate-139376-writer-0 [OB10Connection] - Get OB10 connection pausing for the minimum free memory limitations, sleep for 10 seconds
862 2022-12-28 22:20:25,322 WARN Migrate-139246-writer-0 [OB10Connection] - Get OB10 connection pausing for the minimum free memory limitations, sleep for 10 seconds
863 2022-12-28 22:20:25,339 WARN Migrate-139325-writer-0 [OB10Connection] - Get OB10 connection pausing for the minimum free memory limitations, sleep for 10 seconds
问题原因
OMS 全量迁移时,写入数据量过大,执行下述语句进行内存防爆检查,空闲内存值班小于该配置,项目暂停 10 秒(limitator.datasource.image.ob10freememory.min 20)。
OceanBase 数据库 MySQL 模式
SELECT 100 - max(round(total/mem_limit*100)) FROM oceanbase.gv$memstore;OceanBase 数据库 Oracle 模式
SELECT 100 - max(round(total/mem_limit*100)) FROM SYS.gv$memstore; ```
另有 CPU 防爆检查 limitator.datasource.image.ob10freecpu.min,CPU 空闲指标小于该配置时便会暂停 10 秒,日志中 grep pausing 可以找到,设置 0,表示关闭 CPU 防爆检查。
| 参数 | 描述 |
|---|---|
| limitator.datasource.image.ob10freememory.min | OceanBase 数据库的内存保护阈值,取值范围为 10~100。该值是 OceanBase 数据库 memstore 内存的空闲百分比。例如,配置 30,表示当空闲内存小于 30% 时,写入数据会暂停等待,程序会等待连接获取,直至空闲内存大于 30%。说明 内存防爆检查只会在数据迁移项目目标端的 OceanBase 数据库上检查。 |
| limitator.datasource.image.ob10freecpu.min | OceanBase 数据库 CPU 防爆检查,新增配置 limitator.datasource.image.ob10freecpu.min=30,默认 CPU 空闲低于 30%,则暂停获取链接。配置 limitator.datasource.image.ob10freecpu.min=0,表示不进行 CPU 防爆检查,CPU 防爆检查逻辑在内存防爆检查逻辑之后。limitator.datasource.image.ob10freememory.min,如果内存防爆已经触发暂停,则不再进行 CPU 防爆检查。仅内存防爆检查无问题或作为源端无内存防爆检查时,才会进行 CPU 防爆检查。 |
解决方法
调整全量防爆阀值,详情请参见上述参数。
增加 OceanBase 数据库租户的内存资源。