The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Is it possible to increase swap partition ?

Discussion in 'General Discussion' started by globcom, Mar 6, 2014.

  1. globcom

    globcom Active Member

    Joined:
    May 24, 2008
    Messages:
    43
    Likes Received:
    1
    Trophy Points:
    8
    Hi,

    My swap partition is too small.
    I must do a swapoff -a , swapon -a to empty it.

    Is it possible to increase swap partition ?
    and
    How ?

    #swapon -s
    Filename Type Size Used Priority
    /dev/sda7 partition 1048568 8180 -1

    Thanks :)
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    It's possible, but not through any cPanel/WHM features. This is an OS-level task that should be handled with care. CentOS provides documentation on this at:

    CentOS - Adding Swap Space

    Thank you.
     
  3. globcom

    globcom Active Member

    Joined:
    May 24, 2008
    Messages:
    43
    Likes Received:
    1
    Trophy Points:
    8
    Thank you Mickael

    you wrote: "This is an OS-level task that should be handled with care."

    If, if I apply the tutorial "5.2.1. Extending Swap on an LVM2 Logical Volume" from your link, what are the risks ?

    Regards,
    Eric
     
  4. TheJudge

    TheJudge Member

    Joined:
    Mar 6, 2014
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    Usually I would say you should look how much of the swap space is currently used and if you have enough free memory to move that swap space to RAM but since you are already doing swapoff and swapon I assume that you know the risks of doing these two actions.

    Besides this, there is no other risk involved in increasing a swap partition.

    Regards,
    Raul
     
  5. globcom

    globcom Active Member

    Joined:
    May 24, 2008
    Messages:
    43
    Likes Received:
    1
    Trophy Points:
    8
    Thank you Raul,

    I have 64 Go of ram in this server.
    I think increase swap partition to 8 or 16 Go.
    Could you think is a good choice ?

    Eric
     
  6. TheJudge

    TheJudge Member

    Joined:
    Mar 6, 2014
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    If you can afford 16GB of swap I would go with that option.
    Everything beyond 16GB of swap on normal disks(even 15k disks) is a waste in my opinion(at least for this type of services). Why? Because the applications writing that amount(more than 16GB) of pages to swap will definitely suffer performance issues.


    Regards,
    Raul
     
  7. globcom

    globcom Active Member

    Joined:
    May 24, 2008
    Messages:
    43
    Likes Received:
    1
    Trophy Points:
    8
    Thank you Raul :)
    I will try to increase swap to 16 go this night.

    Regards,
    Eric
     
Loading...

Share This Page