difference between "top" and VM System Info

VM system info:

System hostname someothermother.net
Operating system CentOS Linux 5
Webmin version 1.370
Virtualmin version 3.47
Time on server Mon Oct 15 18:45:51 2007
CPU load averages 0.00 (1 min) 0.10 (5 mins) 0.48 (15 mins)
Running processes 135
Real memory [color=#FF0000]3.72 GB total, 434.98 MB used[/color]
Virtual memory 4 GB total, 0 bytes used

top:

top - 18:50:31 up 1 day, 14:54, 2 users, load average: 0.16, 0.09, 0.35
Tasks: 135 total, 1 running, 134 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: [color=#FF0000]3896228k total, 3256544k used,[/color] 639684k free, 248644k buffers
Swap: 4192956k total, 0k used, 4192956k free, 2631016k cached

My question is this: why is the mem usage reported by top so much higher than VM System Info? I have definitely raised the amount of memory for php and mysql cache, because this server will be running only 5 or 6 sites… but they have very active forums so the mysql performance is most important.

Anyway… why the difference in reported memory usage? Have I screwed something up?

Virtualmin gathers it’s memory usage data from /proc/meminfo and I’m pretty sure it treats buffer and cache the same as free (because it is equally “available” for allocation–nothing has to be swapped to disk to use it).

I think the exhorbitant cached memory usage before was due to some waste introduced by a php script I had run earlier in the day to rebuild the search tables on a forum… it had to run through 750,000+ posts and rebuild over 12,000,000 fields, so it had probably completely filled the mysql cache and this was still cached until I restarted Apache and MySQL.

That answers my question… I sortof assumed that re: cache, but wanted to make sure I was not just wasting memory.

I have huge cache set up in anticipation of when we move traffic to this server, because we are combining 2 heavily trafficked sites into one (inheriting a popular domain from a site that is winding down), and moving another popular related site onto this same server. The current sites are all on shared hosting servers, but they get very bogged down whenever there is a high load, due to the very conservative php and mysql settings on most shared hosting environments, coupled with the inherent domino effect of load problems on an oversubscribed shared server.

So, if I have ~512mb (of 4GB) of free memory (with no load & no users) after cache allocations, and with all necessary service running, hopefully that will be sufficient? Or maybe I have gone overboard with MySQL cache allocation? PHP eAcellerator is the next step, as all of the PHP applications are running very well & stable.

My Goal is to have the largest and/or best performing caches possible, within REASON, to make best use of the available 4GB memory to run 5-6 domains running Joomla and phpBB, with 700-5000 concurrent users among all the domains.

I appreciate your advice & I am liking the Virtualmin pay-to-play version! Smooth upgrade from GPL on CentOS… the tipping point was when I needed the IP-change feature which either was missing from GPL (or I could not locate it â

OK, with eAccelerator installed and Apache restarted, the memory usage is now more like I thought it would be…

top says:
Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: [color=#FF0000]3896228k total, 679136k used, 3217092k free[/color], 40880k buffers
Swap: 4192956k total, 0k used, 4192956k free, 469960k cached

VM Sys Info says:

System hostname whateveritis.net
Operating system CentOS Linux 5
Webmin version 1.370
Virtualmin version 3.47
Time on server Mon Oct 15 23:54:29 2007
CPU load averages 0.26 (1 min) 0.16 (5 mins) 0.10 (15 mins)
Running processes 136
Real memory [color=#FF0000]3.72 GB total, 269 MB used[/color]
Virtual memory 4 GB total, 0 bytes used