Description:
tar4ibd make too many small block read for free .ibd files. I am xtrabacking on slave database,but the query sql request on slave will much slower while dump ibdata2. Is there some way to reslove it?
for ibdata1,which have data on it,16k block request to os. this is correct.
tar4ibd -d -c ibdata1 |gzip > /bak/a.tar.gz
tar4ibd: using O_DIRECT for the input file.
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util
sda 6.50 0.00 1672.00 0.00 26640.00 0.00 31.87 0.11 0.06 0.06 10.75
12:55:37 PM CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s
12:55:38 PM 18 11.88 0.00 2.97 13.86 0.00 0.99 0.00 70.30 1678.00
for ibdata2,maybe no data on it. you will see 24000 seq read iops to os,which block size is 1kb at all.cpu iowait much higher.
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util
sda 0.00 3.00 24281.00 2.50 24281.00 22.00 2.00 0.82 0.04 0.03 67.80
12:55:10 PM CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s
12:55:11 PM 18 5.05 0.00 40.40 41.41 5.05 8.08 0.00 0.00 24763.00
REPLAY:
dd if=/dev/zero of=a.z count=10000 bs=1024k
strace tar4ibd -d -c a.z|gzip > /bak/a.tar.gz
and you will see
read(3, " \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0 "…, 1024) = 1024
write(1, " \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0 "…, 512) = 512
write(1, " \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0 "…, 512) = 512
read(3, " \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0 "…, 1024) = 1024
write(1, " \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0 "…, 512) = 512
write(1, " \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0 "…, 512) = 512
read(3, " \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0 "…, 1024) = 1024