Slashdot Mirror


Swap File Optimizations?

fastswap asks: "I've got a pretty standard computer with reasonably fast drives. I've got an old 2GB-but-fast drive, and a spare channel on the motherboard. Does it make sense to install the 2GB drive on its own controller and use it for a dedicated, fixed swap file? I figure if the computer's using the swap file, then in the current setup with the swap file on the primary controller, then it's contributing to hard drive thrash exactly when one doesn't want it to (i.e. when the machine needs the swap file). If it is better to have a dedicated swap file on its own controller, is the same true for other operating systems with similar approaches to virtual memory? Since drive space is so cheap now, should the swap file be fixed size anyway rather than letting Windows suddenly get the urge to resize the thing?"

6 of 177 comments (clear)

  1. swapping? by ArmorFiend · · Score: 3, Interesting

    Do people still swap? Seriously, I can't remember when I heard my prime dueller do the rumble, and its only got 512 megs of ram.

    1. Re:swapping? by jonadab · · Score: 2, Interesting

      > I can't remember when I heard my prime dueller do the rumble, and its only
      > got 512 megs of ram.

      I make it a point to have enough RAM that the system almost never has to use
      the swap space, but I consider it vital to have the swap space there as a
      safety net, because occasionally something uses a whole lot of RAM (e.g., I
      might write a quick-and-dirty use-once-and-throw-away Perl script to process
      some data, and it might store them in a Really Big Hash while doing so, or I
      might have to work with an image in Gimp that's intended to be printed at
      600dpi at 8x10 inches, and I might forget to turn down the length of the undo
      history and perform several memory-intensive operations on the image), and
      the Linux kernel has a tendency to react rather badly to running out of both
      memory and swap space. So, as cheap as drive space is, I like to have plenty
      of swap space available for such occasions. Usually, it's 0% used and 100%
      available, but I consider it an important safety net. I like to have several
      gigabytes of swap space, Just In Case.

      However, if you're using the swap space often enough that you want to optimize
      its speed by putting it on a separate controller, I recommend more RAM instead.

      --
      Cut that out, or I will ship you to Norilsk in a box.
  2. Fixed size... by Motherfucking+Shit · · Score: 4, Interesting

    The general advice that I've picked up is that, at least in the *n?x world, you should create a swap partition which is double the size of the machine's physical RAM. For example, if you're sitting on 512MB of RAM, a 1GB swap partition is appropriate.

    You only mention Windows towards the end of your question so I can't tell whether or not you're looking for a Windows answer. I've always allowed Windows to resize its swap file, but within a small window. This machine (Win2K) has 640 megs of physical RAM, and the swap file is set at 1280 minimum, 1960 maximum; that gives Windows "double the real RAM," but not a license to take over the whole drive. Seems to work well for me.

    I've never tried putting the swap on its own channel or controller - or even on its own drive - under any OS. Like you, I'd be interested in hearing whether or not this is worth the trouble.

    --
    "BSD: Free as in speech. Linux: Free as in beer. Windows 10: Free as in herpes." --Man On Pink Corner in #52607549.
  3. Yes, seperate drive and fixed size by viware · · Score: 5, Interesting

    My experience has always been to give windows a fixed page file, at twice the RAM size (ie. 512MB RAM so 1024MB page file). Further, a separate physical drive is the best scenario, or second best is a separate partition.

    It is important to note that WindowsXP will use the page file whether you've got plenty of RAM or not.

  4. Good Results by harryk · · Score: 3, Interesting

    I too am in a similar environment as yourself. I took it one step further, and also setup the temp variables to use the same drive.

    I've noticed significant performance increases since doing, not to mention that I've freed up some space on other, more important drives.

    Good luck!

    --
    think before you write, it'll save me moderator points.
  5. Swap: Don't boot XP without it by WarPresident · · Score: 3, Interesting

    An old, surplus, dedicated swap drive on its own channel: $0.00

    A RAMdrive from system memory: Under $100

    A solid state disk drive you shove into a PCI slot with a bunch of SDRAM on it: Priceless

    For everything else, there's, Hey! Why would I pay more than a grand for a PCI bandwidth capped solid state drive when I can fill my memory slots and use RAMDrive at DDR bandwidth?

    --
    Here come da fudge!