OpenVZ Forum


Home » General » Support » why buffers cached is always 0 in VPS/VE?
why buffers cached is always 0 in VPS/VE? [message #32906] Mon, 08 September 2008 17:07 Go to next message
tukey is currently offline  tukey
Messages: 10
Registered: March 2008
Location: China
Junior Member
From: 221.196.40*
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 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 515
Registered: January 2006
Location: Moscow, Russia
Senior Member
From: 77.51.174*
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 you 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 Go to previous messageGo to next message
tukey is currently offline  tukey
Messages: 10
Registered: March 2008
Location: China
Junior Member
From: 218.69.11*
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 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 515
Registered: January 2006
Location: Moscow, Russia
Senior Member
From: *sw.ru
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 you 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 Go to previous messageGo to next message
tukey is currently offline  tukey
Messages: 10
Registered: March 2008
Location: China
Junior Member
From: 218.69.11*
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 #32924 is a reply to message #32922] Tue, 09 September 2008 07:11 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 515
Registered: January 2006
Location: Moscow, Russia
Senior Member
From: *sw.ru
which failcounters there were?

If you 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 #32925 is a reply to message #32924] Tue, 09 September 2008 07:26 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 515
Registered: January 2006
Location: Moscow, Russia
Senior Member
From: *sw.ru
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 you 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 #32929 is a reply to message #32924] Tue, 09 September 2008 07:58 Go to previous messageGo to next message
tukey is currently offline  tukey
Messages: 10
Registered: March 2008
Location: China
Junior Member
From: 218.69.11*
it was privvmpages.
Re: why buffers cached is always 0 in VPS/VE? [message #32930 is a reply to message #32925] Tue, 09 September 2008 08:04 Go to previous messageGo to next message
tukey is currently offline  tukey
Messages: 10
Registered: March 2008
Location: China
Junior Member
From: 218.69.11*
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 Go to previous message
khorenko is currently offline  khorenko
Messages: 515
Registered: January 2006
Location: Moscow, Russia
Senior Member
From: *sw.ru
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 you 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

Previous Topic: [solved] Dynamic Resource Allocation Not Working
Next Topic: [solved] Help Me Understand Please (About Setting Resource Per VE)
Goto Forum:
  


Current Time: Fri Dec 13 21:47:09 GMT 2019