使用pv命令限制SQL文本导入速度
生活随笔
收集整理的這篇文章主要介紹了
使用pv命令限制SQL文本导入速度
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
使用pv命令限制SQL文本導(dǎo)入速度
1.直接導(dǎo)入
[root@mdb01 tmp]# cat test.sql |mysql3306 test02
mysql: [Warning] Using a password on the command line interface can be insecure.
導(dǎo)入期間會(huì)消耗比較大的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參數(shù)限制在100K,其中:
700kiB :已完成數(shù)據(jù)大小
0:00:07:執(zhí)行時(shí)間
[ 100kiB/s] :平均速率
[> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ] ?1%:工作進(jìn)度
ETA 0:06:20:預(yù)估時(shí)間
總結(jié)
以上是生活随笔為你收集整理的使用pv命令限制SQL文本导入速度的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: python实现基于八方向判断的断裂连接
- 下一篇: SQL中除数为0处理情况演示