GIDForums  

Go Back   GIDForums > Web Hosting Forums > Web Hosting Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rating: Thread Rating: 4 votes, 5.00 average.
  #1  
Old 11-Apr-2006, 08:28
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Linux Server Memory Questions


Some of you know that I recently leased a new web server for the sites. This new server is supposed to be set up with 1 GB worth of RAM. I have 2 questions about this (questions in bold).

When I type cat /proc/meminfo, this is what I see...

Code:
[jds@bella ~]$ cat /proc/meminfo MemTotal: 970780 kB MemFree: 778168 kB Buffers: 1592 kB Cached: 19772 kB SwapCached: 20424 kB Active: 168436 kB Inactive: 5492 kB HighTotal: 65472 kB HighFree: 1080 kB LowTotal: 905308 kB LowFree: 777088 kB SwapTotal: 1020116 kB SwapFree: 938580 kB Dirty: 132 kB Writeback: 0 kB Mapped: 160452 kB Slab: 10088 kB Committed_AS: 710308 kB PageTables: 2364 kB VmallocTotal: 106488 kB VmallocUsed: 2128 kB VmallocChunk: 104004 kB HugePages_Total: 0 HugePages_Free: 0 Hugepagesize: 4096 kB

My first question: Is 1 GB equal to 970780 kB?

When I type top -- on the memory line, I see something like this:

Code:
Mem: 970780k total, 202352k used, 768428k free, 1756k buffers

From all my previous experiences using this command, I have never seen so much free memory. From what I have heard and read about Linux and how it uses memory, I think this is quite odd. The 768428k free bit is what concerns me...

Why is there so much free memory?

This is on a CentOS 4.3 Linux web server.

<mod edit>The Solution.</mod edit>
Last edited by admin : 28-May-2006 at 12:04. Reason: Inserted link to final solution
  #2  
Old 11-Apr-2006, 09:01
nniehoff nniehoff is offline
Awaiting Email Confirmation
 
Join Date: Aug 2001
Location: US
Posts: 115
nniehoff has a spectacular aura about

Re: Linux Server Memory Questions


As to your first question, that is really close to one GB. However Most of the machines I have with 1Gb all have > 1000000kB.

Secondly it seems really strange to have that much free memory. I don't use CentOS, I use Debian so there is a difference there and perhaps your webserver is running 0 extra processes. But that seems really unlikely. Here are a couple of my systems:

My laptop (only I use this):
Code:
MemTotal: 1035256 kB MemFree: 435740 kB Buffers: 55388 kB Cached: 265164 kB SwapCached: 0 kB Active: 375136 kB Inactive: 173852 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 1035256 kB LowFree: 435740 kB SwapTotal: 1020088 kB SwapFree: 1020088 kB Dirty: 48 kB Writeback: 0 kB Mapped: 321620 kB Slab: 37576 kB CommitLimit: 1537716 kB Committed_AS: 813316 kB PageTables: 2324 kB VmallocTotal: 245752 kB VmallocUsed: 5868 kB VmallocChunk: 239652 kB

