使用pv命令限制SQL文本导入速度

来源:这里教程网 时间:2026-03-01 15:43:59 作者:

使用pv命令限制SQL文本导入速度

1.直接导入[root@mdb01 tmp]# cat test.sql |mysql3306 test02mysql: [Warning] Using a password on the command line interface can be insecure.导入期间会消耗比较大的CPU

2.pv限速[root@mdb01 tmp]# pv -L100K test.sql | mysql3306 test02      mysql: [Warning] Using a password on the command line interface can be insecure.700kiB 0:00:07 [ 100kiB/s] [>                                     ]  1% ETA 0:06:20

pv限速之后,消耗资源明显减少,-L参数限制在100K,其中:700kiB :已完成数据大小0:00:07:执行时间[ 100kiB/s] :平均速率[>                                     ]  1%:工作进度ETA 0:06:20:预估时间

相关推荐