Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How much RAM do I need

Discussion in 'Workarounds and Optimization' started by Thunderchild, Aug 4, 2018.

  1. Thunderchild

    Thunderchild Well-Known Member

    Joined:
    Jan 28, 2018
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    I have a server with 4 cores, 100 GB SSD and 2 GB of RAM. clamd keeps crashing and on a couple of occasions the domain server too. is 2GB enough? I have 7 sites active. My provider expects me to upgrade the whole server giving me 6 processors and 150GB SSD to get a further 2GB of RAM, I only use 15 GB of SSD and 0.2% of processor currently.
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,782
    Likes Received:
    94
    Trophy Points:
    353
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    Nobody is going to able to answer your question with any certainly
    What does free -m say when you are at peak usage
    and are all your sites optimized
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Thunderchild

    Thunderchild Well-Known Member

    Joined:
    Jan 28, 2018
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    I don't know when I am at peak usage, usually it clamd crashes overnight. I am just trying to get a feel for what is typical, is it something I have done wrong/not done or is 2GB a bit low? I have lowered the allowed RAM for each script from 128MB to 96MB and clamd crashes less often but still crashes.
     
  4. JayFromEpic

    JayFromEpic Well-Known Member

    Joined:
    Apr 2, 2011
    Messages:
    217
    Likes Received:
    7
    Trophy Points:
    68
    Location:
    Michigan
    cPanel Access Level:
    Root Administrator
    While 2GB of ram is a modest amount, most servers now a days are running 8gb+. It's impossible to know exactly what is needed if you have no clue on just hoe much ram each of your websites are using. What have you done so far to optimize your server?

    Additionally, if you are unsure and budget is a concern, you may want to look into moving to a vps that can be scaled as needed or into a cloud instance which would allow the same.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Thunderchild

    Thunderchild Well-Known Member

    Joined:
    Jan 28, 2018
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Well clearly more than 64MB each but less than 96MB. I have now upgraded to PHP7.x and it's default setting was 32MB and websites ran on that. clamd seems to require 500MB as it reports usiing 26% of RAM, why WHM can't just give me the total RAM used I don't know as it tracks eacch individual process....

    I am currently paying £45, they want £60 to get 4GB of RAM of course with 2 more unneeded processors and another 50GB of SSD. I see other providers that offer custom jobs where I can get 3-4GB of RAM with 2 cores and 30GB SSD for much less than I currently pay. Of coulse i have the moving headache once again.
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,506
    Likes Received:
    1,964
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @Thunderchild,

    The following resource is a good place to start when troubleshooting high amounts of resource usage:

    Tutorial - Troubleshooting high server loads on Linux servers

    As far as ClamAV failing, do you notice any output in /var/log/exim_mainlog or /var/log/messages at the times it's reported to have failed that suggest a lack of available memory is the culprit?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,799
    Likes Received:
    131
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    Is the VPS KVM or Xen based?

    Since the hard drive space is SSD, you could create a swap file and use it for swap memory.

    With SSD swap space, you're probably not going to notice a lot of performance issues related to swap space memory issues. After all, SSD is essentially just non-volatile memory.

    I'm not saying it will give you the same performance as pure memory, and a lot of it would depend on just how much disk I/O you have for the SSD drives (no doubt they are shared among other virtual environments). And this won't work in an OpenVZ or Virtuozzo environment.
     
  8. Thunderchild

    Thunderchild Well-Known Member

    Joined:
    Jan 28, 2018
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    I have tried setting up swap space but it did not work on a reboot even though I followed all of the steps. I have tried to set it up again without success. I get emails from the server stating that clamd was terminated due to a lack of RAM.

    adding and switching to PHP7 seems to have made quite a difference as sites that previously used 64-96MB now use under 32MB
     
    #8 Thunderchild, Aug 6, 2018
    Last edited: Aug 6, 2018
  9. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,799
    Likes Received:
    131
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    To make an extra swap file on the server:

    dd if=/dev/zero of=/extraswap bs=1M count=4096
    mkswap /extraswap
    swapon /extraswap


    This will create an extra 4GB of swap memory on the server. Again, this will only work on KVM and Xen (actually I'm not sure about Xen). Adjust the count variable as needed, although I probably wouldn't go crazy with this. If you need more than 4GB, then you're probably doing something wrong.

    Then edit the /etc/fstab file (is this still relevant in CentOS/RHEL 7?) with:

    /extraswap none swap sw 0 0

    That should make it persistent.

    This may not help, but it's certainly something I'd try, it won't cost you anything.
     
  10. Thunderchild

    Thunderchild Well-Known Member

    Joined:
    Jan 28, 2018
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    What is KVM and Xen ?

    swapon: /extraswap: insecure permissions 0644, 0600 suggested.
     
    #10 Thunderchild, Aug 7, 2018
    Last edited by a moderator: Aug 7, 2018
  11. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,799
    Likes Received:
    131
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    KVM and Xen are virtualization technologies. I am assuming (given the low memory) that you have a VPS and not a full dedicated server. So the server you have is using some type of virtualization. OpenVZ and Virtuozzo are other popular "virtualizations" (they're not real virtualizations, but that's an argument for another day). I'm sure there are other virtualization technologies out there, but these are the ones that I am familiar with.

    Change the permissions on the extraswap file before issuing the swapon command

    chmod 600 /extraswap
     
  12. Thunderchild

    Thunderchild Well-Known Member

    Joined:
    Jan 28, 2018
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    I have found something called Munin in my plugins section, this seem to give various graphs for various aspects of the sever one being RAM, i take it i can use this as a measure of what i am using and to help understand what i may need if i want to increase the amount of accounts on the sever?
     
  13. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,506
    Likes Received:
    1,964
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Any type of plugin (e.g. Munin) that monitors and reports resource usage will help you to better form an understanding of how your system is performing. Here's a third-party URL related to Munin and RAM usage you may find helpful:

    Interpreting munin graph and committed memory

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice