RAM usage strangely high, does Apache reserve RAM?
I have a VPS with 4 CPUs & 8GB of RAM.
From my VPS I run a static website, and an eCommerce system which essentially hosts a REST API in Laravel as a backend to some mobile apps I have published.
Traffic is low, with no more than 100/300 users per month.
Recently (as in the last month), I've noticed that on the Server dashboard (the home page on GoDaddy that allows you to launch cPanel or WHM, my RAM usage gets higher and higher as time goes on. The highest I let it get to was 91%. When I restart my VPS it goes back down to 20/30% and again gradually increases over a couple of weeks.
Somebody told me that on Microsoft IIS that the Microsoft SQL server grabs virtually all RAM and releases it if needed.
My server is running Apache, but just wondered if this is a similar thing, or should I be concerned about the RAM usage?
I contacted GoDaddy support, but they're pretty useless, so thought I'd ask here.
One final strange thing is that inside WHM Server Status>Server Status: it shows the following under System Information:
11.65% (932,944 of 8,008,868
This is completely different to the RAM usage shown on my VPS home page.
Thanks for posting this question. The first thing to note here is that Linux will normally use as much free RAM that it safely can for various operations, but when a process with a higher priority needs the RAM, the OS will allow the other process to use it. With that said, Apache should consume some CPU and RAM resources by default and depending on its configuration it can consume more or less of those resources dynamically as it spins up and stops workers to serve traffic.
When the usage is higher you may want to first confirm that Apache processes are the culprit. If you confirm Apache processes are using a lot of RAM, it would be best to first make sure any hosted sites are as efficient as possible. Then, it might help to re-configure Apache with the goal of limiting the amount of RAM it's allowed to consume. If limiting the RAM becomes an issue, you may need to upgrade the server so it has a higher RAM limit. You may also want to see how the usage is when using a content delivery network.