DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

bored and blogging » Good Ol’ Swap

Good Ol’ Swap

linux, ubuntu — Tags: , , , — boredandblogging @ 2:36 pm

Last night on the Georgia US Team IRC channel, #ubuntu-georgia, the topic of swap came up. A user had initally installed Ubuntu, thinking they wouldn’t use it for it long, so no swap partition was set up. After using Ubuntu full-time for some time, the lack of swap space was causing some sluggishness, so he was thinking about reinstalling Ubuntu from scratch and setting up the partitions properly.

Another user provided a link to the awesome SwapFaq on the documentation site. It had a section on the exact question we were looking for: Should I reinstall with more swap? I bring all this up because I was pretty impressed to see how thoroughly the help documentation covered what most users would ever care about: what is it, how much do I need, and how do I add more. No frills, nothing fancy, just concise questions and answers. Users can quickly find what they are looking for and move on. Perfect.

BTW, the answer to the question is that there is no reason to reinstall to add swap space. Any file can be used for swap, and the SwapFaq provides instructions on creating it. While a swap partition may provide slightly better performance, its not reason enough to rebuild an otherwise working system.

6 Comments »

  1. Or one can use swapspace which will dynamically add and remove swap files as required — no wasted, fixed size partitions, and Just Works :)

    Comment by Henrik Pauli — May 20, 2007 @ 3:11 pm
  2. You said;

    While a swap partition may provide slightly better performance …

    However;

    Not so. With a 2.4.x kernel swap files were slower than swap
    partitions, but with the 2.6 kernel a swap file is just as fast as a
    swap partition.

    —Jesper Juhl

    Comment by Porges — May 20, 2007 @ 4:09 pm
  3. afaik, suspend to disk (hibernate) doesn’t work with file based swap

    Comment by Pete — May 20, 2007 @ 6:21 pm
  4. I’m not sure about problems with suspend and file based swap but I know suspend won’t work if swap is included in an LVM (default on FC/F7). It sure is nice though that we can add a file and swap-on, swap-off for additional swap space.

    I’m still working on a flash-drive based swap (like we discussed at dinner when I was out there). flash based would sure be faster than drive based.

    Comment by Christer Edwards — May 20, 2007 @ 7:14 pm
  5. suspend2 works with a swap file

    Comment by suspend2 — May 21, 2007 @ 12:47 pm
  6. “”"I’m still working on a flash-drive based swap (like we discussed at dinner when I was out there). flash based would sure be faster than drive based.”"”

    It will be faster. But swap usage patterns tend to shred flash memory quite fast. (remember you only have limited write cycles with flash)

    Comment by martin — May 21, 2007 @ 3:15 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2008 bored and blogging | powered by WordPress with Barecity