Welcome to the Linux Foundation Forum!

SWAP SPACE Partition question

RickSMO
RickSMO Posts: 123

I have a question regarding swap space, I know linux uses that as virtual memory, I am currently running on ubuntu server 10.10.

Here is my question, will I see a speed increase since I have the space to spare, if I make a additional large swap space partition, or increase the size of my current one, my current swap space is 13 gigs.

Comments

  • mfillpot
    mfillpot Posts: 2,177
    The swap partition is very rarely used, it is only a backup location when your RAM has been filled. When it is in use you will see a reduction in system speed because a hard disk is far slower than RAM. The general rule is to set your swap to 2x RAM or 2G which ever is smaller.

    Blowing up your swap space beyond your needs will not make the system faster, if you wish to use more swap than RAM you can search good for instructions to change your swappiness, after a test on that you will see why swap is for backup only.
  • RickSMO
    RickSMO Posts: 123
    makes sense, thanks.
  • Here is a screenshot of my laptop swap status.

    I have a typical habit of assigning 2x times of RAM size. But this theory works out for moderate desktop or PC configurations.

    Larger servers may need a different formula to work out how much swap is required. Anyway, as you can see if the SWAP usage is 90% ZERO all the times, you can reduce the SWAP eventually. Since usually allocating larger space is a overhead for kernel.

    This is applicable for swap memory than compared to your utility other partitions. Screenshot_5.png
  • marc
    marc Posts: 647
    kiran.kankipati wrote:
    I have a typical habit of assigning 2x times of RAM size. But this theory works out for moderate desktop or PC configurations.

    That might have been true years (many!) ago. It is not anymore.

    You do not want to use swap, at all. In fact, it should be used only in rare cases(like if there's some kind of problem with some software that is taking up way to much memory).

    If you are constantly using swap... GET MORE RAM!!!
  • marc
    marc Posts: 647
    0nto wrote:
    use your SWAP space 3x from your RAM it will help you :D

    As I've said many times: that is not true, at all.

    It's easy to have nowadays 8Gb of ram: should I have 24 freaking gigs for swap?!?!?!?!? That is just nonsense.

    In a regular desktop (and most servers) having a great swap is totally unnecessary!

Categories

Upcoming Training