why buffers cached is always 0 in VPS/VE? [message #32906] |
Mon, 08 September 2008 17:07 |
tukey
Messages: 10 Registered: March 2008 Location: China
|
Junior Member |
|
|
hello, everyone
when I do a "free" in my VPS, the result is like below:
total used free shared buffers cached
Mem: 384 283 100 0 0 0
-/+ buffers/cache: 283 100
Swap: 0 0 0
I don't know why the "buffers" and "cached" is always 0.
I mean every time, no matter what I did, it is just always 0.
And is it possible to be set?
Could anybody please give me an answer?
[Updated on: Mon, 08 September 2008 17:09] Report message to a moderator
|
|
|
Re: why buffers cached is always 0 in VPS/VE? [message #32910 is a reply to message #32906] |
Mon, 08 September 2008 18:40 |
khorenko
Messages: 533 Registered: January 2006 Location: Moscow, Russia
|
Senior Member |
|
|
Hi!
'free' takes info from /proc/meminfo file generated by kernel.
Surely /proc/meminfo inside a Container provides some virtual information, some of values are not vistualized there, for example Buffers and Cached are always reported zero.
# vzctl exec 690 cat /proc/meminfo |egrep "^Cached|Buffers"
Buffers: 0 kB
Cached: 0 kB
But why do you ask? Just a curiosity or some software suffers from that?
Thanks,
Konstantin
If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
|
|
|
Re: why buffers cached is always 0 in VPS/VE? [message #32917 is a reply to message #32910] |
Tue, 09 September 2008 02:50 |
tukey
Messages: 10 Registered: March 2008 Location: China
|
Junior Member |
|
|
finist wrote on Mon, 08 September 2008 14:40 | Hi!
'free' takes info from /proc/meminfo file generated by kernel.
Surely /proc/meminfo inside a Container provides some virtual information, some of values are not vistualized there, for example Buffers and Cached are always reported zero.
# vzctl exec 690 cat /proc/meminfo |egrep "^Cached|Buffers"
Buffers: 0 kB
Cached: 0 kB
But why do you ask? Just a curiosity or some software suffers from that?
Thanks,
Konstantin
|
---------------------------------------
Hi, Konstantin
Thank you for your reply. I understand what you meant about /proc/meminfo.
I do suffer from memory insufficiency.
When I run tomcat and mysql, there is always an memory insufficiency error in my VE, which has 384MB total memory.
But when I do the same thing in another HardNode (it has no VEs),
which has the same memory (no swap), there is no error occurs.
I compared my VE and the HardNode via "free", the only difference is "buffers" and "cached".
you see, if "buffers" and "cached" is unavailable, it actually needs more memory for running applications, right?
Is there any solution?
ps. My settings of my VE is :
KMEMSIZE="11055923:11377049"
LOCKEDPAGES="256:256"
PRIVVMPAGES="96768:96968"
SHMPAGES="21504:21504"
NUMPROC="240:240"
PHYSPAGES="0:2147483647"
VMGUARPAGES="65536:2147483647"
OOMGUARPAGES="65536:2147483647"
NUMTCPSOCK="360:360"
NUMFLOCK="188:206"
NUMPTY="16:16"
NUMSIGINFO="256:256"
TCPSNDBUF="1720320:2703360"
TCPRCVBUF="1720320:2703360"
OTHERSOCKBUF="1126080:2097152"
DGRAMRCVBUF="262144:262144"
NUMOTHERSOCK="360:360"
NUMFILE="9312:9312"
DCACHESIZE="3409920:3624960"
NUMIPTENT="128:128"
AVNUMPROC="180:180"
CPUUNITS="1000"
ONBOOT="yes"
ORIGIN_SAMPLE="vps.basic"
DISKSPACE="10485760:11530240"
DISKINODES="2000000:2200000"
QUOTATIME="0"
OSTEMPLATE="slackware-12.0-i386-minimal"
IP_ADDRESS="192.168.1.202"
|
|
|
Re: why buffers cached is always 0 in VPS/VE? [message #32920 is a reply to message #32917] |
Tue, 09 September 2008 06:29 |
khorenko
Messages: 533 Registered: January 2006 Location: Moscow, Russia
|
Senior Member |
|
|
Hi,
Quote: | you see, if "buffers" and "cached" is unavailable, it actually needs more memory for running applications, right?
|
This should not influence at all in fact.
Please, check /proc/user_beancounters - is there any failcounters after an attempt to start tomcat/mysql?
--
Konstantin
If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
|
|
|
Re: why buffers cached is always 0 in VPS/VE? [message #32922 is a reply to message #32920] |
Tue, 09 September 2008 06:38 |
tukey
Messages: 10 Registered: March 2008 Location: China
|
Junior Member |
|
|
finist wrote on Tue, 09 September 2008 02:29 | Hi,
Quote: | you see, if "buffers" and "cached" is unavailable, it actually needs more memory for running applications, right?
|
This should not influence at all in fact.
Please, check /proc/user_beancounters - is there any failcounters after an attempt to start tomcat/mysql?
--
Konstantin
|
Yes, there are failcounters. Starting tomcat is OK, it just happens when I try to shutdown tomcat.
384MB is not enough for tomcat and mysql in a VE, while it is enough in a physical machine(no swap)?
[Updated on: Tue, 09 September 2008 06:39] Report message to a moderator
|
|
|
|
Re: why buffers cached is always 0 in VPS/VE? [message #32925 is a reply to message #32924] |
Tue, 09 September 2008 07:26 |
khorenko
Messages: 533 Registered: January 2006 Location: Moscow, Russia
|
Senior Member |
|
|
Quote: | Yes, there are failcounters. Starting tomcat is OK, it just happens when I try to shutdown tomcat.
384MB is not enough for tomcat and mysql in a VE, while it is enough in a physical machine(no swap)?
|
Look, there is slightly different mechanisms in memory handling on Hardware Node and inside a Container.
if you have only 384Mb RAM on a Hardware Node and no swap - you'll be able to alloc 1Gb of memory in your problem. Without any problem. But if you later try to use that memory - read/write something from/to it, the process will be killed.
Inside a Container such a malloc of 1Gb will fail from the very beginning on an allocation stage - not actual using.
i think tomcat just allocs quite a lot of memory which does not really use - that's why it runs ok on a hardware node but fails inside a Container.
To gain the same functionality inside a Container you need to increase the privvmpages, but set the oomguarpages to 384Mb. In that case a program will be able to allocate a lot of RAM, but in case of global memory shortage on the node (if that process will try to use all allocated memory) - the process will be killed.
Hope that helps.
--
Konstantin
If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
|
|
|
|
Re: why buffers cached is always 0 in VPS/VE? [message #32930 is a reply to message #32925] |
Tue, 09 September 2008 08:04 |
tukey
Messages: 10 Registered: March 2008 Location: China
|
Junior Member |
|
|
finist wrote on Tue, 09 September 2008 03:26 |
Quote: | Yes, there are failcounters. Starting tomcat is OK, it just happens when I try to shutdown tomcat.
384MB is not enough for tomcat and mysql in a VE, while it is enough in a physical machine(no swap)?
|
Look, there is slightly different mechanisms in memory handling on Hardware Node and inside a Container.
if you have only 384Mb RAM on a Hardware Node and no swap - you'll be able to alloc 1Gb of memory in your problem. Without any problem. But if you later try to use that memory - read/write something from/to it, the process will be killed.
Inside a Container such a malloc of 1Gb will fail from the very beginning on an allocation stage - not actual using.
i think tomcat just allocs quite a lot of memory which does not really use - that's why it runs ok on a hardware node but fails inside a Container.
To gain the same functionality inside a Container you need to increase the privvmpages, but set the oomguarpages to 384Mb. In that case a program will be able to allocate a lot of RAM, but in case of global memory shortage on the node (if that process will try to use all allocated memory) - the process will be killed.
Hope that helps.
--
Konstantin
|
Thank you for your explaination. It makes me more clear.
Anyway, the buffers and cached will be just always kept as 0, because of the differenct memory allocation mechanisms between hardware node and VE. Am I right?
[Updated on: Tue, 09 September 2008 08:06] Report message to a moderator
|
|
|
Re: why buffers cached is always 0 in VPS/VE? [message #32931 is a reply to message #32930] |
Tue, 09 September 2008 08:21 |
khorenko
Messages: 533 Registered: January 2006 Location: Moscow, Russia
|
Senior Member |
|
|
Quote: | Anyway, the buffers and cached will be just always kept as 0, because of the differenct memory allocation mechanisms between hardware node and VE. Am I right?
|
They will always _reported_ as 0, as these fields are just not virtualized. Not because of different memory allocation mechanism, but due to these fields are simply not virtualized - surely a Container has some buffers and caches but they are not accounted and just always reported as 0.
If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
[Updated on: Tue, 09 September 2008 08:22] Report message to a moderator
|
|
|