Re: [zones-discuss] Difference between capped.memory and zone.max-shm-memory

2012-04-18 Thread Hung-Sheng Tsao (Lao Tsao 老曹) Ph.D.

capped.memory  is about the total memory
e.g

*Add a memory cap.*
zonecfg:my-zone  *add capped-memory*

 1. *Set the memory cap.*
zonecfg:my-zone:capped-memory  *set physical=50m*
 2. *Set the swap memory cap.*
zonecfg:my-zone:capped-memory  *set swap=100m*
 3. *Set the locked memory cap.*
zonecfg:my-zone:capped-memory  *set locked=30m*



and zone.max-shm-memory is about the sysV IPC  total shard memory 
shmsys:shminfo_shmmax* e.g. control oracle db on shared memory  usage


On 4/18/2012 8:52 AM, Jordi Espasa Clofent wrote:

Hi all,

I just want to know what's the difference between capped.memory and 
zone.max-shm-memory when it comes to limit the zones access to the 
available RAM memory in the global zone.


According to here 
http://docs.oracle.com/cd/E18752_01/html/817-1592/z.config.ov-3.html#gepte:



Solaris 10 8/07: Physical Memory Control and the capped-memory Resource
The capped-memory resource sets limits for physical, swap, and locked 
memory. Each limit is optional, but at least one must be set.


Determine values for this resource if you plan to cap memory for the 
zone by using rcapd from the global zone. The physical property of the 
capped-memory resource is used by rcapd as the max-rss value for the 
zone.


The swap property of the capped-memory resource is the preferred way 
to set the zone.max-swap resource control.


The locked property of the capped-memory resource is the preferred way 
to set the zone.max-locked-memory resource control.


So...

Are the both parameters doing the same (limiting the amount of 
available RAm for the zone) but just using different tools (rcapd for 
capped.memory and prctl for zone.max-shm-memory)?


What I really want to know is how to limit totally the memory in the 
zones. Let's say I have a global zone with 10GB and I want to create 2 
zones with ONLY 2GB at maximum, whatever they want or ask for.


Thanks in advance.




--
Hung-Sheng Tsao Ph D.
Founder  Principal
HopBit GridComputing LLC
cell: 9734950840

http://laotsao.blogspot.com/
http://laotsao.wordpress.com/
http://blogs.oracle.com/hstsao/

attachment: laotsao.vcf___
zones-discuss mailing list
zones-discuss@opensolaris.org

Re: [zones-discuss] Difference between capped.memory and zone.max-shm-memory

2012-04-18 Thread Jordi Espasa Clofent

Ok. So then I understand:

	- before Solaris 10 Update 7 (the one with SUNWrcapu, rcapd) there is 
no real way to limit the amount of RAM that a zone can borrow from the 
global one. Is that correct?


Thanks again.

--
I will face my fear. I will permit it to pass over me and through me.
And when it has gone past I will turn the inner eye to see its path.
Where the fear has gone there will be nothing. Only I will remain.
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] Difference between capped.memory and zone.max-shm-memory

2012-04-18 Thread Hung-Sheng Tsao (LaoTsao) Ph.D
rcapd is introduced on s10 8/07  s10u4


Sent from my iPad

On Apr 18, 2012, at 10:34, Jordi Espasa Clofent jespa...@minibofh.org wrote:

 Ok. So then I understand:
 
- before Solaris 10 Update 7 (the one with SUNWrcapu, rcapd) there is no 
 real way to limit the amount of RAM that a zone can borrow from the global 
 one. Is that correct?
 
 Thanks again.
 
 -- 
 I will face my fear. I will permit it to pass over me and through me.
 And when it has gone past I will turn the inner eye to see its path.
 Where the fear has gone there will be nothing. Only I will remain.
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] Difference between capped.memory and zone.max-shm-memory

2012-04-18 Thread Hung-Sheng Tsao (LaoTsao) Ph.D
hi
may be one could add
in solaris resource control used to be project based
one need to setup project and limit the resoure pool
then assign the poll to zone.
it is not easy to  use .

since then many  shortcut for resource pool control are added to zonecfg
make it very easy to add resource control  inside the zone

Sent from my iPad

