
|
View Full Version : memory shared issue - please comment
as a newbie, i am not quite sure whether memory shared is important, but from almost all the posts regarding memory, there are memory shared usage, but my server isn't using any memory shared. is this normal/ok?
according to top :
133 processes: 132 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 1.7% user, 0.9% system, 0.0% nice, 97.2% idle
Mem: 497240K av, 332204K used, 165036K free, 0K shrd, 7400K buff
Swap: 530104K av, 0K used, 530104K free 231752K cached
according to cat /proc/meminfo :
total: used: free: shared: buffers: cached:
Mem: 509173760 347185152 161988608 0 7581696 237514752
Swap: 542826496 0 542826496
MemTotal: 497240 kB
MemFree: 158192 kB
MemShared: 0 kB
Buffers: 7404 kB
Cached: 231948 kB
Active: 134080 kB
Inact_dirty: 105272 kB
Inact_clean: 0 kB
Inact_target: 5244 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 497240 kB
LowFree: 158192 kB
SwapTotal: 530104 kB
SwapFree: 530104 kB
or is the memory shared disable? how can i enable it? help please
zupanm 01-15-2002, 05:31 PM that is normal and ok
thanks a lot for your reply.
however, i have some further memory issue. my memory is being used up quite fast, its like the memory usage is being accumulated, as at the end of the day, even not during peak hours, the memory usage would be like +85% from top compare to peak hours of 40-50% and i need reboot my server every 24 hours ... even though the "free" command shows that free memory is around 70-80%, the swap memory is being used.
FYI, i am with rackshack amd 1ghz and 512ram server. i use php/cgi/mysql(mysql <10 processes) ... the memory usage for my previous server (raq3/512ram) is around 30-40% during peak hours.
and the strange thing is that the server load is averaging below 5% even during peak hours. do all these have anything to do wit hthe "memory shared"? ... by the way, how do we use/enable memory shared?
priyadi 01-16-2002, 02:40 AM Actually, Linux uses memory rather aggresively, it is even a normal thing for memory usage to reach close to 100%. So I wouldn't worry too much about it. I don't know about the raq3 case, maybe it uses different method of using memory.
MattF 01-16-2002, 07:41 AM Perfectly normal. Linux makes use of memory :) You only need to start worrying when you start using Swap memory.
Our memory usuage is always alround 500mb, we have 512mb RAM. If we put in another 512mb RAM, Linux will probably use a 1 gig of memory even though we haven't change any of the settings, or programs utilization on the server.
thanks a lot guys/gals for all the replies ... i am finally relief now and i think i will be able to sleep better tonight :)
by the way, may i know how to enable "memory shared" or linux will automatically use it when needed?
well, i let my server runs for around 48 hours without rebooting ... but during peak hours, the stats was very scary ... this is the stats that i just got from "top" :
146 processes: 142 sleeping, 2 running, 2 zombie, 0 stopped
CPU states: 3.7% user, 2.5% system, 0.0% nice, 93.7% idle
Mem: 497240K av, 491520K used, 5720K free, 0K shrd, 5768K buff
Swap: 530104K av, 2176K used, 527928K free 371700K cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
17710 root 18 0 1156 1156 836 R 0.9 0.2 0:00 top
17839 apache 16 0 6696 6360 5420 S 0.9 1.2 0:00 httpd
16128 apache 12 0 6844 6512 5420 S 0.5 1.3 0:00 httpd
1043 root 11 0 284 252 212 S 0.3 0.0 0:51 portsentry
17448 apache 11 0 6808 6476 5396 S 0.3 1.3 0:00 httpd
790 mysql 10 0 5436 5436 2232 S 0.1 1.0 0:34 mysqld
15893 apache 10 0 6828 6496 5420 S 0.1 1.3 0:00 httpd
16058 apache 10 0 6848 6516 5420 S 0.1 1.3 0:00 httpd
16144 apache 9 0 6788 6456 5392 S 0.1 1.2 0:00 httpd
16146 apache 10 0 6768 6436 5396 S 0.1 1.2 0:00 httpd
16257 apache 10 0 6888 6556 5412 S 0.1 1.3 0:00 httpd
16420 root 9 0 1796 1792 1488 S 0.1 0.3 0:00 sshd
17209 apache 10 0 6788 6456 5424 S 0.1 1.2 0:00 httpd
17695 apache 10 0 6748 6416 5404 S 0.1 1.2 0:00 httpd
17840 apache 12 0 6128 5788 5576 S 0.1 1.1 0:00 httpd
17843 apache 14 0 6036 5696 5556 S 0.1 1.1 0:00 httpd
and the stat from "free" is even scary just few seconds after i copy the top stats:
total used free shared buffers cached
Mem: 497240 493928 3312 0 5768 371812
-/+ buffers/cache: 116348 380892
Swap: 530104 2176 527928
only 3312 free! its like 99+% of the memory is being used and a small portion of swap has been used. however, with buffers and cache 75+% are free. although i have monitor the free memory and it doesn't go to zero, but should i be worring about the memory usage? or will the memory reduce to zero and hang my server when the processes increase?
|