Join the community today
Become a Member

What is the ideal swap size for dedicated server

Discussion in 'Dedicated server hosting' started by negative, Sep 12, 2018.

  1. negative

    negative Premium Member Premium Member

    222
    23
    18
    Apr 11, 2015
    Ratings:
    +51
    Local Time:
    12:54 PM
    1.9.10
    10.1.11
    Hello

    I have 2x E2650 Xenon CPU (32 Core total) server with 48GB DDR3 Memory also 4x300GB SAS disk with HP 1GB Raid Controller.

    And i'm using the centmin beta on this server.

    What is the ideal swap size for this server? I set it to 1GB while setup so i'm interesting that it is right or should be higher ?

    Code (Text):
    free -m
                  total        used        free      shared  buff/cache   available
    Mem:          48135       14293        3682         388       30158       32758
    Swap:          1023           6        1017
    


    Thanks
     
  2. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    7:54 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    really depends on your memory usage requirements i.e. if you use more than physical memory available and by how much more. Monitor your memory usage over time and see
     
    • Informative Informative x 1
  3. bassie

    bassie Active Member

    939
    220
    43
    Apr 29, 2016
    Ratings:
    +664
    Local Time:
    11:54 AM
    With a swap file.
    It allows an operating system to use the disk to simulate extra memory.
    When the system runs low on memory. Swap files are mostly used by old or low memory -systems (VPS servers etc).

    But as your server only consumes about 1/3 of it's total available memory.
    A swap file is theoretically not necessary.

    Red Hat advises an amount of 20% of the RAM as swap on modern systems in general.
    If your disk allows it, you could use a number of GB, lets say 20% of your total memory = +-9,6 GB for the swap
    (As a guarantee for a possible memory peak)

    If your server regularly approach the full swap in the future. Consider a memory upgrade.
     
    • Informative Informative x 1
    • Useful Useful x 1
..