User: Password:
|
|
Subscribe / Log in / New account

Respite from the OOM killer

Respite from the OOM killer

Posted Oct 1, 2004 15:48 UTC (Fri) by Luyseyal (guest, #15693)
In reply to: Respite from the OOM killer by mongre26
Parent article: Respite from the OOM killer

First you would have to move from a disk partition swap to a disk file swap. That hurts you because you are reading and writing not from a custom swap file system but a file simulating a swap file system placed on a regular file system. That means your file systems ability to handle swap like files will impact swap performance.

Actually, this is not true anymore. On recent kernels (2.4+) swap file performance is exactly the same as swap partition performance because the kernel bypasses the filesystem layer (I believe it relies on the magic of 'dd' creating files without holes). The only annoying thing with swap files is if you have a large one, it takes awhile to initialize on boot.

Also when a swap file changes size it has to re-organize itself somehwat. This an hurt performance while the swap is resizing. If the swap resizes too much you waste a lot of disk activity unecessarily.

This is true. If you're going to allow overcommit, disallow OOM, and allow the kernel to create new swap files on the fly, it would probably be best done in its own subdirectory using a number of smaller swap files as adding a new swap is probably cheaper than resizing an existing one.

As an aside, I recently converted a swap partition to a swap file on a dedicated ext2 partition so I could use e2label to make swap still work in case of SCSI name reordering. Since performance is identical -- except the longer boot time -- it was worth it.

Cheers!
-l


(Log in to post comments)

Respite from the OOM killer

Posted Oct 7, 2004 23:29 UTC (Thu) by nobrowser (guest, #21196) [Link]

> it would probably be best done in its own subdirectory using
> a number of smaller swap files as adding a new swap is probably
> cheaper than resizing an existing one.

It already exists. Look for swapd in the ibiblio archive.
The response was completely underwhelming when it was young (long ago),
and I don't see why that should have changed.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds