Learn about Centmin Mod LEMP Stack today
Become a Member

Linode Custom Linode Swap size?

Discussion in 'Virtual Private Server (VPS) hosting' started by rdan, Oct 26, 2014.

  1. rdan

    rdan Well-Known Member

    5,443
    1,402
    113
    May 25, 2014
    Ratings:
    +2,194
    Local Time:
    10:49 AM
    Mainline
    10.2
    How to?
    When you deploy a server on Linode maximum SWAP size is only 512MB.
    How can we have a half size of our VPS Ram? like 4GB.

     
  2. rdan

    rdan Well-Known Member

    5,443
    1,402
    113
    May 25, 2014
    Ratings:
    +2,194
    Local Time:
    10:49 AM
    Mainline
    10.2
  3. eva2000

    eva2000 Administrator Staff Member

    54,098
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    12:49 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Linode uses dedicated disk partition images for swap hence default max size of 511MB.

    Provided you have disk free space, you can create a new image disk set for swap type partition and then edit your configuration profile via Linode dashboard to change the old 511MB swap disk partition for the newly created image disk swap type partition. See Disk Images and Configuration Profiles - Linode Guides & Tutorials

    on my 2GB Linode Xen VPS server staging test server with 2GB newly created disk partition via Linode dashboard
    Code:
    free -m
                 total       used       free     shared    buffers     cached
    Mem:          1994       1272        722          0         17        468
    -/+ buffers/cache:        786       1208
    Swap:         2047          0       2047
    Code:
    swapon -s
    Filename                                Type            Size    Used    Priority
    /dev/xvdb                               partition       2097148 0       -1
    Create a new Disk Image

    linode_disk_images_03.png
    You'll end up with old 512MB swap image and New Swap Image I created.

    linode_disk_images_04.png
    change my existing 512MB Swap Image at /dev/xvdb to the newly created 2048MB swap image I created and hit Save Changes at bottom

    linode_disk_images_05.png

    Then reboot Linode Xen VPS server
     
  4. rdan

    rdan Well-Known Member

    5,443
    1,402
    113
    May 25, 2014
    Ratings:
    +2,194
    Local Time:
    10:49 AM
    Mainline
    10.2
    Ow easy to follow :)
    I thought I would do it via CLI :D
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,098
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    12:49 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Well technically, you can do it the Vultr thread's outlined method too, just disable the existing 512MB swap and unmount it from Linode dashboard's configuration profile. Then you'd be creating a swap partition via SSH command line using the same main primary disk partition instead.