Sponsored Content
Operating Systems Solaris How to find memory size on solaris zone Post 302278886 by incredible on Wednesday 21st of January 2009 11:14:11 AM
Old 01-21-2009
The amount of physical memory that a Zone uses cannot be constrained as it stands now, but Sun is working on a feature that will address this issue soon
however you can configure capped mem it like this:

zonecfg:my-zone> add capped-memory
zonecfg:zone:capped-memory> set physical=50m
zonecfg:zone:capped-memory> set swap=100m
zonecfg:zone:capped-memory> set locked=30m
zonecfg:zone:capped-memory> end

To change the max-swap resource do the following:

# prctl -n zone.max-swap -r -v 200M `pgrep -z <zone> init`To change the max-locked-memory resource do the following:

# prctl -n zone.max-locked-memory -r -v 100M `pgrep -z <zone> init`Changing the physical memory capping is a little different, you'll need to use the rcapadm command:

# rcapadm -z <zone> -m 100M

Later you can verify using
# zonecfg -z <zone>
 

9 More Discussions You Might Find Interesting

1. Solaris

How to find Total and Free Physical Memory and Logical Memory in SOLARIS 9

Hi, Im working on Solaris 9 on SPARC-32 bit running on an Ultra-80, and I have to find out the following:- 1. Total Physical Memory in the system(total RAM). 2. Available Physical Memory(i.e. RAM Usage) 3. Total (Logical) Memory in the system 4. Available (Logical) Memory. I know... (4 Replies)
Discussion started by: 0ktalmagik
4 Replies

2. Solaris

Memory usuage per zone in solaris

Hello all, How can i find the memory usuage per zone in solaris. (5 Replies)
Discussion started by: sophos
5 Replies

3. HP-UX

how to find size of memory allocated to a pointer?

Hi, Am new to HP UX , is there a way to find out the size of memory allocated to a pointer on hp ux? For example we can use the _msize() on windows to find the size of memory allocated to a pointer . #include <stdio.h> #include <malloc.h> void main() { void *buffer; ... (0 Replies)
Discussion started by: Wkdunreal
0 Replies

4. Solaris

restrcit physical memory with zone.max-locked-memory

Is it possible to restrict physical memory in solaris zone with zone.max-locked-memory just like we can do with rcapd ? I do not want to used rcapd (1 Reply)
Discussion started by: fugitive
1 Replies

5. Solaris

Memory usage, free and used, using sar, top and vmstat in Solaris zone/container

Hi all, I have a server running an Oracle database that is part of a Solaris M5000 container. Presumably this is referred to as a zone within a cluster, not sure if I get the terminology right. Anyway, a third-party manages the zone and unfortunately is not "helpful/friendly" to assist me on... (1 Reply)
Discussion started by: newbie_01
1 Replies

6. UNIX for Advanced & Expert Users

Solaris 10: I forgot to detach a zone before zpool export. Uninstall zone?

Dear all, recently, I migrated a solaris zone from one host to another. The zone was inside of a zpool. The zpool cotains two volumes. I did the following: host1: $ zlogin zone1 shutdown -y -g0 -i0 #Zone status changes from running to installed $ zpool export zone1 host2: $ zpool... (2 Replies)
Discussion started by: custos
2 Replies

7. Solaris

Solaris 11 Global zone patching having Solaris 10 branded zone

I am planning to do solaris 11 global zone patching having solaris 10 branded zone. I have a doubts on step 8 specially Can someone clear my step 8 doubts or if anything wrong between step 1 to step 9 please correct that also as I have pretty good idea about Step 10 mean patching in solaris 10... (2 Replies)
Discussion started by: amity
2 Replies

8. Solaris

Increase /tmp file system size dynamically in Solaris zone

Hi Please let me know how to increase the size of /tmp file system from 512m to 1024m dynamically without reboot in solaris zone # df -h Filesystem size used avail capacity Mounted on zones/zone1 11G 1.0G 10.0G 10% / /dev 11G 1.0G ... (6 Replies)
Discussion started by: sb200
6 Replies

9. Solaris

How to change pset.size value in processor set in Solaris zone?

Hi I have a pool name yuk-pool and its associated pset is yuk-pset. It has a min value is 20 and max value is 56. But size field has 48 value . This same pool is assign to 4 local zones. Whenever Cpu usage is high on one local zone it impact the cpu usage at other local zone as well during high... (1 Reply)
Discussion started by: sb200
1 Replies
prctl(1)							   User Commands							  prctl(1)

