Re: [gentoo-user] [OT] Bad performance with external USB disk
On Wednesday 08 of June 2005 22:18, Alec Shaner wrote: I recently purchased a WD 160GB external USB drive and can't get it to perform reliably on my server. It works fine when connected to my workstation machine (a P4P800 ASUS MB with USB 2.0 support). The server only has 1.1 USB support, but the problem is that it starts out copying fine at about 11MB/sec and then after a bit slows to a crawl and stays that way. I have formatted it with an ext3 filesystem. Here's all the info if anyone has an idea. Considering the price of 160G external the best you should do is to stuff a $10 USB 2.0 PCI controller into the server. Your combination of journaling and slow transfer is somewhat... challenging. P. -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
Petr Kocmid wrote: On Wednesday 08 of June 2005 22:18, Alec Shaner wrote: I recently purchased a WD 160GB external USB drive and can't get it to perform reliably on my server. It works fine when connected to my workstation machine (a P4P800 ASUS MB with USB 2.0 support). The server only has 1.1 USB support, but the problem is that it starts out copying fine at about 11MB/sec and then after a bit slows to a crawl and stays that way. I have formatted it with an ext3 filesystem. Here's all the info if anyone has an idea. Considering the price of 160G external the best you should do is to stuff a $10 USB 2.0 PCI controller into the server. Your combination of journaling and slow transfer is somewhat... challenging. P. Right on Petr ;-) That's what I've been thinking all along. My gut instinct says the USB 1.1 controller is a piece of junk. If there's an empty PCI slot then a fresh USB 2.0 controller sound quite tempting. Zac -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
Richard Fish wrote: Alec Shaner wrote: Once the buffer fills up would you expect it to work fine at 1.2MB/s? I wish I had kept the logs, but it was extremely slow (much slower than 1.2). I was copying a series of ~70MB files over and it would work fine on about the first 5 or so files before croaking. I eventually had to kill the job. From this, I'm guessing your machine has about 512MB of memory. The precise behavior I would expect is: The first 350-450MB of files (5-6 at 70MB each) would read at the speed the filesystem/disk can provide them...in this case it seems about 11MB/sec. So reading the first few files will take 30-40 seconds. At this point, the USB disk will only have written 30-40 MB to disk...leaving 300-400MB left to go. The userspace program (rsync,cp?) at this point will basically stop writing for the next 5 to 7 _minutes_. In other words, you will not see nice smooth transition from 11MB/sec down to 1.2MB/s. It will burst at high-speed for several seconds, then stop for an extended period of time, before resuming again. Ah, that makes sense. The system has 2GB of memory, but what you describe is very similar to what I observed. This of course assumes that there are no hardware problems involved. You may want to check your /var/log/messages file or dmesg output for any timeout or other disk errors being reported during the copy operation. The kernel's reaction to a communication error with a disk is to reset the controller and retry the command. I'm not sure if there is an eventual timeout to this process or not...if there is, it is larger than my personal 'patience timeout'! ;- -Richard I dug around the archived syslog files and found this snippet in there: Jun 3 15:41:04 scream kernel: SCSI device sdb: 312581808 512-byte hdwr sectors (160042 MB) Jun 3 15:41:04 scream kernel: sdb: assuming drive cache: write through Jun 3 15:41:04 scream kernel: /dev/scsi/host2/bus0/target0/lun0: p1 p2 p3 p4 Jun 3 15:41:06 scream kernel: SCSI device sdb: 312581808 512-byte hdwr sectors (160042 MB) Jun 3 15:41:06 scream kernel: sdb: assuming drive cache: write through Jun 3 15:41:06 scream kernel: /dev/scsi/host2/bus0/target0/lun0: p1 p2 p3 p4 Jun 3 15:48:16 scream kernel: SCSI error : 2 0 0 0 return code = 0x7 Jun 3 15:48:16 scream kernel: end_request: I/O error, dev sdb, sector 47188047 Jun 3 15:48:16 scream kernel: Buffer I/O error on device sdb1, logical block 47187984 Jun 3 15:48:16 scream kernel: lost page write due to I/O error on sdb1 Jun 3 15:48:16 scream kernel: SCSI error : 2 0 0 0 return code = 0x7 Jun 3 15:48:16 scream kernel: end_request: I/O error, dev sdb, sector 47188048 and so on -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
Alec Shaner wrote: Jun 3 15:48:16 scream kernel: SCSI error : 2 0 0 0 return code = 0x7 Jun 3 15:48:16 scream kernel: end_request: I/O error, dev sdb, sector 47188047 Jun 3 15:48:16 scream kernel: Buffer I/O error on device sdb1, logical block 47187984 Jun 3 15:48:16 scream kernel: lost page write due to I/O error on sdb1 Jun 3 15:48:16 scream kernel: SCSI error : 2 0 0 0 return code = 0x7 Jun 3 15:48:16 scream kernel: end_request: I/O error, dev sdb, sector 47188048 Ouch, that looks bad. You should compile in Verbose SCSI Error Reporting in your kernel, which will decode that 0x7 for you. Otherwise, you'll have to go read the SCSI spec... Once you have done that, I would do a read test of the entire disk with dd (preferably on the fast computer!) to see you have a hard error at those sectors or not. -Richard -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
Richard Fish wrote: Alec Shaner wrote: I recently purchased a WD 160GB external USB drive and can't get it to perform reliably on my server. It works fine when connected to my workstation machine (a P4P800 ASUS MB with USB 2.0 support). The server only has 1.1 USB support, but the problem is that it starts out copying fine at about 11MB/sec and then after a bit slows to a crawl and stays that way. I have formatted it with an ext3 filesystem. Here's all the info if anyone has an idea. With USB 1.1 you are not going to get more than about 1.2MB/s throughput, because the top speed is 11 megabits/sec, not megabytes: 11 mbit / 8 bits-per-pyte = 1.375. The initial burst you see at 11MB/sec is likely due to buffering. Maybe you can answer this question. I have an ATA/66 parallel ATA hard drive (66 MBps) on an ATA/133 bus. If the bus is limited to 133 MBps and the drive cannot transfer data at more than 66 MBps, how come burst transfers (as reported by hdparm -tT /dev/hdg) are at about 1.6 GBps? Not that I'm complaining, of course, it just seems illogical :-) -- Colin -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
Colin wrote: Maybe you can answer this question. I have an ATA/66 hard drive (66 MBps) on an ATA/133 bus. If the bus is limited to 133 MBps and the drive cannot transfer data at more than 66 MBps, how come burst transfers (as reported by hdparm -tT /dev/hdg) are at about 1.6 GBps? Not that I'm complaining, of course, it just seems illogical :-) Is it try-to-stump-Richard-day again already??? ;- It is because of the way the -T test is implemented, which is to just read the first block of data over and over again. Because hdparm doesn't specify the O_DIRECT flag on open, the kernel will buffer the data in system memory for the first read, and return the same for all subsequent reads. So the number returned equals 1/2 of your system memory bandwidth, since copying the buffer from one memory location to another involves both reading and writing. -Richard -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
Richard Fish wrote: Alec Shaner wrote: I recently purchased a WD 160GB external USB drive and can't get it to perform reliably on my server. It works fine when connected to my workstation machine (a P4P800 ASUS MB with USB 2.0 support). The server only has 1.1 USB support, but the problem is that it starts out copying fine at about 11MB/sec and then after a bit slows to a crawl and stays that way. I have formatted it with an ext3 filesystem. Here's all the info if anyone has an idea. With USB 1.1 you are not going to get more than about 1.2MB/s throughput, because the top speed is 11 megabits/sec, not megabytes: 11 mbit / 8 bits-per-pyte = 1.375. The initial burst you see at 11MB/sec is likely due to buffering. -Richard Once the buffer fills up would you expect it to work fine at 1.2MB/s? I wish I had kept the logs, but it was extremely slow (much slower than 1.2). I was copying a series of ~70MB files over and it would work fine on about the first 5 or so files before croaking. I eventually had to kill the job. -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
--- Alec Shaner [EMAIL PROTECTED] wrote: Richard Fish wrote: Alec Shaner wrote: I recently purchased a WD 160GB external USB drive and can't get it to perform reliably on my server. It works fine when connected to my workstation machine (a P4P800 ASUS MB with USB 2.0 support). The server only has 1.1 USB support, but the problem is that it starts out copying fine at about 11MB/sec and then after a bit slows to a crawl and stays that way. I have formatted it with an ext3 filesystem. Here's all the info if anyone has an idea. With USB 1.1 you are not going to get more than about 1.2MB/s throughput, because the top speed is 11 megabits/sec, not megabytes: 11 mbit / 8 bits-per-pyte = 1.375. The initial burst you see at 11MB/sec is likely due to buffering. -Richard Once the buffer fills up would you expect it to work fine at 1.2MB/s? I wish I had kept the logs, but it was extremely slow (much slower than 1.2). I was copying a series of ~70MB files over and it would work fine on about the first 5 or so files before croaking. I eventually had to kill the job. Hi Alec, I suspect Richard is right on. If you run free before your start the copy and then again after the burst you should see that it simply ate up the available memory. You should do a real benchmark, possibly including hdparm. If there is really a problem then hopefully you will see some errors in dmesg or the syslog (/var/log/messages). You may need to enable debugging for the filesystem and/or usb-storage driver. Zac __ Discover Yahoo! Use Yahoo! to plan a weekend, have fun online and more. Check it out! http://discover.yahoo.com/ -- gentoo-user@gentoo.org mailing list
[gentoo-user] (OT) Try-to-stump Richard day - was Re: [gentoo-user] [OT] Bad performance with external USB disk
Richard Fish wrote: Colin wrote: Maybe you can answer this question. I have an ATA/66 hard drive (66 MBps) on an ATA/133 bus. If the bus is limited to 133 MBps and the drive cannot transfer data at more than 66 MBps, how come burst transfers (as reported by hdparm -tT /dev/hdg) are at about 1.6 GBps? Not that I'm complaining, of course, it just seems illogical :-) Is it try-to-stump-Richard-day again already??? ;- It is because of the way the -T test is implemented, which is to just read the first block of data over and over again. Because hdparm doesn't specify the O_DIRECT flag on open, the kernel will buffer the data in system memory for the first read, and return the same for all subsequent reads. So the number returned equals 1/2 of your system memory bandwidth, since copying the buffer from one memory location to another involves both reading and writing. Oh OK. I thought the buffered result was kept in the drive's memory, not the system's. All right, since it's try-to-stump-Richard-day, let me throw out one more question. This one should be easier. Pin 40 broke off this hard drive's connector. The IDE specification says it's just a grounding pin, one out of many on the connector, so it shouldn't hurt anything. Right? -- Colin -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
Alec Shaner wrote: Once the buffer fills up would you expect it to work fine at 1.2MB/s? I wish I had kept the logs, but it was extremely slow (much slower than 1.2). I was copying a series of ~70MB files over and it would work fine on about the first 5 or so files before croaking. I eventually had to kill the job. From this, I'm guessing your machine has about 512MB of memory. The precise behavior I would expect is: The first 350-450MB of files (5-6 at 70MB each) would read at the speed the filesystem/disk can provide them...in this case it seems about 11MB/sec. So reading the first few files will take 30-40 seconds. At this point, the USB disk will only have written 30-40 MB to disk...leaving 300-400MB left to go. The userspace program (rsync,cp?) at this point will basically stop writing for the next 5 to 7 _minutes_. In other words, you will not see nice smooth transition from 11MB/sec down to 1.2MB/s. It will burst at high-speed for several seconds, then stop for an extended period of time, before resuming again. This of course assumes that there are no hardware problems involved. You may want to check your /var/log/messages file or dmesg output for any timeout or other disk errors being reported during the copy operation. The kernel's reaction to a communication error with a disk is to reset the controller and retry the command. I'm not sure if there is an eventual timeout to this process or not...if there is, it is larger than my personal 'patience timeout'! ;- -Richard -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
Mark Knecht wrote: The typical reason for low performance AND high CPU is that the controller (in this case probably the USB interface chip) isn't enabled for DMA. It looked like you have the right drivers loaded so possibly the USB chip is not a major brand name? Sorry I didn't read earlier parts of this thread. What chipset is this? lspci -v and supply back the data on the USB chips. The next idea is that you have both the ehci and uhci drivers loaded. If somehow you got the drive plugged into a USB 1.0/1.1 port then you'd only get about 1MB/S. Did you try all your ports? They are not all the same on my Compaq and I do get better performance from the USB 2.0 ports. Good luck, Mark I recently purchased a WD 160GB external USB drive and can't get it to perform reliably on my server. It works fine when connected to my workstation machine (a P4P800 ASUS MB with USB 2.0 support). The server only has 1.1 USB support, but the problem is that it starts out copying fine at about 11MB/sec and then after a bit slows to a crawl and stays that way. I have formatted it with an ext3 filesystem. Here's all the info if anyone has an idea. lspci -v: :00:1d.0 USB Controller: Intel Corporation 82801CA/CAM USB (Hub #1) (rev 02) (prog-if 00 [UHCI]) Subsystem: Super Micro Computer Inc: Unknown device 3580 Flags: bus master, medium devsel, latency 0, IRQ 16 I/O ports at 2000 [size=32] :00:1d.1 USB Controller: Intel Corporation 82801CA/CAM USB (Hub #2) (rev 02) (prog-if 00 [UHCI]) Subsystem: Super Micro Computer Inc: Unknown device 3580 Flags: bus master, medium devsel, latency 0, IRQ 19 I/O ports at 2020 [size=32] :00:1d.2 USB Controller: Intel Corporation 82801CA/CAM USB (Hub #3) (rev 02) (prog-if 00 [UHCI]) Subsystem: Super Micro Computer Inc: Unknown device 3580 Flags: bus master, medium devsel, latency 0, IRQ 18 I/O ports at 2040 [size=32] KERNEL config (2.6.11-gentoo-r9 #1 SMP) CONFIG_USB=y CONFIG_USB_DEVICEFS=y CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_UHCI_HCD=y CONFIG_USB_PRINTER=y CONFIG_USB_STORAGE=y # CONFIG_BLK_DEV_UB is not set I guess there's no reason to have ECHI/OHCI turned on, but does that matter? For the time being I am using NFS to access the drive (currently connected to my workstation) from the server. I don't care much about the speed difference from 1.1 to 2.0, this is just used as extra storage for some low priority batch jobs. Thanks. -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
Alec Shaner wrote: I recently purchased a WD 160GB external USB drive and can't get it to perform reliably on my server. It works fine when connected to my workstation machine (a P4P800 ASUS MB with USB 2.0 support). The server only has 1.1 USB support, but the problem is that it starts out copying fine at about 11MB/sec and then after a bit slows to a crawl and stays that way. I have formatted it with an ext3 filesystem. Here's all the info if anyone has an idea. With USB 1.1 you are not going to get more than about 1.2MB/s throughput, because the top speed is 11 megabits/sec, not megabytes: 11 mbit / 8 bits-per-pyte = 1.375. The initial burst you see at 11MB/sec is likely due to buffering. -Richard -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
On 5/27/05, Hans-Werner Hilse [EMAIL PROTECTED] wrote: Jan Drugowitsch [EMAIL PROTECTED] wrote: On 5/26/05, Hans-Werner Hilse [EMAIL PROTECTED] wrote: Do you use the usb-storage driver or the usb block device drive (which mentions things like slow and cpu-hungry and unstable in the kernel config option's help page)? Could you CP the relevant parts from the kernel logs when the drivers are loaded (USB host adapter and device)? Here's the kernel log message: May 27 01:51:06 rpc-jd224 usb 4-4: new high speed USB device using ehci_hcd and address 6 May 27 01:51:06 rpc-jd224 uba: device 6 capacity nsec 312581808 bsize 512 Yep, this is the slow, polling driver (that OTOH does work with more devices, AFAIK). Just disabling it (it's in block devices kernel config) as Richard mentioned should solve this. You definately want usb- storage here, bringing up a SCSI compatibility layer. The disk will then be recognized as sda instead of uba. CPU usage should drop because the driver handles the timing issues in a different way, I think. Ooops, didn't have a look at Device Drivers - Block Devices. I have no clue why I've once selected 'Low Performance USB Driver'. Anyway, it's now disabled and my writing speed is up to about 16Mb/s. :-) No answer Mark's question: it's an 'Intel Corp. 82801DB USB EHCI Controller', so should be fairly mainstream. Thanks to everyone, Jan -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
On 5/26/05, Hans-Werner Hilse [EMAIL PROTECTED] wrote: I've got an external USB 2.0 HD with two fat32 partitions (I have to use fat32 to make them work with windows). What troubles with me with drive is that in windows I get the expected transfer speed, but in linux it just won't get faster than 1Mb/s. Do you use the usb-storage driver or the usb block device drive (which mentions things like slow and cpu-hungry and unstable in the kernel config option's help page)? Could you CP the relevant parts from the kernel logs when the drivers are loaded (USB host adapter and device)? Hmm, I've configured the USB bit of the kernel a long time ago and have since always used 'make oldconfig'. I didn't know that there were 2 different device drivers available. I'll have a look as soon as I'll be back home. Thanks for the hint, Jan -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
Here's the kernel log message: May 27 01:51:06 rpc-jd224 usb 4-4: new high speed USB device using ehci_hcd and address 6 May 27 01:51:06 rpc-jd224 uba: device 6 capacity nsec 312581808 bsize 512 May 27 01:51:06 rpc-jd224 uba: device 6 capacity nsec 312581808 bsize 512 May 27 01:51:06 rpc-jd224 uba: uba1 uba2 That is definitely not right...it should come up as sdX. You may need to add SCSI disk module support to your kernel as well. And you need to turn off CONFIG_BLK_DEV_UB (in Device Drivers - Block Devices). -Richard -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] [OT] Bad performance with external USB disk
On 5/26/05, Jan Drugowitsch [EMAIL PROTECTED] wrote: I still don't see much of a reason why the drive should be so slow, and neither why the kernel should use 100% cpu. Any help is appreciated, Jan -- gentoo-user@gentoo.org mailing list The typical reason for low performance AND high CPU is that the controller (in this case probably the USB interface chip) isn't enabled for DMA. It looked like you have the right drivers loaded so possibly the USB chip is not a major brand name? Sorry I didn't read earlier parts of this thread. What chipset is this? lspci -v and supply back the data on the USB chips. The next idea is that you have both the ehci and uhci drivers loaded. If somehow you got the drive plugged into a USB 1.0/1.1 port then you'd only get about 1MB/S. Did you try all your ports? They are not all the same on my Compaq and I do get better performance from the USB 2.0 ports. Good luck, Mark -- gentoo-user@gentoo.org mailing list