[opensuse] 10.1,10.2 usb drive, external harddisk: bad performancewith ext3 or reiser
Hi, I have a problem getting the performance up when writing to an external harddisk, connected via usb 2.0. It shows when doing: i) cp file_from_local_sata_hdd to_usb_hdd_formatted_with_ext3fs_or_reiserfs ii) tar -xf file_from_local_sata_hdd -C/directory_on_usb_hdd_formatted_with_ext3fs_or_reiserfs iii) dd if=file_from_local_sata_hdd of=to_usb_hdd_formatted_with_ext3fs_or_reiserfs iv) all other stuff that incorporates writing to the disk, like creating encfs-files on it or trying to setup an encrypted loop device with yast on it. It shows on both opensuse 10.1 and 10.2, on a dual core centrino notebook (lenovo x60s) as well as on a dual core pentium desktop. No patched or self-built kernel or -modules are installed, all is pretty and default exept that all the latest packages from guru and packman are installed via smart. Performance figures look like this: CASE 1, writing onto the local sata disk:
dd if=/dev/zero of=tmp.txt count=1000 1000+0 records in 1000+0 records out 512000 bytes (512 kB) copied, 0.012393 seconds, 41.3 MB/s
CASE 2, "default" writing to the usb hdd, one can replace dd with cp or tar at will, the figures stay the same:
dd if=/dev/zero of=/media/usbdisk/tmp/tmp.txt count=1000 1000+0 records in 1000+0 records out 512000 bytes (512 kB) copied, 3.26417 seconds, 157 kB/s
CASE 3, notice the increased bs:
dd if=/dev/zero of=/media/usbdisk/tmp/tmp.txt count=4 bs=128K 4+0 records in 4+0 records out 524288 bytes (524 kB) copied, 0.033982 seconds, 15.4 MB/s
CASE 3 is what i would be expecting and what also what I get when writing to a fat32-partition on the external usb hdd. This also implies IMHO that there is nothing wrong with my usb-setup as suggested in various other postings regarding usb-performance. Here is an output regarding the usb-modules:
lsmod | grep hci ehci_hcd 34696 0 uhci_hcd 26892 0 usbcore 115024 3 usbhid,ehci_hcd,uhci_hcd
As suggested in http://marc.abramowitz.info/archives/2007/02/17/getting-good-performance-out... I also tried fiddling with the value of /sys/block/sdX/device/max_sectors but with no significant success... I have created the ext3 and reiser partitions on the usb hdd with the yast partitioner, basically leaving everything at default settings. Any hints on where else to look for the cause of this poor performance? My workaround right now is to "copy" with: tar -cf - file_from_local_sata_hdd | tar -xf - -b2000 -C/directory_on_usb_hdd_ext3fs_or_reiserfs I am using -b2000 hereby to be able to do larger blocksized writes. Regards, Franz.
Franz Petri wrote:
Hi,
I have a problem getting the performance up when writing to an external harddisk, connected via usb 2.0.
It shows when doing: i) cp file_from_local_sata_hdd to_usb_hdd_formatted_with_ext3fs_or_reiserfs ii) tar -xf file_from_local_sata_hdd -C/directory_on_usb_hdd_formatted_with_ext3fs_or_reiserfs iii) dd if=file_from_local_sata_hdd of=to_usb_hdd_formatted_with_ext3fs_or_reiserfs iv) all other stuff that incorporates writing to the disk, like creating encfs-files on it or trying to setup an encrypted loop device with yast on it.
It shows on both opensuse 10.1 and 10.2, on a dual core centrino notebook (lenovo x60s) as well as on a dual core pentium desktop. No patched or self-built kernel or -modules are installed, all is pretty and default exept that all the latest packages from guru and packman are installed via smart.
Performance figures look like this:
CASE 1, writing onto the local sata disk:
dd if=/dev/zero of=tmp.txt count=1000 1000+0 records in 1000+0 records out 512000 bytes (512 kB) copied, 0.012393 seconds, 41.3 MB/s
CASE 2, "default" writing to the usb hdd, one can replace dd with cp or tar at will, the figures stay the same:
dd if=/dev/zero of=/media/usbdisk/tmp/tmp.txt count=1000 1000+0 records in 1000+0 records out 512000 bytes (512 kB) copied, 3.26417 seconds, 157 kB/s
CASE 3, notice the increased bs:
dd if=/dev/zero of=/media/usbdisk/tmp/tmp.txt count=4 bs=128K 4+0 records in 4+0 records out 524288 bytes (524 kB) copied, 0.033982 seconds, 15.4 MB/s
CASE 3 is what i would be expecting and what also what I get when writing to a fat32-partition on the external usb hdd. This also implies IMHO that there is nothing wrong with my usb-setup as suggested in various other postings regarding usb-performance.
Here is an output regarding the usb-modules:
lsmod | grep hci ehci_hcd 34696 0 uhci_hcd 26892 0 usbcore 115024 3 usbhid,ehci_hcd,uhci_hcd
As suggested in http://marc.abramowitz.info/archives/2007/02/17/getting-good-performance-out... I also tried fiddling with the value of /sys/block/sdX/device/max_sectors but with no significant success...
I have created the ext3 and reiser partitions on the usb hdd with the yast partitioner, basically leaving everything at default settings.
Any hints on where else to look for the cause of this poor performance?
My workaround right now is to "copy" with: tar -cf - file_from_local_sata_hdd | tar -xf - -b2000 -C/directory_on_usb_hdd_ext3fs_or_reiserfs
I am using -b2000 hereby to be able to do larger blocksized writes.
Regards,
Franz.
I use an external drive on 10.2 with no problem. I get about 20 MB / sec. I just let te system mount properly and t seems to work without any problems. Can you confirm if it is operating. Can you confirm that the device is mounted as a USB 2.0 high speed device (480 Mb/sec) as oppose to USB 2.0 (12 Mb/sec). Try using the USB device program. Another item check to see how it is mounted. Do a cat /proc/mounts. this will help determine if you are running synch versus asynch. Synch slows the operation significantly. -- Joseph Loo jloo@acm.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hi, thanks for your replies and sorry for my delay in answering. Joseph Loo wrote:
Franz Petri wrote:
Hi,
I have a problem getting the performance up when writing to an external harddisk, connected via usb 2.0.
...
Another item check to see how it is mounted. Do a cat /proc/mounts. this will help determine if you are running synch versus asynch. Synch slows the operation significantly.
It seems that synch mode was indeed the cause for this. ~> cat /proc/mounts rootfs / rootfs rw 0 0 udev /dev tmpfs rw 0 0 /dev/hda2 / ext3 rw,data=ordered 0 0 proc /proc proc rw 0 0 sysfs /sys sysfs rw 0 0 debugfs /sys/kernel/debug debugfs rw 0 0 devpts /dev/pts devpts rw 0 0 /dev/hda3 /home ext3 rw,data=ordered 0 0 securityfs /sys/kernel/security securityfs rw 0 0 /dev/sda2 /media/disk reiserfs rw,sync,nosuid,nodev 0 0 /dev/sda1 /media/disk-1 vfat rw,nosuid,nodev,noatime,uid=1003,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,utf8 0 0 ~> ~> dd if=/dev/zero of=/media/disk/tmp/tmp.txt count=1000 1000+0 records in 1000+0 records out 512000 bytes (512 kB) copied, 2.57634 s, 199 kB/s I usually let kde do all the mounting of external SD-cards, usb-drives, cd-rom, ect. So I went to "drive properties" via sysinfo:/ and unchecked "Sync", then "safely removed" the usb disk and mounted again (via kde-interface). This is what it looks like now: ~> cat /proc/mounts rootfs / rootfs rw 0 0 udev /dev tmpfs rw 0 0 /dev/hda2 / ext3 rw,data=ordered 0 0 proc /proc proc rw 0 0 sysfs /sys sysfs rw 0 0 debugfs /sys/kernel/debug debugfs rw 0 0 devpts /dev/pts devpts rw 0 0 /dev/hda3 /home ext3 rw,data=ordered 0 0 securityfs /sys/kernel/security securityfs rw 0 0 /dev/sda1 /media/disk-1 vfat rw,nosuid,nodev,noatime,uid=1003,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,utf8 0 0 /dev/sda2 /media/disk reiserfs rw,nosuid,nodev 0 0 ~> ~> dd if=/dev/zero of=/media/disk/tmp/tmp.txt count=1000 1000+0 records in 1000+0 records out 512000 bytes (512 kB) copied, 0.0472442 s, 10.8 MB/s ~> This is at least a reasonable magnitude of the transfer rate. So the problem is solved for now for me. BUT: As google finds the risk of data loss being the biggest drawback of the async mode, some questions remain: - Is "safely remove" via kde the way to go at all to finish off all transfers? - Can I trust kde to properly flush and umount everything when shutting the PC down, or do I have to "Safely remove" everytime before I shut down? - Is there a certain idle time period after which I can assume no harm to my data, even when I just unplug the usb drive without "safely remove"? Thanks, Franz.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Wednesday 2007-04-25 at 09:03 +0200, Franz Petri wrote:
It seems that synch mode was indeed the cause for this.
I thought so.
This is at least a reasonable magnitude of the transfer rate. So the problem is solved for now for me.
BUT: As google finds the risk of data loss being the biggest drawback of the async mode, some questions remain:
- Is "safely remove" via kde the way to go at all to finish off all transfers?
Yes. Or manually "umount" the device.
- Can I trust kde to properly flush and umount everything when shutting the PC down, or do I have to "Safely remove" everytime before I shut down?
Should be safe. The halt script umounts every thing still mounted.
- Is there a certain idle time period after which I can assume no harm to my data, even when I just unplug the usb drive without "safely remove"?
You'd better not assume that. It might work, but if it fails once, well, your data will suffer. Suse added an option intermediate between sync and no sync, that flushed automatically. I forgot it's name. Try to find out that one. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFGLyqatTMYHG2NR9URAm4sAJ9CdSHNdS3h5Tscyf3qNWWnVDX7UQCeIdgz yvrAd1jCuYejtnHPkG0Jhbw= =sc60 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Friday 2007-04-20 at 09:37 +0200, Franz Petri wrote:
Hi,
I have a problem getting the performance up when writing to an external harddisk, connected via usb 2.0.
It shows when doing: i) cp file_from_local_sata_hdd to_usb_hdd_formatted_with_ext3fs_or_reiserfs ii) tar -xf file_from_local_sata_hdd -C/directory_on_usb_hdd_formatted_with_ext3fs_or_reiserfs iii) dd if=file_from_local_sata_hdd of=to_usb_hdd_formatted_with_ext3fs_or_reiserfs iv) all other stuff that incorporates writing to the disk, like creating encfs-files on it or trying to setup an encrypted loop device with yast on it.
I would guess tar running slower in 'ii' above.
CASE 2, "default" writing to the usb hdd, one can replace dd with cp or tar at will, the figures stay the same:
dd if=/dev/zero of=/media/usbdisk/tmp/tmp.txt count=1000 1000+0 records in 1000+0 records out 512000 bytes (512 kB) copied, 3.26417 seconds, 157 kB/s
CASE 3, notice the increased bs:
dd if=/dev/zero of=/media/usbdisk/tmp/tmp.txt count=4 bs=128K 4+0 records in 4+0 records out 524288 bytes (524 kB) copied, 0.033982 seconds, 15.4 MB/s
So the block size affects a lot. Curious! My guess then would be that you perhaps are mounting "sync" mode, which is very slow. Or the newer intermediate mode I forgot the name. You could also benefit of mounting "noatime". Issue the command "mount" and see what you have.
I have created the ext3 and reiser partitions on the usb hdd with the yast partitioner, basically leaving everything at default settings.
There is a possibility I have not explored, and is having the journal in the local filesystem instead, but I'm not sure how to accomplish that. I think it would speed up things noticeably. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFGKWbhtTMYHG2NR9URAiHvAJ97aAagg5p9TN7VcxCMrI21L7EOlgCdHMuh sM5ATNxjGQLcaa8pAFKL+1k= =oV/O -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Carlos E. R.
-
Franz Petri
-
Joseph Loo