Creating Swap Areas

Janina Sajka janina at rednote.net
Wed Oct 6 15:39:18 UTC 2004


Thanks, Tim. All of this makes sense, of course. But, it seems that with
today's faster disks, greater memory and CPU speed, it may not be as
vital for most users. It's reasonable, it seems to me, that using files
might yield results undistinguishable in performance.

Similar arguments, for example, might be made that telnet will be nmore
efficient than ssh, but clearly the security overhead of ssh would
generally be judged a cost worth paying.

Given the difficulty of creating new partitions, the value of creating
(or recreating) a file might constitute a worthwhile cost. E.g. Swap
file too small? Create a bigger one. .OR. Not using that giant swap
file? Resize it down and gain a little more room on your disk.

Tim Chase writes:
> >Interesting. Can you say more about why a partition is
> >superior to a file for swap?
> 
> All calls to manipulate a swap-file have to go through the
> file-system stack of system calls...this means that you've got
> the overhead of whichever filesystem you're using.  Things such
> as access-control checks, disk-space quotas, and the possiblity
> of having it scattered across the surface of the disk.  With a
> raw partition, you remove one layer (or possibly more, depending
> on how convoluted your file system is) which helps speed things
> up.  A raw partition also keeps everything contiguous so that
> accesses are faster.  Some of the more modern FS's should help
> cut back on this a bit...I think ReiserFS (among others) works
> hard to keep things quite contiguous, so you may not see the same
> gains there, as perhaps with something a little older (like FAT
> or ext2).
> 
> Oracle (and perhaps other RDBMS's) makes use of this same
> aspect--using a raw partition for faster disk access--to obviate
> the need the overhead of the file system.
> 
> In theory, you could exacerbate the matter by mounting a 
> compressed partition, and then, inside of that, creating your 
> swap file.  This would then have the overhead of not only two 
> file-systems, but the added overhead of decompressing.
> 
> Hopefully that makes a bit of sense?  It's 5:00 here at the end 
> of a long day, and time for me to head home.  (grins)
> 
> -tim
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Blinux-list mailing list
> Blinux-list at redhat.com
> https://www.redhat.com/mailman/listinfo/blinux-list

-- 
	
				Janina Sajka, Chair
				Accessibility Workgroup
				Free Standards Group (FSG)

janina at freestandards.org	Phone: +1 202.494.7040




More information about the Blinux-list mailing list