[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Swap space



On Sun, 2009-02-22 at 20:26 +0000, James Wilkinson wrote:
> I wrote:
> > What I’ve read is that the sort of flash you tend to get in these
> drives
> > can be very slow for writes, slow to read back data in sequentially,
> but
> > they can be a lot faster than hard drives to actually start
> accessing
> > the data, because there’s no physical movement required to start
> reading
> > from the disk. A quick google resulted in
> >
> http://www.tomshardware.com/reviews/security-flash-storage,1804-6.html ,
> > with a couple of drives with access times a tenth of what you’d
> expect
> > from a good hard drive, but slower sequential transfer speeds.
> 
> Aaron Konstam wrote:
> > Comparing the read rates in that links list for flash drives to the
> > output of hdparm for hard disks make it clear that disks are faster:
> > [root localhost ~]# hdparm -Tt /dev/sda3
> > 
> > /dev/sda3:
> >  Timing cached reads:   1630 MB in  2.00 seconds = 815.32 MB/sec
> >  Timing buffered disk reads:   94 MB in  3.01 seconds =  31.20
> MB/sec
> 
> I’m not sure what your point is here, Aaron. For 4K random reads,
> those
> speeds are going to be dwarfed by the time it takes to start accessing
> the data.
> 
> Firstly, we’re not going to be talking about cached reads. If there
> was
> space to cache this data, there would have been no point writing it to
> swap in the first place.
> 
> Secondly, my point is that the OS is not going to read in one 4K page,
> then the next page that happens to be on the disk, then the next.
> Pages
> will have been written to the swap file pretty randomly, and then read
> back in as each process tries to access these pages and page faults.
> So
> the OS will be reading 4K at a time from all over the swap file, and
> won't get a chance to sustain those rates for long.
> 
> This is true regardless of the media. It’s just that spinning disks
> are
> lousy at getting to the point where they can start transferring data.
> Your figures don’t measure that.
> 
Yes it does. It is resented by the buffered read. Several things need
too be taken into account:
1. swap partitions are optimized for fast access.
2. In most cases the swap data is read into a buffer from the disk
before it is needed.. One gets segments of information at a time from
the swap area. This optimization is done by the operating system
3. But the real problem of using pen drive for swap is the relativity
(relative to disks) few accesses the pendrive will support before it is
non-functional.
--
=======================================================================
All men have the right to wait in line.
=======================================================================
Aaron Konstam telephone: (210) 656-0355 e-mail: akonstam sbcglobal net


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]