[CentOS] CentOS 3 vs. CentOS 4 Memory Utilization

Fri Feb 9 14:34:19 UTC 2007
Johnny Hughes <mailing-lists at hughesjr.com>

On Fri, 2007-02-09 at 09:20 -0500, hkclark at gmail.com wrote:
> On 2/9/07, Johnny Hughes <mailing-lists at hughesjr.com> wrote:
> > On Fri, 2007-02-09 at 06:51 -0500, chrism at imntv.com wrote:
> <snip>
> > >
> > > Call me crazy, but I don't understand the agonizing fork in the decision
> > > tree here.  RAM is ridiculously cheap.  Why not just upgrade to 1GB
> > > while you're doing the 3-->4 upgrade?  I suspect it isn't really needed,
> > > but it will add minimal cost to the operation (certainly much less than
> > > the cost of your time to accomplish the software update and test the new
> > > system).
> > >
> >
> > RAM is indeed very cheep ... and having 1gb should be easy, I agree with
> > chris.
> >
> > I also agree that as long as you have 200 mb free (as in your initial
> > post) that you should not have any problem shifting to CentOS-4.
> >
> > When you use free ... anything that is in buffers and cache should be
> > subtracted if you really want to know how much (REAL/HARD) memory is in
> > use.
> >
> > This is because the linux kernel fills up to the max all it's memory by
> > design. If you are not using it, it will cache stuff there.  The theory
> > is that if you need that cached data again, it will be available in
> > memory and that you can switch out the buffers / cache cheaply when you
> > really need the memory.
> >
> > So, in your initial post you had this:
> >
> >              total       used       free     shared    buffers     cached
> > Mem:        511428     497956      13472          0      29868     178280
> >
> > That means, I would call your hard memory used:
> >
> > 511428 - (29868+178280) = 303280
> >
> > So ... moving from CentOS-3 to CentOS-4 should not be a major issue on
> > that machine.
> >
> > (In your Centos-4 VM, subtract buffers/cache from used and see how that
> > looks)
> >
> > Some of our CentOS machines have 512mb (they are donated machines and we
> > can't MAKE them have more memory).  They work OK and serve between 1600
> > GB and 3200 GB per month via rsync and httpd, so certainly a web server
> > (if java is not involved :P) CAN work OK with 512mb RAM.  1 GB would be
> > MUCH better though.
> >
> > Thanks,
> > Johnny Hughes
> 
> Johnny & Chris,
> 
> Good point.  I should have been more clear about the "artificial
> constraint" on the memory (but I left it out since it's not my server
> and I'm not 100% sure of the background).   They have some sort of a
> multi-year hosting deal at favorable prices on the existing box, but
> if they make a RAM upgrade, the price goes way up (I'm not sure, but
> it might require an entirely new agreement).
> 
> Johnny,
> One question re the "hard memory used" math just be be sure I'm not
> reading the output of free wrong (since that's entirely possible).
> Wouldn't the hard memory calcs essentially be what free shows on the
> "-/+ buffers/cache:" line?  IOW, I'm thinking the "memory used by the
> apps" would be the used # on the first line (497,956) with the amount
> in buffers in cache removed because it's available for apps if
> necessary: 497,956 - (29,868 + 178,280) = 289,808 (with the difference
> being the 'free' RAM on the first line, 13,472).  Sorry if I'm being
> dense and not looking at it right.
> 

You are correct ... I should have used the 497,956 (or subtracted free
memory too).

And yes ... the used number in the second line is the correct value to
use for REAL used mem. It is:

Total - (Free + Buffers + Cache)

That is the number to compare ... I was trying (unsucessfully :P) to
show you where it came from :)

Thanks,
Johnny Hughes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.centos.org/pipermail/centos/attachments/20070209/01455a3b/attachment-0005.sig>