Is the swap partition needed when the root partition and RAM are large enough? [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite













This question already has an answer here:



  • Do I need swap space if I have more than enough amount of RAM?

    12 answers



I want to install Ubuntu on my machine by allocating 400 GB for the / partition and 50 GB for the /home folder and 16GB RAM. Does it make sense, in this case, to create a swap partition or is it useless?







share|improve this question














marked as duplicate by Thomas Dickey, Community♦ Jan 13 at 17:49


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 2




    Swap space doesn't relate directly to hard drive space, except for the fact that it takes up a part of the hard drive space.
    – Mukesh Sai Kumar
    Jan 13 at 17:42






  • 2




    Wow; duplicate in hot questions.
    – Kyslik
    Jan 13 at 19:14






  • 1




    Whether it's useful depends entirely on how the machine is used. e.g. for a server where memory usage is not likely to exceed available RAM, it's not very useful (but it doesn't hurt to have some, just in case), while a desktop machine running programs that use lots of RAM (e.g. chromium or firefox with lots of tabs/windows open), it can be very useful. BTW Linux has zram (uses RAM only) and zswap (uses RAM with block device) which use compression algorithms to increase virtual memory size. compression ratio can be very impressive but depends, of course, on what is being compressed.
    – cas
    Jan 14 at 3:43










  • Very insightful feedback, thank you very much @cas
    – Billal BEGUERADJ
    Jan 14 at 6:00














up vote
0
down vote

favorite













This question already has an answer here:



  • Do I need swap space if I have more than enough amount of RAM?

    12 answers



I want to install Ubuntu on my machine by allocating 400 GB for the / partition and 50 GB for the /home folder and 16GB RAM. Does it make sense, in this case, to create a swap partition or is it useless?







share|improve this question














marked as duplicate by Thomas Dickey, Community♦ Jan 13 at 17:49


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 2




    Swap space doesn't relate directly to hard drive space, except for the fact that it takes up a part of the hard drive space.
    – Mukesh Sai Kumar
    Jan 13 at 17:42






  • 2




    Wow; duplicate in hot questions.
    – Kyslik
    Jan 13 at 19:14






  • 1




    Whether it's useful depends entirely on how the machine is used. e.g. for a server where memory usage is not likely to exceed available RAM, it's not very useful (but it doesn't hurt to have some, just in case), while a desktop machine running programs that use lots of RAM (e.g. chromium or firefox with lots of tabs/windows open), it can be very useful. BTW Linux has zram (uses RAM only) and zswap (uses RAM with block device) which use compression algorithms to increase virtual memory size. compression ratio can be very impressive but depends, of course, on what is being compressed.
    – cas
    Jan 14 at 3:43










  • Very insightful feedback, thank you very much @cas
    – Billal BEGUERADJ
    Jan 14 at 6:00












up vote
0
down vote

favorite









up vote
0
down vote

favorite












This question already has an answer here:



  • Do I need swap space if I have more than enough amount of RAM?

    12 answers



I want to install Ubuntu on my machine by allocating 400 GB for the / partition and 50 GB for the /home folder and 16GB RAM. Does it make sense, in this case, to create a swap partition or is it useless?







share|improve this question















This question already has an answer here:



  • Do I need swap space if I have more than enough amount of RAM?

    12 answers



I want to install Ubuntu on my machine by allocating 400 GB for the / partition and 50 GB for the /home folder and 16GB RAM. Does it make sense, in this case, to create a swap partition or is it useless?





This question already has an answer here:



  • Do I need swap space if I have more than enough amount of RAM?

    12 answers









share|improve this question













share|improve this question




share|improve this question








edited Feb 11 at 14:06









Rui F Ribeiro

35.3k1270113




35.3k1270113










asked Jan 13 at 16:56









Billal BEGUERADJ

1901210




1901210




marked as duplicate by Thomas Dickey, Community♦ Jan 13 at 17:49


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Thomas Dickey, Community♦ Jan 13 at 17:49


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 2




    Swap space doesn't relate directly to hard drive space, except for the fact that it takes up a part of the hard drive space.
    – Mukesh Sai Kumar
    Jan 13 at 17:42






  • 2




    Wow; duplicate in hot questions.
    – Kyslik
    Jan 13 at 19:14






  • 1




    Whether it's useful depends entirely on how the machine is used. e.g. for a server where memory usage is not likely to exceed available RAM, it's not very useful (but it doesn't hurt to have some, just in case), while a desktop machine running programs that use lots of RAM (e.g. chromium or firefox with lots of tabs/windows open), it can be very useful. BTW Linux has zram (uses RAM only) and zswap (uses RAM with block device) which use compression algorithms to increase virtual memory size. compression ratio can be very impressive but depends, of course, on what is being compressed.
    – cas
    Jan 14 at 3:43










  • Very insightful feedback, thank you very much @cas
    – Billal BEGUERADJ
    Jan 14 at 6:00












  • 2




    Swap space doesn't relate directly to hard drive space, except for the fact that it takes up a part of the hard drive space.
    – Mukesh Sai Kumar
    Jan 13 at 17:42






  • 2




    Wow; duplicate in hot questions.
    – Kyslik
    Jan 13 at 19:14






  • 1




    Whether it's useful depends entirely on how the machine is used. e.g. for a server where memory usage is not likely to exceed available RAM, it's not very useful (but it doesn't hurt to have some, just in case), while a desktop machine running programs that use lots of RAM (e.g. chromium or firefox with lots of tabs/windows open), it can be very useful. BTW Linux has zram (uses RAM only) and zswap (uses RAM with block device) which use compression algorithms to increase virtual memory size. compression ratio can be very impressive but depends, of course, on what is being compressed.
    – cas
    Jan 14 at 3:43










  • Very insightful feedback, thank you very much @cas
    – Billal BEGUERADJ
    Jan 14 at 6:00







2




2




Swap space doesn't relate directly to hard drive space, except for the fact that it takes up a part of the hard drive space.
– Mukesh Sai Kumar
Jan 13 at 17:42




Swap space doesn't relate directly to hard drive space, except for the fact that it takes up a part of the hard drive space.
– Mukesh Sai Kumar
Jan 13 at 17:42




2




2




Wow; duplicate in hot questions.
– Kyslik
Jan 13 at 19:14




Wow; duplicate in hot questions.
– Kyslik
Jan 13 at 19:14




1




1




Whether it's useful depends entirely on how the machine is used. e.g. for a server where memory usage is not likely to exceed available RAM, it's not very useful (but it doesn't hurt to have some, just in case), while a desktop machine running programs that use lots of RAM (e.g. chromium or firefox with lots of tabs/windows open), it can be very useful. BTW Linux has zram (uses RAM only) and zswap (uses RAM with block device) which use compression algorithms to increase virtual memory size. compression ratio can be very impressive but depends, of course, on what is being compressed.
– cas
Jan 14 at 3:43




Whether it's useful depends entirely on how the machine is used. e.g. for a server where memory usage is not likely to exceed available RAM, it's not very useful (but it doesn't hurt to have some, just in case), while a desktop machine running programs that use lots of RAM (e.g. chromium or firefox with lots of tabs/windows open), it can be very useful. BTW Linux has zram (uses RAM only) and zswap (uses RAM with block device) which use compression algorithms to increase virtual memory size. compression ratio can be very impressive but depends, of course, on what is being compressed.
– cas
Jan 14 at 3:43












Very insightful feedback, thank you very much @cas
– Billal BEGUERADJ
Jan 14 at 6:00




Very insightful feedback, thank you very much @cas
– Billal BEGUERADJ
Jan 14 at 6:00










4 Answers
4






active

oldest

votes

















up vote
3
down vote



accepted










As @francois says, it is always a good idea to have a partition, mainly because you might have a contingency situation someday, and it will keep the kernel happy.



Modern kernels are however not that much dependent on having swap as in the past.



However, having a large enough root partition, more than enough RAM, and swap being rarely used, it does not need to be a partition. Create a 51MB/1G swap file inside the root partition if you want a simpler configuration.



You will only need larger swap files in production servers like application servers, databases or large web servers.



see Creating a Swap File






share|improve this answer





























    up vote
    3
    down vote













    Swap partition doesn't have links to partition size or partition use but linked to memory & some I/O usage...



    Swap is needed only to manage on this. It's always a good Idea to have e little swap even when it seems to be useless just in case... it should be needed ... someday....



    Even with a 64Gb ram machine I Use some swap if it is an important machine like production server or backup machine for example.






    share|improve this answer




















    • It also depend on the type of production servers, their loads and how much RAM you allocated for them. As a rule of thumb, DHCP/DNS servers wont need it much, Java-based application servers or MySQL server might need a larger swap often in a while.
      – Rui F Ribeiro
      Jan 13 at 17:26


















    up vote
    3
    down vote













    Swap is just like an extension to your physical RAM, and it caches unused data from your RAM, freeing critical RAM space, and speeding some of your operations up. It doesn't have any direct relation to how much space you allocate for each partition. If you're sure that you have plenty of RAM, then you may simply give a lesser amount of swap. But just in case, using a large and generous swap partition ( >= 1 GB) is all good and fine.



    There used to be an old rule: Swap = RAM * 2, but this doesn't apply to modern systems.



    For more information about what swap is, refer here. Or better, google it out.






    share|improve this answer
















    • 1




      I also agree that nowadays a 1-2G partition should be enough for most common servers.
      – Rui F Ribeiro
      Jan 13 at 17:10


















    up vote
    1
    down vote













    Swap needs will depend on how much RAM you have and what your system will be used for. I give my machine with 16gb of RAM 4gb of swap, it very rarely gets used. My linode.com VPS with 1gb of ram has 256mb swap and even acting as mail/web/etc for a private domain it rarely uses swap.



    Depending on what the machine will be used for I'd reconsider that space allocation - my /home takes much more space than the rest of the filesystem, except for one spot that I store ISO and OVA files on (which is actually yet another disk on a different mount point).






    share|improve this answer



























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      3
      down vote



      accepted










      As @francois says, it is always a good idea to have a partition, mainly because you might have a contingency situation someday, and it will keep the kernel happy.



      Modern kernels are however not that much dependent on having swap as in the past.



      However, having a large enough root partition, more than enough RAM, and swap being rarely used, it does not need to be a partition. Create a 51MB/1G swap file inside the root partition if you want a simpler configuration.



      You will only need larger swap files in production servers like application servers, databases or large web servers.



      see Creating a Swap File






      share|improve this answer


























        up vote
        3
        down vote



        accepted










        As @francois says, it is always a good idea to have a partition, mainly because you might have a contingency situation someday, and it will keep the kernel happy.



        Modern kernels are however not that much dependent on having swap as in the past.



        However, having a large enough root partition, more than enough RAM, and swap being rarely used, it does not need to be a partition. Create a 51MB/1G swap file inside the root partition if you want a simpler configuration.



        You will only need larger swap files in production servers like application servers, databases or large web servers.



        see Creating a Swap File






        share|improve this answer
























          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          As @francois says, it is always a good idea to have a partition, mainly because you might have a contingency situation someday, and it will keep the kernel happy.



          Modern kernels are however not that much dependent on having swap as in the past.



          However, having a large enough root partition, more than enough RAM, and swap being rarely used, it does not need to be a partition. Create a 51MB/1G swap file inside the root partition if you want a simpler configuration.



          You will only need larger swap files in production servers like application servers, databases or large web servers.



          see Creating a Swap File






          share|improve this answer














          As @francois says, it is always a good idea to have a partition, mainly because you might have a contingency situation someday, and it will keep the kernel happy.



          Modern kernels are however not that much dependent on having swap as in the past.



          However, having a large enough root partition, more than enough RAM, and swap being rarely used, it does not need to be a partition. Create a 51MB/1G swap file inside the root partition if you want a simpler configuration.



          You will only need larger swap files in production servers like application servers, databases or large web servers.



          see Creating a Swap File







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 13 at 17:42

























          answered Jan 13 at 17:05









          Rui F Ribeiro

          35.3k1270113




          35.3k1270113






















              up vote
              3
              down vote













              Swap partition doesn't have links to partition size or partition use but linked to memory & some I/O usage...



              Swap is needed only to manage on this. It's always a good Idea to have e little swap even when it seems to be useless just in case... it should be needed ... someday....



              Even with a 64Gb ram machine I Use some swap if it is an important machine like production server or backup machine for example.






              share|improve this answer




















              • It also depend on the type of production servers, their loads and how much RAM you allocated for them. As a rule of thumb, DHCP/DNS servers wont need it much, Java-based application servers or MySQL server might need a larger swap often in a while.
                – Rui F Ribeiro
                Jan 13 at 17:26















              up vote
              3
              down vote













              Swap partition doesn't have links to partition size or partition use but linked to memory & some I/O usage...



              Swap is needed only to manage on this. It's always a good Idea to have e little swap even when it seems to be useless just in case... it should be needed ... someday....



              Even with a 64Gb ram machine I Use some swap if it is an important machine like production server or backup machine for example.






              share|improve this answer




















              • It also depend on the type of production servers, their loads and how much RAM you allocated for them. As a rule of thumb, DHCP/DNS servers wont need it much, Java-based application servers or MySQL server might need a larger swap often in a while.
                – Rui F Ribeiro
                Jan 13 at 17:26













              up vote
              3
              down vote










              up vote
              3
              down vote









              Swap partition doesn't have links to partition size or partition use but linked to memory & some I/O usage...



              Swap is needed only to manage on this. It's always a good Idea to have e little swap even when it seems to be useless just in case... it should be needed ... someday....



              Even with a 64Gb ram machine I Use some swap if it is an important machine like production server or backup machine for example.






              share|improve this answer












              Swap partition doesn't have links to partition size or partition use but linked to memory & some I/O usage...



              Swap is needed only to manage on this. It's always a good Idea to have e little swap even when it seems to be useless just in case... it should be needed ... someday....



              Even with a 64Gb ram machine I Use some swap if it is an important machine like production server or backup machine for example.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jan 13 at 17:02









              francois P

              914114




              914114











              • It also depend on the type of production servers, their loads and how much RAM you allocated for them. As a rule of thumb, DHCP/DNS servers wont need it much, Java-based application servers or MySQL server might need a larger swap often in a while.
                – Rui F Ribeiro
                Jan 13 at 17:26

















              • It also depend on the type of production servers, their loads and how much RAM you allocated for them. As a rule of thumb, DHCP/DNS servers wont need it much, Java-based application servers or MySQL server might need a larger swap often in a while.
                – Rui F Ribeiro
                Jan 13 at 17:26
















              It also depend on the type of production servers, their loads and how much RAM you allocated for them. As a rule of thumb, DHCP/DNS servers wont need it much, Java-based application servers or MySQL server might need a larger swap often in a while.
              – Rui F Ribeiro
              Jan 13 at 17:26





              It also depend on the type of production servers, their loads and how much RAM you allocated for them. As a rule of thumb, DHCP/DNS servers wont need it much, Java-based application servers or MySQL server might need a larger swap often in a while.
              – Rui F Ribeiro
              Jan 13 at 17:26











              up vote
              3
              down vote













              Swap is just like an extension to your physical RAM, and it caches unused data from your RAM, freeing critical RAM space, and speeding some of your operations up. It doesn't have any direct relation to how much space you allocate for each partition. If you're sure that you have plenty of RAM, then you may simply give a lesser amount of swap. But just in case, using a large and generous swap partition ( >= 1 GB) is all good and fine.



              There used to be an old rule: Swap = RAM * 2, but this doesn't apply to modern systems.



              For more information about what swap is, refer here. Or better, google it out.






              share|improve this answer
















              • 1




                I also agree that nowadays a 1-2G partition should be enough for most common servers.
                – Rui F Ribeiro
                Jan 13 at 17:10















              up vote
              3
              down vote













              Swap is just like an extension to your physical RAM, and it caches unused data from your RAM, freeing critical RAM space, and speeding some of your operations up. It doesn't have any direct relation to how much space you allocate for each partition. If you're sure that you have plenty of RAM, then you may simply give a lesser amount of swap. But just in case, using a large and generous swap partition ( >= 1 GB) is all good and fine.



              There used to be an old rule: Swap = RAM * 2, but this doesn't apply to modern systems.



              For more information about what swap is, refer here. Or better, google it out.






              share|improve this answer
















              • 1




                I also agree that nowadays a 1-2G partition should be enough for most common servers.
                – Rui F Ribeiro
                Jan 13 at 17:10













              up vote
              3
              down vote










              up vote
              3
              down vote









              Swap is just like an extension to your physical RAM, and it caches unused data from your RAM, freeing critical RAM space, and speeding some of your operations up. It doesn't have any direct relation to how much space you allocate for each partition. If you're sure that you have plenty of RAM, then you may simply give a lesser amount of swap. But just in case, using a large and generous swap partition ( >= 1 GB) is all good and fine.



              There used to be an old rule: Swap = RAM * 2, but this doesn't apply to modern systems.



              For more information about what swap is, refer here. Or better, google it out.






              share|improve this answer












              Swap is just like an extension to your physical RAM, and it caches unused data from your RAM, freeing critical RAM space, and speeding some of your operations up. It doesn't have any direct relation to how much space you allocate for each partition. If you're sure that you have plenty of RAM, then you may simply give a lesser amount of swap. But just in case, using a large and generous swap partition ( >= 1 GB) is all good and fine.



              There used to be an old rule: Swap = RAM * 2, but this doesn't apply to modern systems.



              For more information about what swap is, refer here. Or better, google it out.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jan 13 at 17:07









              Mukesh Sai Kumar

              27819




              27819







              • 1




                I also agree that nowadays a 1-2G partition should be enough for most common servers.
                – Rui F Ribeiro
                Jan 13 at 17:10













              • 1




                I also agree that nowadays a 1-2G partition should be enough for most common servers.
                – Rui F Ribeiro
                Jan 13 at 17:10








              1




              1




              I also agree that nowadays a 1-2G partition should be enough for most common servers.
              – Rui F Ribeiro
              Jan 13 at 17:10





              I also agree that nowadays a 1-2G partition should be enough for most common servers.
              – Rui F Ribeiro
              Jan 13 at 17:10











              up vote
              1
              down vote













              Swap needs will depend on how much RAM you have and what your system will be used for. I give my machine with 16gb of RAM 4gb of swap, it very rarely gets used. My linode.com VPS with 1gb of ram has 256mb swap and even acting as mail/web/etc for a private domain it rarely uses swap.



              Depending on what the machine will be used for I'd reconsider that space allocation - my /home takes much more space than the rest of the filesystem, except for one spot that I store ISO and OVA files on (which is actually yet another disk on a different mount point).






              share|improve this answer
























                up vote
                1
                down vote













                Swap needs will depend on how much RAM you have and what your system will be used for. I give my machine with 16gb of RAM 4gb of swap, it very rarely gets used. My linode.com VPS with 1gb of ram has 256mb swap and even acting as mail/web/etc for a private domain it rarely uses swap.



                Depending on what the machine will be used for I'd reconsider that space allocation - my /home takes much more space than the rest of the filesystem, except for one spot that I store ISO and OVA files on (which is actually yet another disk on a different mount point).






                share|improve this answer






















                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  Swap needs will depend on how much RAM you have and what your system will be used for. I give my machine with 16gb of RAM 4gb of swap, it very rarely gets used. My linode.com VPS with 1gb of ram has 256mb swap and even acting as mail/web/etc for a private domain it rarely uses swap.



                  Depending on what the machine will be used for I'd reconsider that space allocation - my /home takes much more space than the rest of the filesystem, except for one spot that I store ISO and OVA files on (which is actually yet another disk on a different mount point).






                  share|improve this answer












                  Swap needs will depend on how much RAM you have and what your system will be used for. I give my machine with 16gb of RAM 4gb of swap, it very rarely gets used. My linode.com VPS with 1gb of ram has 256mb swap and even acting as mail/web/etc for a private domain it rarely uses swap.



                  Depending on what the machine will be used for I'd reconsider that space allocation - my /home takes much more space than the rest of the filesystem, except for one spot that I store ISO and OVA files on (which is actually yet another disk on a different mount point).







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 13 at 17:37









                  ivanivan

                  3,1291213




                  3,1291213












                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Displaying single band from multi-band raster using QGIS

                      How many registers does an x86_64 CPU actually have?