Vitruvian Penguin
knoppix

[knoppix:1644] gzipが極端に遅いのはなぜ?

Date: Fri, 13 Jun 2003 20:28:52 +0900 (JST)
X-mailer: FreeML Web Mailer XP; SP2
宮脇です。

昨年、Live Linux2を使って作ったソフトのエンハンスをKNOPPIXで行っている
のですが、その中に、2GB弱のパーティションイメージをgzipで圧縮するという
のがあり、その実行速度が極端に遅くて困っています。

実行したコマンドは以下のようなものです。

(mydd if=/dev/hdd3 bs=64512 count=32000 progress=320 
conv=notrunc,noerror,sync | gzip >/mnt/hda1/temp/hdd3.gz) | (while 
read xxxx; do echo $(date '+%Y/%m/%d %T') $xxxx; done)

ここでmyddというのは、ddコマンドにprogressパラメータを追加したもので、
この例では320ブロックコピーする毎にコピーしたブロック数をstderrに出力し
ます。

KNOPPIX 20030415-20030430版で実行すると、以下のようになります。
2003/06/12 17:27:16 Progress: 320 / 32000 ;
2003/06/12 17:27:59 Progress: 640 / 32000 ;
2003/06/12 17:28:23 Progress: 960 / 32000 ;
2003/06/12 17:29:20 Progress: 1280 / 32000 ;
2003/06/12 17:30:53 Progress: 1600 / 32000 ;
2003/06/12 17:32:51 Progress: 1920 / 32000 ;
2003/06/12 17:35:14 Progress: 2240 / 32000 ;
2003/06/12 17:38:03 Progress: 2560 / 32000 ;
2003/06/12 17:41:16 Progress: 2880 / 32000 ;
2003/06/12 17:44:52 Progress: 3200 / 32000 ;
2003/06/12 17:48:39 Progress: 3520 / 32000 ;
2003/06/12 17:53:03 Progress: 3840 / 32000 ;
2003/06/12 17:57:51 Progress: 4160 / 32000 ;
2003/06/12 18:03:04 Progress: 4480 / 32000 ;
2003/06/12 18:08:45 Progress: 4800 / 32000 ;
ここで、あまりの遅さに耐えかねてキャンセルしてしまいました。

Live Linux2でこれを実行すると、
2003/06/13 18:35:38 Progress: 320 / 32000 ;
2003/06/13 18:35:54 Progress: 640 / 32000 ;
2003/06/13 18:36:06 Progress: 960 / 32000 ;
2003/06/13 18:36:22 Progress: 1280 / 32000 ;
2003/06/13 18:36:38 Progress: 1600 / 32000 ;
2003/06/13 18:36:53 Progress: 1920 / 32000 ;
2003/06/13 18:37:10 Progress: 2240 / 32000 ;
2003/06/13 18:37:25 Progress: 2560 / 32000 ;
2003/06/13 18:37:41 Progress: 2880 / 32000 ;
2003/06/13 18:37:56 Progress: 3200 / 32000 ;
2003/06/13 18:38:13 Progress: 3520 / 32000 ;
2003/06/13 18:38:29 Progress: 3840 / 32000 ;
2003/06/13 18:38:45 Progress: 4160 / 32000 ;
2003/06/13 18:39:00 Progress: 4480 / 32000 ;
2003/06/13 18:39:16 Progress: 4800 / 32000 ;
(以下略)
となります。文字通り、桁違いの性能差です。
以前、Red Hat 7.3で似たようなことをやったときも、同様な性能だった覚えが
あります。

どなたか、この性能差の原因に心当たりのある方、お教えいただけると幸いで
す。

ちなみに、使用マシンは、Dell Dimension V400cです。諸元は、
CPU celeron 400MHz、メモリ128MB、IDEはUDMA2までの対応
です。 

参考のため、以下のコマンドの実行結果を下記に貼り付けておきます。
df -T; free; hdparm /dev/hd{a,d}; hdparm -i /dev/hd{a,d}
(ただし、Live Linux2はmyddコマンド実行直後のものですが、KNOPPIXの結果は
KDE起動直後のものです。)

よろしくお願いいたします。


      記

(1) KNOPPIXの場合

# df -T
Filesystem    Type   1K-ブロック    使用   使用可 使用% マウント位置
/dev/root     ext2        1971        52      1919   3% /
/dev/hda1     vfat     4874180   4101576    772604  85% /cdrom
/dev/cloop iso9660     1801452   1801452         0 100% /KNOPPIX
/dev/shm     tmpfs       97580      9212     88368  10% /ramdisk

