Re: why swap at all?

From: John Bradford (john_at_grabjohn.com)
Date: 05/26/04

  • Next message: Paweł Sikora: "Re: Don't return void types from void functions."
    Date:	Wed, 26 May 2004 10:06:58 +0100
    To: Anthony DiSante <orders@nodivisions.com>, linux-kernel@vger.kernel.org
    
    

    Quote from Anthony DiSante <orders@nodivisions.com>:
    > As a general question about ram/swap and relating to some of the issues in
    > this thread:
    >
    > ~500 megs cached yet 2.6.5 goes into swap hell
    >
    > Consider this: I have a desktop system with 256MB ram, so I make a 256MB
    > swap partition. So I have 512MB "memory" and if some process wants more,
    > too bad, there is no more.
    >
    > Now I buy another 256MB of ram, so I have 512MB of real memory. Why not
    > just disable my swap completely now? I won't have increased my memory's
    > size at all, but won't I have increased its performance lots?
    >
    > Or, to make it more appealing, say I initially had 512MB ram and now I have
    > 1GB. Wouldn't I much rather not use swap at all anymore, in this case, on
    > my desktop?

    In my experience, it's perfectly possible to run a typical desktop system with
    no swap at all. Certainly the 'double the amount of physical RAM' guideline
    has been taken far too literally in my opinion.

    As you point out, if a typical system works fine with 512 Mb of storage, it
    shouldn't matter what the mix of physical and virtual memory is. Of course,
    it will make a difference to performance, and there is a minimum practical
    amount of real RAM because some things are unswapable, but in my opinion it
    is absolutely wrong to size swap partitions simply by looking at the amount of
    physical RAM in a system and not considering the requirements of the workload.

    Double the physical RAM is usually more than enough these days, and because
    most of the time the negative effects of too little swap are more noticable
    than too much swap, this 'rule' seems to work well enough.

    See my recent posts in another thread about solving computing problems by
    learning solutions to common scenarios and not learning about computers in a
    generic way - in my opinion, the widespread inefficiency of swap space is a
    classic example of how this simply doesn't work very well.

    Instead of trying to work out how much swap space is needed for a particular
    hardware configuation, I suggest that users look at the workload first.

    Infact, it's generally sensible to think about the workload before buying any
    hardware.

    John.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Paweł Sikora: "Re: Don't return void types from void functions."

    Relevant Pages

    • Re: dynamic allocation of swap disk space
      ... Increasing swap can allow more physical RAM to be used for ... > caching data from disk. ...
      (Linux-Kernel)
    • Re: Reboots under 6.0 while exercising md device
      ... > memory disk would always be fast, but would reduce the physical RAM ... > out of physical RAM into swap. ... No, just any kernel process. ...
      (freebsd-questions)
    • Re: What I do for a new machine?
      ... ago when many BIOSes had limitations such as being unable to boot from ... cylinders on the hard disk numbered above 1024, ... You need / and swap. ... physical RAM now on a modern PC is if you hibernated a machine which ...
      (Ubuntu)
    • Re: why swap at all?
      ... >> It's true that physical RAM or swap, over and above the minimum needed ... > that it is stored in cache in your RAM. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [opensuse] Creating a 4 GB swap partition
      ... Yes, but with no real support for saying so, for linux at least. ... It's general issue on any system with virtual storage and how much swap ... space you need depends entirely on your workload. ... the name) of as much as possible, which was double the ram. ...
      (SuSE)