Perfect Server does not utilize whole amount of RAM

Discussion in 'Installation/Configuration' started by Poliman, Dec 17, 2018.

  1. Poliman

    Poliman Member

    I have Perfect Server based on Ubuntu 16.04 LTS. There is 7GB RAM. The problem is with RAM utilization. If ram is used around 4,3 - 4,4GB services like amavisd, mysql yell about, for example, memory allocation failing, although there is around 2,5GB free RAM. Do you know what can be?
     
  2. nhybgtvfr

    nhybgtvfr Active Member

    probably a bit of a long shot, but are you definitely using a 64 bit cpu or version of ubuntu? 32 bits can only address around 4GB of ram.
     
  3. Poliman

    Poliman Member

    I think I use 64bit both - OS and CPU. I am not that stupid.:D Take a look:
    - OS
    Code:
    [email protected]:~# uname -m
    x86_64
    - CPU (4 vCores):
    Code:
    processor       : 3
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 60
    model name      : Intel Core Processor (Haswell, no TSX)
    stepping        : 1
    microcode       : 0x1
    cpu MHz         : 2194.842
    cache size      : 4096 KB
    physical id     : 3
    siblings        : 1
    core id         : 0
    cpu cores       : 1
    apicid          : 3
    initial apicid  : 3
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 13
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc rep_good nopl pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm invpcid_single kaiser tpr_shadow vnmi flexpriority ept vpid fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt arat
    bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
    bogomips        : 4389.68
    clflush size    : 64
    cache_alignment : 64
    address sizes   : 40 bits physical, 48 bits virtual
    power management:
    
    It's really strange for me. Some time ago I had to add some swap to secure against services crashes.
     
  4. nhybgtvfr

    nhybgtvfr Active Member

    well, I did say it was a long shot...

    7Gb of ram seems to be a bit of an odd number though. is it a physical machine or a vm? if physical, does it have mismatched sticks of ram in it? could be a dodgy bit of ram, might recognize the size of that memory stick ok, but have problems actually accessing it.
     
  5. Poliman

    Poliman Member

    Don't worry. I am joking. ;) It's VM living on some cluster in OVH.
     
  6. nhybgtvfr

    nhybgtvfr Active Member

    ok. well dunno about ovh. but with vm's it is possible to allocate more ram to all the vm's than actually physically exists on the host. the assumption (hope) being that they won't all need it all at the same time.
    could be that there simply isn't any physical ram left for it to use, even though it thinks there's a couple of gigs still available to it.
     
  7. Poliman

    Poliman Member

    Hmm, it could be but in case of vps. Still unclear but appreciate your explanation, because it could be. Who knows.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Contact the support of your VPS hosting provider.
     
  9. Poliman

    Poliman Member

    Yea, I will have to. I thought it could be something related with Ubuntu configuration. :)
     
  10. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You wrote host has 7 GB memory, but show nothing to verify it actually does have that amount. What shows:
    Code:
    free
    You wrote memory allocation is failing, show messages you get that prove this point. Maybe there is more info on what is happening in those error messages.
     
    ahrasis likes this.
  11. Poliman

    Poliman Member

    Yes, I could week ago. Today machine has 15GB and utilize around 4,8 - 5,1GB and each service works perfect. On old setup with 7GB ram, the ram utilization was around 4,3 - 4,4 and then were crashes. That was the reason I added 2GB swap. Btw, result of "free -h":
    Code:
    [email protected]:~# free -h
                  total        used        free      shared  buff/cache   available
    Mem:            14G        4.8G        270M        564M        9.3G        8.6G
    Swap:          4.0G        101M        3.9G
    
    I try find something in logs related with errors I mentioned earlier.

    PS
    It was like this:
    Code:
    FAILED: run_command: can't fork: Cannot allocate memory at /usr/sbin/amavisd-new
     
    Last edited: Dec 18, 2018
  12. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Does that free command show the situation at the time the cannot allocate memory happens?
    According to free, host has loads of memory free and swap in almost unused, show there is memory available. Unless amavis-new tries to get more memory than the host has, the fork should work.
    Just to be sure, what shows:
    Code:
    dpkg --print-architecture
    
    Try running something that shows memory situation while the cannot allocate happens. For example, keep this command running and check after you get the error.
    Code:
    dstat --time --mem --load --cpu -C total -s  10
    Install dstat if it is not already installed.
     
  13. Poliman

    Poliman Member

    No. Currently it's 15GB + 2GB swap. Now all work perfect.
    Code:
    [email protected]:~# dpkg --print-architecture
    amd64
    
    I need to befriend with dstat and it's parameters. ;)Ok, I know what each parameters means except "10" at the end.

    PS
    I am affraid in current situation it won't be possible to provide memory allocation failed error. I have too much ram. Currently server uses 5,2GB ram and 0,1GB swap.
     
    Last edited: Dec 18, 2018

Share This Page