On Apr 18, 2012, at 11:25, Hung-Sheng Tsao (LaoTsao) Ph.D laot...@gmail.com 
wrote:

 rcapd is introduced on s10 8/07  s10u4
 
 
 Sent from my iPad
 
 On Apr 18, 2012, at 10:34, Jordi Espasa Clofent jespa...@minibofh.org wrote:
 
 Ok. So then I understand:
 
   - before Solaris 10 Update 7 (the one with SUNWrcapu, rcapd) there is no 
 real way to limit the amount of RAM that a zone can borrow from the global 
 one. Is that correct?
 
 Thanks again.
 
 -- 
 I will face my fear. I will permit it to pass over me and through me.
 And when it has gone past I will turn the inner eye to see its path.
 Where the fear has gone there will be nothing. Only I will remain.
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] Difference between capped.memory and zone.max-shm-memory

2012-04-18 Thread Jordi Espasa Clofent

El 2012-04-18 19.22, Hung-Sheng Tsao (LaoTsao) Ph.D escribió:

hi
may be one could add
in solaris resource control used to be project based
one need to setup project and limit the resoure pool
then assign the poll to zone.
it is not easy to  use .

since then many  shortcut for resource pool control are added to zonecfg
make it very easy to add resource control  inside the zone


The cuestion sill, more or less, there: It is possible to limit the 
amout of RAM that a zone can borrow from the global zone without rcapd?
As far as I can understand, if a zone only uses zone.max-shm-memory 
instead, potencially can borrow all the available RAM. So?



--
I will face my fear. I will permit it to pass over me and through me. 
And when it has gone past I will turn the inner eye to see its path. 
Where the fear has gone there will be nothing. Only I will remain.

___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] Difference between capped.memory and zone.max-shm-memory

2012-04-18 Thread Steve Lawrence



On 04/18/12 02:42 PM, Jordi Espasa Clofent wrote:

El 2012-04-18 19.22, Hung-Sheng Tsao (LaoTsao) Ph.D escribió:

hi
may be one could add
in solaris resource control used to be project based
one need to setup project and limit the resoure pool
then assign the poll to zone.
it is not easy to  use .

since then many  shortcut for resource pool control are added to zonecfg
make it very easy to add resource control  inside the zone


The cuestion sill, more or less, there: It is possible to limit the 
amout of RAM that a zone can borrow from the global zone without rcapd?


Without rcapd, it is only possible to limit certain types of ram usage:
- zone.max-shm-memory: limits ram used by sysV mappings.
- zone.max-locked-memory: limits ram used by locked mappings 
(mlock, ISM, DISM).


Both of these do not limit ram used by other means, such as text pages, 
mapped files, and anonymous memory (like malloc()'ed memory)
As far as I can understand, if a zone only uses zone.max-shm-memory 
instead, potencially can borrow all the available RAM. So?


Correct.  In this case, only memory used by sysV mappings (shmget(2), 
shmat(2) is limited.


-Steve L.





___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] Difference between capped.memory and zone.max-shm-memory

2012-04-18 Thread Mike Gerdts
On 04/18/12 16:42, Jordi Espasa Clofent wrote:
 El 2012-04-18 19.22, Hung-Sheng Tsao (LaoTsao) Ph.D escribió:
 hi
 may be one could add
 in solaris resource control used to be project based
 one need to setup project and limit the resoure pool
 then assign the poll to zone.
 it is not easy to  use .

 since then many  shortcut for resource pool control are added to zonecfg
 make it very easy to add resource control  inside the zone
 
 The cuestion sill, more or less, there: It is possible to limit the amout of 
 RAM
 that a zone can borrow from the global zone without rcapd?
 As far as I can understand, if a zone only uses zone.max-shm-memory instead,
 potencially can borrow all the available RAM. So?

zone.max-swap can be used to limit the amount of memory that processes in a zone
can reserve.  Note that this has little to do with swap devices - the term swap
in this sense means virtual memory.

In order for a process to use RAM, those pages of RAM need to be backed by
something that can be paged.  Anonymous pages (those typically obtained via
malloc()) are charged against malloc.  The memory needed to hold executables and
libraries are backed by the disk where they reside.

-- 
Mike Gerdts
Solaris Core OS / Zones http://blogs.oracle.com/zoneszone/
___
zones-discuss mailing list
zones-discuss@opensolaris.org