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.

Ram usage in WHM is not the sam in SSH

Discussion in 'General Discussion' started by Ahmed Saleh, Nov 4, 2011.

  1. Ahmed Saleh

    Ahmed Saleh Member

    Joined:
    Dec 16, 2009
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Hello ,

    i want to know why the ram usage shown in WHM (service status) is not the same result of "free -m" in SSH ?

    for example :
    (WHM)
    Memory Used 7.93% (975,028 of 12,289,720)

    (SSH)

    Code:
    root@server [~]# free -m
                 total       used       free     shared    buffers     cached
    Mem:         12001       5930       6070          0        298       4709
    
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Can you post the full output of free -m since it should include buffers/cache details as well? I do see a buffers and cached line but typically you'll have it show like the following:

    Code:
    free -m
                 total       used       free     shared    buffers     cached
    Mem:          #       #        #          #          #          #
    -/+ buffers/cache:       #        #
    Swap:            #          #          #
    Where # represents some number.
     
  3. Ahmed Saleh

    Ahmed Saleh Member

    Joined:
    Dec 16, 2009
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Hello ,

    this is the free -m output :

    Code:
    root@server [~]# free -m
                 total       used       free     shared    buffers     cached
    Mem:         12001       5084       6917          0         51       4124
    -/+ buffers/cache:        908      11093
    Swap:         2055          0       2055
    
    and this is WHM reads in same time :
    Code:
    Memory Used 	7.97% (979,608 of 12,289,720)
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    This matches up with this line:

    Code:
    -/+ buffers/cache:        908      11093
    These are in megabytes and WHM is in kilobytes:

    908 megabytes = 929 792 kilobytes similar to 979,608 kilobytes shown as used (since it is the used portion of the buffer/cache)
    11093 megabytes = 11359232 kilobytes similar to 12,289,720 kilobytes shown as free

    There is a very slight discrepancy, but that's likely due to the WHM display having slightly cached results when it takes the usage.

    Under Linux, the buffers/cache line is what determines what is used and what is free for RAM because Linux puts memory into the buffer/cache for use and then only uses what is needs at the time. It is the used portion of buffers/cache that tells you how much actual memory is being used.
     
  5. Ahmed Saleh

    Ahmed Saleh Member

    Joined:
    Dec 16, 2009
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    so i should look at "-/+ buffers/cache" to know the actual ram usage ?

    thanks a lot :)
     
    #5 Ahmed Saleh, Nov 18, 2011
    Last edited: Nov 18, 2011
  6. eva2000

    eva2000 Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    322
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Brisbane, Australia
    cPanel Access Level:
    Root Administrator
    Twitter:
  7. rockhost

    rockhost Member

    Joined:
    Feb 27, 2011
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    I have found this thread pretty useful. For an even better example try using the 'free -k' command to view both SSH and WHM figures in kilobytes.

    SSH

    Code:
    wasp@wasp [~]# free -k
                 total           used             free         shared    buffers     cached
    Mem:     16413692   16287800     125892    0            267404    15181144
    -/+ buffers/cache:    839252         15574440
    Swap:    2104504     156               2104348
    
    WHM

    Code:
    Server load 	2.43 (8 CPUs) 	
    Memory Used 	5.31% (871,908 of 16,413,692) 	
    Swap Used 	0.01% (156 of 2,104,504) 	
    
    As you can see the total amount of memory available is reported as 16,413,692 in both interfaces. The total amount of used memory is 839252 via SSH and 871,908 via WHM, which display a slight discrepancy due to the few seconds between loading the WHM 'Service Status' page and executing the SSH 'free' command as I toggled between applications.
     
  8. djzeus

    djzeus Registered

    Joined:
    Nov 19, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    I have the same problem. In my WHM appears a lower value than the real RAM memory in use.

    How can I config WHM to display the real used RAM memory?

    I have friends that has WHM and appears correct this thing (RAM in use).

    Regards,

    - - - Updated - - -

    Note: I use an VPS with OpenVZ virtualization and the last WHM version (11.34).

    Thank
     
  9. concerto49

    concerto49 Member

    Joined:
    Nov 1, 2012
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Are you using a VPS with "burst" memory and not VSwap? Avoid burst as it uses a lot more memory. VSwap will display correct memory output.
     
Loading...

Share This Page