Discover Centmin Mod today
Register Now

What is the ideal swap size for dedicated server

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

  1. negative

    negative Active Member

    Apr 11, 2015
    Local Time:
    4:42 AM

    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

  2. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    12:42 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 Well-Known Member

    Apr 29, 2016
    Local Time:
    3:42 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