Information Technology Reference
In-Depth Information
a RAM cap will prevent some of these problems, virtual memory systems were
designed with the assumption that most of a workload's memory pages can be
paged out.
Under normal operations, a workload that needs 30 GB of RAM in a 32 GB sys-
tem may need to lock down only 2 GB. Allowing its processes to lock all 30 GB may
reduce the RAM available to other Containers to the point that they cannot func-
tion normally. To prevent a Container from allocating so much shared memory
that other workloads suffer, a resource cap for shared memory also exists. Enter
the following command to set a shared memory cap of 2 GB for the Container:
GZ# zonecfg -z web
zonecfg:web> set max-shm-memory=2g
zonecfg:web> exit
GZ# zoneadm -z web reboot
After the Container is rebooted, this value can be verified with the following
command:
GZ# prctl -n zone.max-shm-memory -t privileged -i zone web
zone: 6: web
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
zone.max-shm-memory privileged 2.0GB - deny -
Just as with the other examples, this resource constraint can be dynamically
changed for a running Container:
GZ# prctl -n zone.max-shm-memory -v 4g -t privileged -r -e deny \
-i zone web
In addition to shared memory, a program can lock down other memory pages.
Oracle Solaris provides this functionality for well-behaved applications so as to
improve their performance. Of course, this ability can be abused—just as shared
memory can be. To limit the amount of memory that a Container can lock down,
enter the following command:
GZ# zonecfg -z web
zonecfg:web> select capped-memory
zonecfg:web:capped-memory> set locked=2g
zonecfg:web:capped-memory> end
zonecfg:web> exit
GZ# zoneadm -z web reboot
 
Search WWH ::




Custom Search