DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 9th July 2008
m4rc m4rc is offline
New User
 
Join Date: Jul 2008
Posts: 7
Thanked 0 Times in 0 Posts
Default Disk I/O Throughput

I've an question regarding disk I/O throughput.

The observation:
When I cp a 1 GB file within sd0 it takes about 100 sec.
When I attach sd1 via USB2 and cp the file from sd0 it takes about 80 sec.
When I cp this file back from sd1 to sd0 it takes about 40 sec.

The disk specs:
sd0 at scsibus0 targ 0 lun 0: <ATA, Hitachi HTS54161, SB4O> SCSI3 0/direct fixed
sd0: 152627MB, 19457 cyl, 255 head, 63 sec, 512 bytes/sec, 312581808 sec total
sd1 at scsibus1 targ 1 lun 0: <SAMSUNG, HD401LJ, 0-15> SCSI2 0/direct fixed
sd1: 381554MB, 48641 cyl, 255 head, 63 sec, 512 bytes/sec, 781422768 sec total


Now I wonder why it takes longer to cp a file within sd0 than from/to sd1.
I also would like to know if my disk throughput performs averagely. tak sa mycket!

Edit:
P.S. And when I cp the file within sd1 it takes about 120 sec.

Last edited by m4rc; 9th July 2008 at 04:33 PM.
Reply With Quote
  #2   (View Single Post)  
Old 9th July 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,888
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by m4rc View Post
Now I wonder why it takes longer to cp a file within sd0 than from/to sd1
I suspect you are witnessing the effects of buffering. A portion of the file may still exist in the hard drive's buffer, so the amount of time needed to copy to an external device is smaller.
Reply With Quote
  #3   (View Single Post)  
Old 9th July 2008
m4rc m4rc is offline
New User
 
Join Date: Jul 2008
Posts: 7
Thanked 0 Times in 0 Posts
Default

So the read/write capability of my drives vary between 8 and 25 MB/sec. incl. "buffer effects". According to the USB 2.0 (60 MB/sec.) and SATA 300 (300 MB/sec.) specs it looks that there is still some potential left to improve the read/write speed of my disks. Or do I simply confuse read/write capability with bus bandwidth?
Reply With Quote
  #4   (View Single Post)  
Old 9th July 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default

Hello,

Quote:
Originally Posted by m4rc View Post
So the read/write capability of my drives vary between 8 and 25 MB/sec. incl. "buffer effects". According to the USB 2.0 (60 MB/sec.) and SATA 300 (300 MB/sec.) specs it looks that there is still some potential left to improve the read/write speed of my disks. Or do I simply confuse read/write capability with bus bandwidth?
Just because the bus (USB 2.0 or SATA 300) can send data at that speed, doesn't mean that your hard drive can spit it out that fast. I don't know exactly the capabilities of the current crop of hard drives, but I'm pretty sure that they won't push the bus to its limit.
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
  #5   (View Single Post)  
Old 9th July 2008
m4rc m4rc is offline
New User
 
Join Date: Jul 2008
Posts: 7
Thanked 0 Times in 0 Posts
Default

Thanks for debugging me ;-)
Reply With Quote
  #6   (View Single Post)  
Old 10th July 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

Quote:
Originally Posted by m4rc View Post
I've an question regarding disk I/O throughput.

The observation:
When I cp a 1 GB file within sd0 it takes about 100 sec.
At this point, the file's contents are stored in the drive's disk cache, and in RAM in the disk buffer cache.

Quote:
When I attach sd1 via USB2 and cp the file from sd0 it takes about 80 sec.
At this point, you are copying the file from RAM to the destination drive, across the horrible USB, which will never approach the full 40 MBps max throughput.

Quote:
When I cp this file back from sd1 to sd0 it takes about 40 sec.
At this point, you're basically just copying the file from the disk cache to the disk.

Quote:
Now I wonder why it takes longer to cp a file within sd0 than from/to sd1.
Read a portion of disk, move disk heads, write out to the same disk, move disk heads, read another portion of disk, move disk heads, write out to same disk ...
vs.
Constantly read source disk while constantly writing out to separate destination disk.

All you have to do is listen to the sound of the drive heads thrashing (copy to/from same disk) vs the sound of two drives' heads reading from one disk and writing to the other.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I mount AIX disk in NetBSD? sami NetBSD General 2 24th June 2009 05:08 PM
Disk space gone missing EricM FreeBSD General 0 26th February 2009 02:25 AM
Disk > 100% Weaseal FreeBSD General 3 11th February 2009 05:50 PM
Disk geometry for Seagate disk phreud FreeBSD Installation and Upgrading 5 8th November 2008 10:51 PM
Limit Bandwidth (not throughput) plexter OpenBSD Security 5 9th October 2008 05:10 PM


All times are GMT. The time now is 04:24 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick