Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Do I need to adjust my SWAP size?

  1. #1

    Default Do I need to adjust my SWAP size?

    I recently went from 2GB of memory to 8GB. However I noticed that my swap size is only a little over 2GB.

    In the Microsoft world I know that swap needs to be at least 1.5 times the amount of physical memory. Does the same rule apply to the OpenSuSE world?

    If so, how do I adjust it to the correct size? And is there a way for the system to just automatically calculate the correct size?

    On my CentOS box, it has 4GB of memory with about 5.4GB of swap....so it seemed to have followed that same logic on its own.

  2. #2
    Join Date
    Nov 2009
    Location
    Sulzbach/Ts., Germany
    Posts
    399

    Default AW: Do I need to adjust my SWAP size?

    You usually only need to adjust the size if you want to use suspend to disk.

  3. #3
    Carlos E. R. NNTP User

    Default Re: Do I need to adjust my SWAP size?

    On 2010-09-14 15:40, abacabb wrote:
    >
    > I recently went from 2GB of memory to 8GB. However I noticed that my
    > swap size is only a little over 2GB.
    >
    > In the Microsoft world I know that swap needs to be at least 1.5 times
    > the amount of physical memory. Does the same rule apply to the OpenSuSE
    > world?


    No.

    > If so, how do I adjust it to the correct size?


    Add a second swap partition, or enlarge it. Manually.

    > And is there a way for
    > the system to just automatically calculate the correct size?


    No.
    What is the correct size? There is no such thing.

    Rule:

    Create as much or as little swap as you really need. How much do I need? As much as you need. >:-P


    If you are hibernating, you need as much swap as ram is in use, plus the swap previously used.
    Roughly a bit more as ram, plus the maximum ammount of swap already in use.

    This can be 1, or 100. Anything.

    If you have lots of ram, and you don't hibernate, and swap is not used, then you don't need any swap.


    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" GM (Minas Tirith))

  4. #4

    Default Re: Do I need to adjust my SWAP size?

    Quote Originally Posted by abacabb View Post
    In the Microsoft world I know that swap needs to be at least 1.5 times the amount of physical memory. Does the same rule apply to the OpenSuSE world?
    That 'rule of thumb' is wrong for Microsoft and is wrong for Linux. Something like it used to be suggested in the late eighties or early nineties, when relatively few megabytes of ram was the norm; even then, for the 'rule' to have any utility, computers that had heavier workloads had to to have more ram, which may have sometimes been the case, with the then cost of ram, but was not universally the case.

    I recently went from 2GB of memory to 8GB. However I noticed that my swap size is only a little over 2GB.
    For normal operation, if the workload has not changed, this means that you need less swap; as lOtz1009 has pointed out, if you suspend to disk, you may need more. OTOH, you might have bought more ram because the workload (or, potentially, bloat in some application(s) that you use) has increased...

    (Whether or not you suspend to disk) I would not reduce the amount of swap, unless you are really very pushed for disk space; the normal case is that wastes a little disk space, of which you have plenty - not a problem.

    If you do have to add swap space for suspend to disk to work reliably, add another swap partition. It can be easy (depending on how your partition table looks currently and where you have spare space), and it works.

    If so, how do I adjust it to the correct size? And is there a way for the system to just automatically calculate the correct size?
    Prior to 11.2 (?), SUSE did not compress on suspend. In those days, you needed an amount of swap equal to the maximum memory consumption (ram+ swap) that you use. This is easy to measure from ksysguard (or similar).

    Currently, you should need less, but as I don't know how to quantify how much less, I'd still go for the same amount, maybe just a shade less, if that came to a convenient round number, or was the amount that you have now.

  5. #5
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,430

    Default Re: Do I need to adjust my SWAP size?

    I'm sure someone will correct me if I am wrong but I think you need a pae kernel to take advantage of all this RAM; I assume you were running a default kernel with 2Gb.

  6. #6
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,580

    Default Re: Do I need to adjust my SWAP size?

    32 bit desktop kernel is a pae so it will use it. But pae is a bank switch solution so there is a fair amount of extra overhead used in the address translations. If you want the best performance use 64 bit OS. The OP did not say if he is running 32 or 64 bit.

  7. #7

    Default Re: Do I need to adjust my SWAP size?

    Quote Originally Posted by gogalthorp View Post
    32 bit desktop kernel is a pae so it will use it. But pae is a bank switch solution so there is a fair amount of extra overhead used in the address translations. If you want the best performance use 64 bit OS. The OP did not say if he is running 32 or 64 bit.
    Running 32 bit OpenSuSE 11.1

  8. #8
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,580

    Default Re: Do I need to adjust my SWAP size?

    Hmmm not sure if the 11.1 desktop kernel is pae. ????

    You can always install the pae version if the system is not seeing more then 4gig.

  9. #9

    Default Re: Do I need to adjust my SWAP size?

    It sees all 8gigs just fine. The only thing that was concerning me was swap size. But according to the other posters here it's really not important unless I am suspending to disk.

  10. #10
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    48

    Default Re: Do I need to adjust my SWAP size?

    Opening and changing large compressed files right? That would be time where I could see the swap being used heavily.

    Is there a way to not dedicate a partition to swap? So as to have it auto expand as need be from an original set size?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •