How to work out if more RAM will likely improve the performance of a server?

spaceman

Well-Known Member
Mar 25, 2002
509
5
318
Hi All,

I'm considering adding more RAM to one of our servers. It's got 2Gb already. More RAM will reduce the need for swap memory (which is slow), so is it just a simple case of determining whether or not my server uses much swap - in which case adding more RAM will be a 'good thing', or is the analysis and decision process more complex than this?

P.S. I'm running Munin Service Monitor on the server - perhaps there are obvious historical stats I should be looking for there that would help me determine whether more RAM is a good thing?
 

ramprage

Well-Known Member
Jul 21, 2002
655
0
166
Canada
The # top command will show you how much swawp and ram is availabe and in use, this should be a good starting point to see how much usage you have.
 

nwilkens

Well-Known Member
May 4, 2006
59
0
156
Monroe MI
cPanel Access Level
DataCenter Provider
Memory

mnxsolutions:~ # free
total used free shared buffers cached
Mem: 4151836 3892284 259552 0 119564 3158728
-/+ buffers/cache: 613992 3537844
Swap: 2096472 8 2096464

Notice Almost all memory is used (as shown in the used column). No memory is swapped in the used column.

Linux attempts to use all memory for caches and buffering.

This particular machine has 4GB memory and most of that memory is used for cache. This machine has plenty of memory available.

Please paste the output of your free command, and I will analyze.

Also, if you have sysstat utilities installed analyze the output of 'sar -r' and 'sar -B'.

my sar -r output shows the following:

20:47:01 kbmemfree kbmemused %memused kbbuffers kbcached kbswpfree kbswpused %swpused kbswpcad
20:48:01 276664 3875172 93.34 119564 3158728 2096464 8 0.00 0
20:49:01 276624 3875212 93.34 119564 3158728 2096464 8 0.00 0
20:50:01 276288 3875548 93.35 119564 3158728 2096464 8 0.00 0
20:51:01 272112 3879724 93.45 119564 3158728 2096464 8 0.00 0
20:52:01 271912 3879924 93.45 119564 3158728 2096464 8 0.00 0
20:53:01 271936 3879900 93.45 119564 3158728 2096464 8 0.00 0

I am sure you can see how this information could help..

Nick
 

spaceman

Well-Known Member
Mar 25, 2002
509
5
318
[email protected] [~]# free
total used free shared buffers cached
Mem: 2056320 1925376 130944 0 88296 399360
-/+ buffers/cache: 1437720 618600
Swap: 2040212 291124 1749088

... but this is when the server is under very low load.

I think I've decided already to add some more RAM. Not very expensive, can't do any harm.