CentOS Swap Size

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AzteK
    Confirmed User
    • Feb 2001
    • 3451

    #1

    CentOS Swap Size

    I'm trying to figure out how much to allocate for swap. I usually do half the ram. So if it's a 32g machine I allocate 16g for the swap. How much do you allocate?
  • 2MuchMark
    Mark of 2Much.net
    • Aug 2004
    • 50990

    #2
    Originally posted by AzteK
    I'm trying to figure out how much to allocate for swap. I usually do half the ram. So if it's a 32g machine I allocate 16g for the swap. How much do you allocate?
    I'm not sure but I think essentially you are trading ram for speed. Wouldn't this depend on the size of your application and how much data you need to store in ram for that app?

    Comment

    • Ferus
      Bye - Left to do stuff
      • Feb 2013
      • 4108

      #3
      Centos best practice:

      Twice the size of RAM if RAM is less than 2 GB

      Size of RAM + 2 GB if RAM size is more than 2 GB i.e. 5GB of swap for 3GB of RAM

      Comment

      • AzteK
        Confirmed User
        • Feb 2001
        • 3451

        #4
        Originally posted by 2MuchMark
        I'm not sure but I think essentially you are trading ram for speed. Wouldn't this depend on the size of your application and how much data you need to store in ram for that app?
        Yes, that is correct.

        Here is Redhat's recommendation

        https://access.redhat.com/documentat...e/ch-swapspace

        Comment

        • Porn academy
          Confirmed User
          • May 2010
          • 78

          #5
          we follow their recommendation on our servers and till now no problems.

          4GB of RAM or less a minimum of 2GB of swap space
          4GB to 16GB of RAM a minimum of 4GB of swap space
          16GB to 64GB of RAM a minimum of 8GB of swap space
          64GB to 256GB of RAM a minimum of 16GB of swap space
          256GB to 512GB of RAM a minimum of 32GB of swap space

          Comment

          • AzteK
            Confirmed User
            • Feb 2001
            • 3451

            #6
            Originally posted by Porn academy
            we follow their recommendation on our servers and till now no problems.

            4GB of RAM or less a minimum of 2GB of swap space
            4GB to 16GB of RAM a minimum of 4GB of swap space
            16GB to 64GB of RAM a minimum of 8GB of swap space
            64GB to 256GB of RAM a minimum of 16GB of swap space
            256GB to 512GB of RAM a minimum of 32GB of swap space
            yeah this is what I ended up going with - thanks guys!

            Comment

            Working...