# free
             total       used       free     shared    buffers     
cached
Mem:        127032     122960       4072          0       3772      
53392
-/+ buffers/cache:      65796      61236
Swap:       329324      19332     309992

# hdparm /dev/hd{a,d}
/dev/hda:
 multcount    = 16 (on)
 I/O support  =  0 (default 16-bit)
 unmaskirq    =  0 (off)
 using_dma    =  1 (on)
 keepsettings =  0 (off)
 nowerr       =  0 (off)
 readonly     =  0 (off)
 readahead    =  8 (on)
 geometry     = 2096/255/63, sectors = 33687360, start = 0
 busstate     =  1 (on)

/dev/hdd:
 multcount    = 16 (on)
 I/O support  =  0 (default 16-bit)
 unmaskirq    =  0 (off)
 using_dma    =  1 (on)
 keepsettings =  0 (off)
 nowerr       =  0 (off)
 readonly     =  0 (off)
 readahead    =  8 (on)
 geometry     = 31013/16/63, sectors = 31261104, start = 0
 busstate     =  1 (on)

# hdparm -i /dev/hd{a,d}

/dev/hda:
 Model=(省略)
 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs 
FmtGapReq }
 RawCHS=16383/16/63, TrkSize=57600, SectSize=600, ECCbytes=40
 BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=33687360
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes: pio0 pio1 pio2 pio3 pio4 
 DMA modes: mdma0 mdma1 mdma2 udma0 udma1 *udma2 
 AdvancedPM=no WriteCache=enabled
 Drive Supports : Reserved : ATA-1 ATA-2 ATA-3 ATA-4 

/dev/hdd:
 Model==(省略)
 Config={ Fixed }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=46
 BuffType=unknown, BuffSize=0kB, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=31261104
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes: pio0 pio1 pio2 pio3 pio4 
 DMA modes: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 udma0 udma1 *udma2 
udma3 udma4 udma5 
 AdvancedPM=yes: unknown setting WriteCache=enabled
 Drive Supports : Reserved : ATA-1 ATA-2 ATA-3 ATA-4 ATA-5 



(2) Live Linux2の場合

# df -T
Filesystem    Type   1k-blocks      Used Available Use% Mounted on
/dev/ram0     ext2        4475      1794      2681  41% /
/dev/hdb   iso9660      639168    639168         0 100% /mnt/cdrom
/dev/hda1     vfat     4874180   4716204    157976  97% /mnt/hda1

# free
             total       used       free     shared    buffers     
cached
Mem:        130636     127520       3116          0      60212      
15800
-/+ buffers/cache:      51508      79128
Swap:            0          0          0

# hdparm /dev/hd{a,d}

/dev/hda:
 multcount    =  0 (off)
 I/O support  =  0 (default 16-bit)
 unmaskirq    =  0 (off)
 using_dma    =  1 (on)
 keepsettings =  0 (off)
 nowerr       =  0 (off)
 readonly     =  0 (off)
 readahead    =  8 (on)
 geometry     = 2096/255/63, sectors = 33687360, start = 0

/dev/hdd:
 multcount    =  0 (off)
 I/O support  =  0 (default 16-bit)
 unmaskirq    =  0 (off)
 using_dma    =  1 (on)
 keepsettings =  0 (off)
 nowerr       =  0 (off)
 readonly     =  0 (off)
 readahead    =  8 (on)
 geometry     = 31013/16/63, sectors = 31261104, start = 0

# hdparm -i /dev/hd{a,d}

/dev/hda:
 Model=(省略)
 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs 
FmtGapReq }
 RawCHS=16383/16/63, TrkSize=57600, SectSize=600, ECCbytes=40
 BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=off
 CurCHS=16383/16/63, CurSects=-66060037, LBA=yes, LBAsects=33687360
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes: pio0 pio1 pio2 pio3 pio4 
 DMA modes: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4 

/dev/hdd:
 Model=(省略)
 Config={ Fixed }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=46
 BuffType=unknown, BuffSize=0kB, MaxMultSect=16, MultSect=off
 CurCHS=16383/16/63, CurSects=-66060037, LBA=yes, LBAsects=31261104
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes: pio0 pio1 pio2 pio3 pio4 
 DMA modes: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 udma0 udma1 *udma2 
udma3 udma4 udma5 
 
以上
<Prev in Thread] Current Thread [Next in Thread>