swap file vs. swap partition

Damian Menscher menscher at uiuc.edu
Sat Jul 30 19:02:48 UTC 2005


On Sat, 30 Jul 2005, Peter Arremann wrote:
> On Saturday 30 July 2005 13:06, Mathieu Chouquet-Stringer wrote:
>> menscher at uiuc.edu (Damian Menscher) writes:
>>> A swap partition would be faster (think about it -- no filesystem
>>> overhead).
>>
>> Not true anymore. There is no overhead for a swap file compared to a swap
>> partition:
>
> Was just going to post that link... Yes, there is no performance difference on
> a block by block base between partition and file... but there is still one
> good performance reason to use swap partitions - you can put them in the
> fastest region of the disk. Look at this graph
> http://www.tomshardware.com/storage/20050606/toshiba-05.html#data_transfer_graph
> (just an example, you can usually easily find similar graphs for your drive
> type).
> You see, if you place the swap partition at the end of the disk, you'll get
> like 40% less performance than if it is at the beginning. With a individual
> partition you can control this - with a filesystem (if its larger, i.e. if
> you only make one large / partition) you can't really determine the location
> of your swap file...

Interesting link, though the graph is labeled so poorly it's not clear 
what it even is supposed to mean.  I'm not convinced you interpreted it 
correctly.

I used to think the data transfer rate would be faster on the outer 
cylinders, but then I benchmarked it.  There's no difference on the 
disks I checked (18G scsi disks).  Oh, and keep in mind that the 
relevant factor is seek speed, not data transfer speed, if you're using 
your disk as RAM.  Don't forget that the R stands for Random.

(I did this for a project several months ago where I was adding 64 gig 
of swap space -- 8 gig on each of 8 drives.)

Damian Menscher
-- 
-=#| Physics Grad Student & SysAdmin @ U Illinois Urbana-Champaign |#=-
-=#| 488 LLP, 1110 W. Green St, Urbana, IL 61801 Ofc:(217)333-0038 |#=-
-=#| 4602 Beckman, VMIL/MS, Imaging Technology Group:(217)244-3074 |#=-
-=#| <menscher at uiuc.edu> www.uiuc.edu/~menscher/ Fax:(217)333-9819 |#=-
-=#| The above opinions are not necessarily those of my employers. |#=-




More information about the fedora-list mailing list