I have shell file like this:
grep 'INSERT INTO container' $file | mysql database -f
Problem I have is MySQL gets too many inserts and it slow down a lot (database is mostly read-only and this is only insert).
I want to have something that can slow down the speed / control pipe "bandwidth", similar to this one:
grep 'INSERT INTO container' $file | gzip -9 | gunzip | mysql database -f
Here gzip -9 | gunzip
will slow down the process and pressure to MySQL will be low.
pv
command happen to have abilities like this, but it is interactive command. I am looking for something non-interactive.
sleep
is better thangzip -9 | gunzip
?