NAME
prctl - get or set the resource controls of running processes, tasks, and projects SYNOPSIS
prctl [-P] [-t [basic | privileged | system]] [-n name [-srx] [-v value] [-e | -d action] [-p pid]] [-i idtype] id... DESCRIPTION
The prctl utility allows the examination and modification of the resource controls associated with an active process, task, or project on the system. It allows access to the basic and privileged limits on the specified entity. See resource_controls(5) for a description of the resource controls supported in the current release of the Solaris operating system. OPTIONS
If none of the -s, -r, -x, -v, -d, or -e options are specified, the invocation is considered a get operation. Otherwise, it is considered a modify operation. The following options are supported: -d | -e action Disables (-d) or enables (-e) the specified action on the resource control value specified by -v, -t, and -p. If any of the -v, -t, or -p options are unspecified, they match any value, privilege, or recipient pid. For example, specifying only -v modifies the first resource control with matching value, matching any privilege and recipient pid. If no matching resource control value is found, a new value is added as if -s were specified. Actions: all This action is only available with -d. It disables all actions. This fails on resource control values that have the deny global flag. deny Indicates that the resource control attempts to deny granting the resource to the process, task, project, or zone on a request for resources in excess of the resource control value. deny actions can not be enabled if the resource control has the no-deny global flag. deny actions can not be disabled if the resource control has the deny global flag. signal This action is only available with -d. It deactivates the signal action. signal=signum In the signal=signum action, signum is a signal number (or string representation of a signal). Setting a signal action on a resource control with the no-local-action global flag fails. A limited set of signals can be sent. See NOTES for additional details. -i idtype Specifies the type of the id operands. Valid idtypes are process, task, project, or zone. Also allowed are pid, taskid, projid, and zoneid. The default id type, if the -i option is omitted, is process. For a modify operation, the entity to which id operands are members is the target entity. For instance, setting a project resource con- trol on an -i process sets the resource control on the project to which each given process argument is a member. For a get operation, the resource controls are listed for all entities to which the id operands are members. For example, -i task taskid lists the task, project, and zone resource controls for the task, and for the project and zone to which that task is a member. -n name Specifies the name of the resource control to get or set. If the name is unspecified, all resource controls are retrieved. -p pid When manipulating (using -s, -r, -x, -d, or -e) a basic task project, or zone resource control values, a recipient pid can be specified using -p. When setting a new basic resource control or controls on a task, project, or zone, the -p option is required if the -i idtype option argument is not process. -P Display resource control values in space delimited format. -r Replaces the first resource control value (matching with the -t privilege) with the new value specified through the -v option. -s Set a new resource control value. This option requires the -v option. If you do not specify the -t option, basic privilege is used. If you want to set a basic task, process, or zone rctl, -p is required. If -e or -d are also specified, the action on the new rctl is set as well. For compatibility with prior releases, this option is implied if -v is specified, without any of -e, -d, -r, or -x. See resource_controls(5) for a description of unit modifiers and scaling factors you can use to express large values when setting a resource control value. -t [ basic | privileged | system ] Specifies which resource control type to set. Unless the "lowerable" flag is set for a resource control, only invocations by users (or setuid programs) who have privileges equivalent to those of root can modify privileged resource controls. See rctlblk_set_value(3C) for a description of the RCTL_GLOBAL_LOWERABLE flag. If the type is not specified, basic is assumed. For a get operation, the values of all resource control types, including system, are displayed if no type is specified. -v value Specifies the value for the resource control for a set operation. If no value is specified, then the modification (deletion, action enabling or disabling) is carried out on the lowest-valued resource control with the given type. See resource_controls(5) for a description of unit modifiers and scaling factors you can use to express large values when setting a resource control value. -x Deletes the specified resource control value. If the delete option is not provided, the default operation of prctl is to modify a resource control value of matching value and privilege, or insert a new value with the given privilege. The matching criteria are dis- cussed more fully in setrctl(2). If none of the -d, -e, -v, or -x options is specified, the invocation is considered a get operation. OPERANDS
The following operand is supported: id The ID of the entity (process, task, project, or zone) to interrogate. If the invoking user's credentials are unprivileged and the entity being interrogated possesses different credentials, the operation fails. If no id is specified, an error message is returned. EXAMPLES
Example 1 Displaying Current Resource Control Settings The following example displays current resource control settings for a task to which the current shell belongs: example$ ps -o taskid -p $$ TASKID 8 example$ prctl -i task 8 136150: /bin/ksh NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT task.max-cpu-time system 18.4Es inf none - task.max-lwps system 2.15G max deny - project.max-contracts privileged 10.0K - deny - project.max-locked-memory privileged 508MB - deny - project.max-port-ids privileged 8.19K - deny - project.max-shm-memory privileged 508MB - deny - project.max-shm-ids privileged 128 - deny - project.max-msg-ids privileged 128 - deny - project.max-sem-ids privileged 128 - deny - project.max-crypto-memory privileged 508MB - deny - project.max-tasks system 2.15G max deny - project.max-lwps system 2.15G max deny - project.cpu-shares privileged 1 - none - zone.max-shm-memory system 16.0EB max deny - zone.max-shm-ids system 16.8M max deny - zone.max-sem-ids system 16.8M max deny - zone.max-msg-ids system 16.8M max deny - zone.max-lwps system 2.15G max deny - zone.cpu-shares privileged 1 - none - zone.max-locked-memory privileged 508MB - deny - Example 2 Displaying, Replacing, and Verifying the Value of a Specific Control The following examples displays, replaces, and verifies the value of a specific control on an existing project: example# prctl -n project.cpu-shares -i project group.staff project: 10: group.staff NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT project.cpu-shares privileged 1 - none - system 65.5K max none - example# prctl -n project.cpu-shares -v 10 -r -i project group.staff example# prctl -n project.cpu-shares -i project group.staff project: 10: group.staff NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT project.cpu-shares privileged 10 - none - system 65.5K max none - Example 3 Adjusting Resources The following example uses the project.max-locked-memory resource. First, use id -p to find out which project the current shell is a member of: /home/garfield> id -p uid=77880(garfield) gid=10(staff) projid=10(group.staff) Using the target project, identify the resource limit value before the change: /home/garfield> prctl -n project.max-locked-memory -i project group.staff project 10: group.staff project.max-locked-memory privileged 256MB - deny - system 16.0EB max deny - current limit is 256 Megabytes. Next, adjust the project.max-locked-memory limit to 300 Megabytes for the target project: # prctl -n project.max-locked-memory -v 300M -r -i project group.staff The resource limit value after the change shows a new value of 300 Megabytes: # prctl -n project.max-locked-memory -i project group.staff project 10:group.staff project.max-locked-memory privileged 300MB - deny - system 16.0EB max deny - Example 4 Modifying CPU Caps for a Project The prctl command can use the project.cpu-cap resource control (see resource_controls(5)) to set and modify CPU caps for a project. (The same resource control can be used in the /etc/project file. See project(4)) The following command modifies the CPU cap to limit user.smith to three CPUs: # prctl -r -t privileged -n project.cpu-cap -v 300 -i project user.smith The prctl -r option, used above, is used to dynamically change a CPU cap for a project or zone. For example, the following command will change the cap set in the preceding command to 80 percent: # prctl -r -t privileged -n project.cpu-cap -v 80 -i project user.smith To remove a CPU cap, enter: # prctl -x -n project.cpu-cap $$ Example 5 Modifying CPU Caps for a Zone The prctl command can use the zone.cpu-cap resource control (see resource_controls(5)) to set and modify CPU caps for a zone. (The same resource control can be manipulated using the zonecfg(1M) command.) The following command modifies the CPU cap to limit the global zone to 80 percent of a CPU: # prctl -t privileged -n zone.cpu-cap -v 80 -i zone global The cap can be lowered to 50% using: # prctl -r -t privileged -n zone.cpu-cap -v 50 -i zone global EXIT STATUS
The following exit values are returned: 0 Success. 1 Fatal error encountered. 2 Invalid command line options were specified. FILES
/proc/pid/* Process information and control files ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ |Interface Stability |See below. | +-----------------------------+-----------------------------+ The command-line syntax is Evolving. The human-readable output is Unstable. The parseable output is Evolving. SEE ALSO
rctladm(1M), zonecfg(1M), setrctl(2), rctlblk_get_local_action(3C), project(4), attributes(5), resource_controls(5) NOTES
The valid signals that can be set on a resource control block allowing local actions are SIGABRT, SIGXRES, SIGHUP, SIGSTOP, SIGTERM, and SIGKILL. Additionally, CPU time related controls can issue the SIGXCPU signal, and file size related controls can send the SIGXFSZ signal. SunOS 5.11 3 Dec 2007 prctl(1)
All times are GMT -4. The time now is 10:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy