sounder 8, JS on Swap

John dingo at coco2.arach.net.au
Sun Sep 12 19:17:46 CDT 2004


Matt Zimmerman wrote:

>On Sun, Sep 12, 2004 at 05:59:48PM +0800, John wrote:
>
>  
>
>>Rather than repeat my argument here, see:
>>http://lists.debian.org/debian-boot/2004/08/msg00016.html
>>
>>No, I've not done benchmarks. It seems so clear to me I wonder that 
>>anyone would challenge my argument in that manner.
>>    
>>
>
>Swap partitions are faster than swap files for the simple reason that they
>  
>

I read recently that the swap subsystem on 2.6 is much improved and this 
doesn't apply any more.

>do not require metadata to record where their various pieces are stored on
>disk.  They start at an offset, and continue for a defined length.  Unless
>the filesystem has special extensions which optimize for this type of file
>(e.g., VxFS QIO), the file will be stored discontiguously (requiring
>  
>
I don't know how files are allocated in Linux, or whether it differes 
between filesystems (I expect it does), but the fact that the whole file 
is essentially created at the same time should help contiguity,

Is there an easy way to check this for a particular file?

>additional seeks and reads to find its pieces on the disk), and also more
>reads and writes to update its metadata, the filesystem journal, etc.
>
>Using a swap file doesn't guarantee that the swap data will be stored closer
>to other frequently-used data, though it certainly increases the chances.  I
>  
>
Using a swap partition, particularly in a system with many partitions 
(eg Sarge default) guaratantees lack of proximity.

>don't think that it would be a good tradeoff, however, to give up
>contiguousness in exchange for closeness to other data.
>
>I would expect a change from a swap partition to a swap file of equal size
>on the same disk to result in a net loss regardless of its location, on
>typical Linux filesystems (especially ext3, which is our default).  I would
>welcome an actual benchmark, but I don't know of an existing one which would
>cover this, and it would be non-trivial to come up with an accurate test.
>
>  
>
Does anyone know a simple way to induce thrashing in a controlled, 
measurable way? Is Bonnie good for this?







More information about the sounder mailing list