A file server (not under heavy use at the moment since the office isn't open yet, however it is running some backups):
Code:
MemTotal: 2076368 kB MemFree: 7240 kB Buffers: 24156 kB Cached: 1884536 kB SwapCached: 0 kB Active: 59112 kB Inactive: 1886380 kB HighTotal: 1179584 kB HighFree: 1024 kB LowTotal: 896784 kB LowFree: 6216 kB SwapTotal: 2096472 kB SwapFree: 2095760 kB Dirty: 110052 kB Writeback: 0 kB Mapped: 57340 kB Slab: 111896 kB Committed_AS: 172036 kB PageTables: 896 kB VmallocTotal: 114680 kB VmallocUsed: 4104 kB VmallocChunk: 110196 kB

My office webserver (not a heavily used server either):
Code:
MemTotal: 256244 kB MemFree: 2328 kB Buffers: 53160 kB Cached: 105804 kB SwapCached: 0 kB Active: 114380 kB Inactive: 93704 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 256244 kB LowFree: 2328 kB SwapTotal: 499992 kB SwapFree: 499992 kB Dirty: 20 kB Writeback: 0 kB Mapped: 64516 kB Slab: 39812 kB Committed_AS: 168000 kB PageTables: 960 kB VmallocTotal: 711240 kB VmallocUsed: 22904 kB VmallocChunk: 687976 kB

My personal mail server (there are 3 users of this machine, incredibly low usage but a lot of mail volume and a lot of file server activity):
Code:
MemTotal: 1035544 kB MemFree: 90148 kB Buffers: 404916 kB Cached: 183784 kB SwapCached: 6008 kB Active: 238056 kB Inactive: 402496 kB HighTotal: 131008 kB HighFree: 23700 kB LowTotal: 904536 kB LowFree: 66448 kB SwapTotal: 522104 kB SwapFree: 485164 kB Dirty: 240 kB Writeback: 0 kB Mapped: 69148 kB Slab: 288204 kB CommitLimit: 1039876 kB Committed_AS: 382248 kB PageTables: 2472 kB VmallocTotal: 114680 kB VmallocUsed: 3052 kB VmallocChunk: 111344 kB HugePages_Total: 0 HugePages_Free: 0 Hugepagesize: 4096 kB

From one of my sites hosted at dreamhost.com (I would imagine extremely heavy usage):
Code:
MemTotal: 4075076 kB MemFree: 116720 kB MemShared: 0 kB Buffers: 80416 kB Cached: 2159652 kB SwapCached: 20696 kB Active: 582244 kB Inactive: 1678788 kB HighTotal: 3211200 kB HighFree: 5596 kB LowTotal: 863876 kB LowFree: 111124 kB SwapTotal: 6313512 kB SwapFree: 6238920 kB

From another site hosted at advancednetworkhosts.com
Code:
MemTotal: 2059896 kB MemFree: 75560 kB Buffers: 451352 kB Cached: 1102344 kB SwapCached: 0 kB Active: 1062596 kB Inactive: 794444 kB HighTotal: 1163200 kB HighFree: 2624 kB LowTotal: 896696 kB LowFree: 72936 kB SwapTotal: 4192956 kB SwapFree: 4192796 kB Dirty: 6248 kB Writeback: 0 kB Mapped: 341284 kB Slab: 103216 kB Committed_AS: 758300 kB PageTables: 12448 kB VmallocTotal: 106488 kB VmallocUsed: 5264 kB VmallocChunk: 100120 kB HugePages_Total: 0 HugePages_Free: 0 Hugepagesize: 4096 kB

All of these systems are Debian except the Mail server which is Fedora and the advanced networks one is RedHat Enterprise Edition. So I will let you decide for yourself if > 700 Mb of mem free makes since but to me it sounds a little far fetched. If this continues to sound fishy to you I would recommend you try rkhunter (www.rootkit.nl) just incase you got hacked and don't know it. This could be something a rootkit would do.

Nick
  #3  
Old 11-Apr-2006, 09:20
dsmith's Avatar
dsmith dsmith is offline
Senior Member
 
Join Date: Jan 2004
Location: Utah, USA
Posts: 1,351
dsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of light

Re: Linux Server Memory Questions


A Gigabyte of Memory would actually be equal to 1,048,576 Kbytes I believe (1024x1024). So no, the 970 shown is not quite a gigabyte.

I don't think it is terribly uncommon for the total memory to show less than what is there. On my system with 512Mbytes (524,288 Kb) it shows as 514552 available.

I think there is just a bit of overhead with BIOS, etc that takes some of the available memory. Also, it is quite possible that your video card is using shared memory which would account for the decrease.

I agree with nniehoff about the memory free. In my experience, Linux does not leave free memory lying around. I have a fairly lowly taxed system that currenlty has 9004 Kb of 644576 available. Linux memory management seems to leave memory occupied until it needs it. This is not centOS either. Perhaps centOS is using a different memory management algorithm? I will look into this and see if I can find out anything.

I wouldn't worry too much about this unless it is causing you problems. I am more curious about the centOS memory manager. Does anyone have any experience with centOS?
  #4  
Old 11-Apr-2006, 09:29
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Re: Linux Server Memory Questions


Thank you for your feedback guys. I appreciate it.

My previous server was a CentOS 4.3 too. And it also had VERY little free memory "lying around"

On the VPS before that, with 4GB RAM (I think), the server also reported nearly all the memory was in "use".

I always knew that this is how Linux managed it's memory, grabbing (nearly) everything it can detect -- so seeing over 700MB of free memory on this new server was quite a shock to me.

My web host is convinced this is normal
  #5  
Old 11-Apr-2006, 09:48
dsmith's Avatar
dsmith dsmith is offline
Senior Member
 
Join Date: Jan 2004
Location: Utah, USA
Posts: 1,351
dsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of light

Re: Linux Server Memory Questions


In looking a bit closer at the memory of both what you and Nick posted and comparing it with mine I noticed that your file caching is significantly smaller than anything Nick posted as well as my systems.

On most of my systems file caching takes about 50% of available memory.

There are two explanations that I can think of:
  • This is a fairly new "boot" and there have not been very many open files. Therefore there is nothing in the file cache.
  • The kernel may be configured to minimize file caching. Perhaps, in your usage it is better to have alot of free memory that utilize file caching.

This has been pretty interesting to look into actually. Keep us posted on what you find out J.

Cheers!
  #6  
Old 11-Apr-2006, 10:04
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Re: Linux Server Memory Questions


I will update this thread as soon as I figure it out myself. I will try asking for help on other web hosting forums as well, just to get more opinions and comments.
  1. DirectAdmin Forums
  2. WHT


Right now, I know the server is handicapped. It's running as though it has only 256Kb of physical memory. I know this because swap memory is being used and it grows over the course of the day while the (over) 700MB free memory is left untouched.
  #7  
Old 11-Apr-2006, 10:53
dsmith's Avatar
dsmith dsmith is offline
Senior Member
 
Join Date: Jan 2004
Location: Utah, USA
Posts: 1,351
dsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of light

Re: Linux Server Memory Questions


Quote:
Originally Posted by JdS
Right now, I know the server is handicapped. It's running as though it has only 256Kb of physical memory. I know this because swap memory is being used and it grows over the course of the day while the (over) 700MB free memory is left untouched.

ahhh... I didn't realize that! Yes this would be a big concern to me as well.

I will let you know if I can find anything else...
  #8  
Old 19-Apr-2006, 14:05
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,109
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough

Re: Linux Server Memory Questions


I had some time and did some detective work. Now, I would like to say I understand very little of what I found in a concrete way. Conceptually I think I understand the problem enough to offer some insight though. After my searches, I think I may not understand it very well though. Perhaps though, someone reading this will find the information useful and share some solutions rather than some filtered information.

It seemed to me, you were running against a glass ceiling of sorts when it comes to your memory. I thought for some reason your CentOS does not believe that there could possibly be more memory. (remember that bit above about me not knowing what the heck I'm talking about)

Now, that was the reason for my search terms. To that end, I found a couple of links that might help. Not exactly what I thought I might find, but they seem related to your problem.

CentOS Forum

So for some odd reason I ended up in the docs for 4.3 and got as far as the next link before realizing I was in danger of drowning from info overload for an OS I don't even have.
CentOS 4.3 docs

One of the respondants in the first link points to a weath of information that can only be described as a religous experience. I think I made it down a quarter of the page and blacked out. Here is that link.

Swappiness Debate

Anyhow, my assesment, recompile the kernal and keep your fingers crossed. It seems to be a common theme in my findings. I'd be curious to hear if you have made progress JdS.

HTH,
Mark

todays moral - assume you know nothing especially when you think you know the answer
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Selling Server darkneal128 Managed / Dedicated Servers 4 28-Mar-2006 18:01
Making a home linux server crystalattice Computer Software Forum - Linux 6 16-Jan-2006 16:08
Memory de-allocation during debugging gaoanyu C Programming Language 12 19-Dec-2005 05:50
Pointer Usage in C++: Beginner to Advanced varunhome C++ Forum 0 19-Aug-2005 10:25
[Tutorial] Pointers in C (Part I) Stack Overflow C Programming Language 1 08-Apr-2005 19:35

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 02:22.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.