Re: [zones-discuss] monitor number of lwp in zone
Hello Mike >> with sed,grep and awk possible: >> /usr/bin/prstat -LZ -n 1,10 1 1 | sed '1,3d' | grep -v Total >> 0 216 111M 139M 6.8% 0:09:05 0.1% global >> 20 100 40M 23M 1.1% 0:00:32 0.0% v0136 > Potential improvements on that are: > > $ ps -Leo zone | sort | uniq -c | sort -n >1 ZONE > 110 z1 > 319 global > > $ ps -Lz z1 -o pid= | wc -l > 109 > > The reason that these are improvements are: > > - We don't force ps to do any name lookups. If name lookups are > broken for some reason (e.g. ldap server failure), you want to > minimize the amount of monitoring that breaks. > - No use of imprecise grep patterns that could match process names or > substrings of other zones. > - If you have a lot of zones, prstat may not list the least active ones. thanks a lot evening saved, and learned something ;-) Cheers Christian ___ zones-discuss mailing list zones-discuss@opensolaris.org
Re: [zones-discuss] monitor number of lwp in zone
You can always improve it Sent from my iPhone On Apr 26, 2012, at 12:21 PM, Christian Meier wrote: > thank you for the link. > really nice tool, but the number of LWP's I can't get with it > > root@g0081:/tmp# ./zonestat.pl -l 2 >|Pool-|---CPU-|Memory| >|---|--Size---|Pset---|---RAM---|---Shm---|---Lkd---|---VM---| > Zonename| IT| Max| Cur|Used|Shr|S%| Cap|Used| Cap|Used| Cap|Used| Cap|Used > -- > global 0D 4 0.0 1 50 218M 18E 0.0 18E 4.8M 18E 131M > v0161 0D 4 1.0 1 50 20M 18E 0.0 18E 0.0 18E 8.7M > ==TOTAL= --- 4 1.0 --- -- 2.1G 456M 2.1G 0.0 2.1G 4.8M 1.4G 139M > > global 0D 4 0.0 1 50 218M 18E 0.0 18E 4.8M 18E 131M > v0161 0D 4 1.0 1 50 21M 18E 0.0 18E 0.0 18E 11M > ==TOTAL= --- 4 1.0 --- -- 2.1G 457M 2.1 0.0 2.1 4.8M 1.4G 141M > > >> >> try this link >> http://hub.opensolaris.org/bin/view/Project+zonestat/files?viewer=attachments&language=en > > ___ zones-discuss mailing list zones-discuss@opensolaris.org
Re: [zones-discuss] monitor number of lwp in zone
thank you for the link. really nice tool, but the number of LWP's I can't get with it root@g0081:/tmp# ./zonestat.pl -l 2 |Pool-|---CPU-|Memory| |---|--Size---|Pset---|---RAM---|---Shm---|---Lkd---|---VM---| Zonename| IT| Max| Cur|Used|Shr|S%| Cap|Used| Cap|Used| Cap|Used| Cap|Used -- global 0D 4 0.0 1 50 218M 18E 0.0 18E 4.8M 18E 131M v0161 0D 4 1.0 1 50 20M 18E 0.0 18E 0.0 18E 8.7M ==TOTAL= --- 4 1.0 --- -- 2.1G 456M 2.1G 0.0 2.1G 4.8M 1.4G 139M global 0D 4 0.0 1 50 218M 18E 0.0 18E 4.8M 18E 131M v0161 0D 4 1.0 1 50 21M 18E 0.0 18E 0.0 18E 11M ==TOTAL= --- 4 1.0 --- -- 2.1G 457M 2.1 0.0 2.1 4.8M 1.4G 141M > > try this link > http://hub.opensolaris.org/bin/view/Project+zonestat/files?viewer=attachments&language=en ___ zones-discuss mailing list zones-discuss@opensolaris.org
Re: [zones-discuss] monitor number of lwp in zone
On 04/26/12 10:33, Christian Meier wrote: Dear List, with the solaris resource control feature you are able to set the max number of LWP for a zone e.g bash-3.00# prctl -n zone.max-lwps -i zone v0136 zone: 20: v0136 NAMEPRIVILEGE VALUEFLAG ACTION RECIPIENT zone.max-lwps privileged120 - deny - system 2.15G max deny - with the rctladm you're able to generate warning if the limit was reached: Apr 26 16:34:52 g0057 genunix: privileged rctl zone.max-lwps (value 120) exceeded by process 15930 in zone v0136. is there a "simple" way to get the actual value of the zone(s)? actual known ways: prstat: /usr/bin/prstat -LZ with sed,grep and awk possible: /usr/bin/prstat -LZ -n 1,10 1 1 | sed '1,3d' | grep -v Total 0 216 111M 139M 6.8% 0:09:05 0.1% global 20 100 40M 23M 1.1% 0:00:32 0.0% v0136 Potential improvements on that are: $ ps -Leo zone | sort | uniq -c | sort -n 1 ZONE 110 z1 319 global $ ps -Lz z1 -o pid= | wc -l 109 The reason that these are improvements are: - We don't force ps to do any name lookups. If name lookups are broken for some reason (e.g. ldap server failure), you want to minimize the amount of monitoring that breaks. - No use of imprecise grep patterns that could match process names or substrings of other zones. - If you have a lot of zones, prstat may not list the least active ones. kstat: kstat -p unix:0:lwp_cache:buf_inuse unix:0:lwp_cache:buf_inuse 319 but I get only the sum of all lwp on the system, not for a special zone ps: ps -efZ -o zone,zoneid,lwp,args | grep global | wc -l 219 ps -efZ -o zone,zoneid,lwp,args | grep v0136 | wc -l 105 on Solaris 11 it is possible to get these values by zonestat e.g. $ zonestat -p -P zones -r processes,lwps 1 1 interval:processes:system-limit:global:66:0.22%:-:- interval:processes:system-limit:v0134:30:0.10%:-:- interval:lwps:system-limit:global:670:0.00%:-:- interval:lwps:system-limit:v0134:112:0.00%:-:- but for solaris 10? any hints are very welcome regards Christian ___ zones-discuss mailing list zones-discuss@opensolaris.org -- Mike Gerdts Solaris Core OS / Zones http://blogs.oracle.com/zoneszone/ ___ zones-discuss mailing list zones-discuss@opensolaris.org
Re: [zones-discuss] monitor number of lwp in zone
try this link http://hub.opensolaris.org/bin/view/Project+zonestat/files?viewer=attachments&language=en On 4/26/2012 11:33 AM, Christian Meier wrote: Dear List, with the solaris resource control feature you are able to set the max number of LWP for a zone e.g bash-3.00# prctl -n zone.max-lwps -i zone v0136 zone: 20: v0136 NAMEPRIVILEGE VALUEFLAG ACTION RECIPIENT zone.max-lwps privileged120 - deny - system 2.15G max deny - with the rctladm you're able to generate warning if the limit was reached: Apr 26 16:34:52 g0057 genunix: privileged rctl zone.max-lwps (value 120) exceeded by process 15930 in zone v0136. is there a "simple" way to get the actual value of the zone(s)? actual known ways: prstat: /usr/bin/prstat -LZ with sed,grep and awk possible: /usr/bin/prstat -LZ -n 1,10 1 1 | sed '1,3d' | grep -v Total 0 216 111M 139M 6.8% 0:09:05 0.1% global 20 100 40M 23M 1.1% 0:00:32 0.0% v0136 kstat: kstat -p unix:0:lwp_cache:buf_inuse unix:0:lwp_cache:buf_inuse 319 but I get only the sum of all lwp on the system, not for a special zone ps: ps -efZ -o zone,zoneid,lwp,args | grep global | wc -l 219 ps -efZ -o zone,zoneid,lwp,args | grep v0136 | wc -l 105 on Solaris 11 it is possible to get these values by zonestat e.g. $ zonestat -p -P zones -r processes,lwps 1 1 interval:processes:system-limit:global:66:0.22%:-:- interval:processes:system-limit:v0134:30:0.10%:-:- interval:lwps:system-limit:global:670:0.00%:-:- interval:lwps:system-limit:v0134:112:0.00%:-:- but for solaris 10? any hints are very welcome regards Christian ___ zones-discuss mailing list zones-discuss@opensolaris.org ___ zones-discuss mailing list zones-discuss@opensolaris.org
[zones-discuss] monitor number of lwp in zone
Dear List, with the solaris resource control feature you are able to set the max number of LWP for a zone e.g bash-3.00# prctl -n zone.max-lwps -i zone v0136 zone: 20: v0136 NAMEPRIVILEGE VALUEFLAG ACTION RECIPIENT zone.max-lwps privileged120 - deny - system 2.15G max deny - with the rctladm you're able to generate warning if the limit was reached: Apr 26 16:34:52 g0057 genunix: privileged rctl zone.max-lwps (value 120) exceeded by process 15930 in zone v0136. is there a "simple" way to get the actual value of the zone(s)? actual known ways: prstat: /usr/bin/prstat -LZ with sed,grep and awk possible: /usr/bin/prstat -LZ -n 1,10 1 1 | sed '1,3d' | grep -v Total 0 216 111M 139M 6.8% 0:09:05 0.1% global 20 100 40M 23M 1.1% 0:00:32 0.0% v0136 kstat: kstat -p unix:0:lwp_cache:buf_inuse unix:0:lwp_cache:buf_inuse 319 but I get only the sum of all lwp on the system, not for a special zone ps: ps -efZ -o zone,zoneid,lwp,args | grep global | wc -l 219 ps -efZ -o zone,zoneid,lwp,args | grep v0136 | wc -l 105 on Solaris 11 it is possible to get these values by zonestat e.g. $ zonestat -p -P zones -r processes,lwps 1 1 interval:processes:system-limit:global:66:0.22%:-:- interval:processes:system-limit:v0134:30:0.10%:-:- interval:lwps:system-limit:global:670:0.00%:-:- interval:lwps:system-limit:v0134:112:0.00%:-:- but for solaris 10? any hints are very welcome regards Christian ___ zones-discuss mailing list zones-discuss@opensolaris.org