How to determine if i need more RAM?

lakiscy

New member
Joined
Nov 27, 2013
Messages
1
Hi,

We use 8gb of ram for our directadmin server at the moment.
My question is whether upgrading from 8gb to 24gb ram will help the load average of the server stay lower?
The hosting company can provide us the upgrade to our dedicated server very cheap so i said why not.

Also someone who can read the data in process monitor can explain, how these memory numbers should look like in order to know if i need more ram or not?

This is from very low peak hours:

top - 00:39:28 up 7 days, 12:08, 0 users, load average: 0.20, 0.19, 0.25
Tasks: 189 total, 2 running, 187 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.3%us, 0.7%sy, 2.5%ni, 94.8%id, 1.6%wa, 0.0%hi, 0.1%si, 0.0%st
Mem: 8147564k total, 7951628k used, 195936k free, 1426732k buffers
Swap: 4200888k total, 2656k used, 4198232k free, 3325972k cached

Thanks
 
Because your example is from low peak hours it's hard to tell anything. However the key is to look at the Swap line during high peak usage.
Code:
Swap: 4200888k total, 2656k used, 4198232k free, 3325972k cache
The key is the used value. If the used value is low even when the first load average setting is high, then you probably have enough memory. If the used swap value gets high and stays high for a while, then more memory would probably help.

But this is very simplistic thinking, and of course there could be other issues involved.

Jeff
 
As Jeff said, you should observe your *used* SWAP. It's a slow extension of your physical RAM on your hard disk and it's used when the RAM gets full.

The TOP output is not ideal for RAM usage analysis, there are better ways, such as:

Code:
$ free
or
$ cat /proc/meminfo

If you don't know how to interpret the output of these commands, here's a trick to simply show the FREE percentage:

Code:
$ free | awk '/buffers\/cache/{print $4/($3+$4) * 100.0;}'

Or if you prefer to see the USED percentage:

Code:
$ free | awk '/buffers\/cache/{print $3/($3+$4) * 100.0;}'
 
I forgot to mention, if your service provider can add more RAM for a very cheap price, do the deal - Linux usually tries to use all of your available RAM memory for cache and buffer, increasing the system performance.
 
To which I'd add, buy more RAM even if it's not cheap ;). Extra RAM is the single most important resources you can add to a server to increase it's efficiency and speed. We're busy now updating our servers, and when we're done all our shared hosting and dedicated servers will have a minimum of 24GB of RAM, and all our Performance Line of VPS servers will have a minimum of 4GB of RAM.

RAM is always a good investment.

Jeff
 
Back
Top