| Solaris |
|
|
The memory sets feature is current under development within Sun. It extends the pools framework, adding the "mset" resource set type.
Memory sets will enable administrators to partition physical memory into reservations for various entities such as projects and zones. Eventually memory sets will also include partitioning system swap. This topic illustrates the current interface design for the feature.
In this example, assume a system with:
The goal is to divide the system resources up evenly among 4 zones. This example makes use of various resource management features to partition the system, including memory sets.
The mset functionality in this example is actively under development and not integrated into OpenSolaris. This example serves to illustrate the current interface design. The actual procedure in this example may differ when the feature integrates.
The procedure is broken up into these steps:
For the purpose if this example, assume four zones have been configured and installed. The zones are named "zone1" - "zone3", and the "global" zone is
used. Here is a good simple example by Brendan Gregg for setting up a zone.
Each zone will have its own resource pool. The global zone will use pool_default, which always exists when pools are enabled. For the other zones, "pool1" - "pool3" will be created.
# svcadm enable pools
# pooladm -s
# for N in 1 2 3 ; do
> poolcfg -c "create pool pool$N"
> done
# pooladm -c
# for N in 1 2 3 ; do
> zonecfg -z zone$N set pool=pool$N
> done
Create a processor set and memory set for each pool. Each pool will receive
1 cpu, 512 Mb of RAM, and 1Gb of swap:
# for N in 1 2 3 ; do
> poolcfg -f - <<EOF
> create pset pset$N (uint pset.min = 1 ; uint pset.max = 1)
> create mset mset$N (uint mset.min = 512M ; uint mset.max = 512M)
> modify mset mset$N (uint mset.minswap = 1GB; uint mset.maxswap = 1GB)
> associate pool pool$N (pset pset$N ; mset mset$N)
> EOF
# pooladm -c
These resource controls will limit the number of threads and processes that can be created by each zone. Since threads and processes consume kernel memory, it is important to limit them to protect against fork/thread/zombie bombs. Depending on the intended workloads for these zones, set these accordingly.
For examples on setting zone resource controls, see Zones and Resource Management.
# for N in 1 2 3 ; do
> zoneadm -z zone$N boot
> done
Pool bindings and resource controls are set when a zone boots. poolbind(1m)
and prctl(1) can be used to set these on an already booted zone. See Zones and Resource Management.
These resource controls are useful when multiple projects or zones are sharing
the same processor set, and scheduling fairness or absolute limits on cpu cycle
consumption is desired. In this example, each zone has its own dedicated pset,
to these controls are not needed.
This resource control is not used because a memory set implicitly limits locked memory. If multiple zones are configured to share the same memory set, then zone.max-locked-memory will prevent a zone from locking all the memory in the set.
Potential areas in which solaris could be enhanced to partition system resources:
Terms of Use
|
Privacy
|
Trademarks
|
Copyright Policy
|
Site Guidelines
|
Site Map
|
Help
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.
© 2012, Oracle Corporation and/or its affiliates.