Applies to:
Solaris SPARC Operating System - Version 8.0 and laterSolaris x64/x86 Operating System - Version 8 6/00 U1 and later
Oracle Solaris Express - Version 2010.11 and later
All Platforms
Goal
This document describes how to use mdb (version 1.1) to verify the values of kernel tunable parameters for Oracle Solaris 64 bit and 32 bit.Fix
To examine kernel parameters on a running system, run mdb (the kernel debugger) as a user which is member of group sys (e.g. the root user) and use option -k to access the /dev/kmem device (the virtual address space of the operating system kernel, see man kmem). By running mdb -k, the kernel debugger can never change but only display kernel information. In the following examples, "$" represents the root user prompt and ">" indicates the mdb prompt.To check a parameter, you can use one of the following methods:
1. Start mdb -k and then enter the kernel tunable parameter, followed by a format specifier:
$ mdb -k
Loading modules: [ unix krtld genunix specfs dtrace cpu.AuthenticAMD.15 uppc pcplusmp ufs ip sctp usba fcp fctl qlc nca random lofs zfs nfs md cpc fcip crypto logindmux ptm sppp ipc ]
> parameter/D
2. Use echo to display a kernel tunable parameter with format specifier and redirect the output into mdb -k:Loading modules: [ unix krtld genunix specfs dtrace cpu.AuthenticAMD.15 uppc pcplusmp ufs ip sctp usba fcp fctl qlc nca random lofs zfs nfs md cpc fcip crypto logindmux ptm sppp ipc ]
> parameter/D
$ echo parameter/D | mdb -k
Most Solaris servers are running in 64-bit mode these days. To
determine if your server is running in 64- or 32-bit mode, you can use
the isainfo command. This may be useful on older
systems, as some kernel tunables may have different sizes if the system
is running in 64-bit or 32-bit mode. In case of a 64-bit kernel, the
output will either contain sparcv9 or amd64. In case of a 32-bit kernel, the output will be sparc or i386. See the following example:
$ isainfo
sparcv9
You can display all available format specifiers in mdb as follows:sparcv9
> ::formats
The following format specifiers are typically used for displaying kernel parameter values in mdb -k:D - decimal signed int (4 bytes)
E - decimal unsigned long long (8 bytes)
You can get an overview of the kernel tunables in the Oracle Solaris Tunable Parameters Reference Manual for your version of Solaris, for example http://docs.oracle.com/cd/E26505_01/html/E37386/index.html (for Solaris 10 1/13 = Update 11). The document also describes the data type of each of the kernel parameters.
Another method for checking the size of a kernel tunable is to use the nm command (/usr/ccs/bin/nm in Solaris 10 package SUNWbtool; /usr/bin/nm in Solaris 11 package developer/base-developer-utilities or /usr/xpg4/bin/nm in Solaris 11 package system/xopen/xcu), as in the following examples:
$ /usr/ccs/bin/nm /dev/ksyms | nawk 'BEGIN{FS="|"}$NF=="shminfo_shmmax"{print $3, $NF}'
8 shminfo_shmmax
$ /usr/ccs/bin/nm /dev/ksyms | nawk 'BEGIN{FS="|"}$NF=="seminfo_semmns"{print $3, $NF}'
4 seminfo_semmns
If you do not know the exact name of the tunable, you can use the grep command or a different nawk syntax, as in the following example:8 shminfo_shmmax
$ /usr/ccs/bin/nm /dev/ksyms | nawk 'BEGIN{FS="|"}$NF=="seminfo_semmns"{print $3, $NF}'
4 seminfo_semmns
$ /usr/ccs/bin/nm /dev/ksyms | nawk 'BEGIN{FS="|"}$NF~/shmmax/{print $3, $NF}'
32 project_shmmax_ops
18 project_shmmax_test
4 rc_project_shmmax
8 shminfo_shmmax
The value in the first column (=column 3 of the original /usr/ccs/bin/nm output) shows the size (in bytes) of the tunable.32 project_shmmax_ops
18 project_shmmax_test
4 rc_project_shmmax
8 shminfo_shmmax
Here are some examples of tunable parameters:
physmem: Unsigned long
segkpsize: Unsigned long
noexec_user_stack: Signed integer (noexec_user_stack can be 0 or 1 only)
maxusers: Signed integer
maxuprc: Signed integer
max_nprocs: Signed integer
pidmax: Signed integer
lotsfree: Unsigned long
desfree: Unsigned integer
minfree: Unsigned integer
shminfo_shmmax: Unsigned long (obsolete in s10 and above)
seminfo_semmns: Signed integer (removed from s10 and above)
Sample output on a SPARC server (64 bit):
$ isainfo -k
sparcv9
$ pagesize
8192
$ mdb -k
Loading modules: [ unix genunix specfs dtrace zfs sd mpt px ip hook neti sctp arp usba ldc fcp fctl qlc nca lofs cpc random crypto fcip logindmux ptm ufs sppp nfs ipc ]
> ::version
mdb 1.1
> physmem/E
physmem:
physmem: 4117091
> segkpsize/E
segkpsize:
segkpsize: 262144
> noexec_user_stack/D
noexec_user_stack:
noexec_user_stack: 0
> maxusers/D
maxusers:
maxusers: 2048
> maxuprc/D
maxuprc:
maxuprc: 29995
> max_nprocs/D
max_nprocs:
max_nprocs: 30000
> pidmax/D
pidmax:
pidmax: 30000
> maxpid/D
maxpid:
maxpid: 30000
> lotsfree/E
lotsfree:
lotsfree: 64155
> desfree/E
desfree:
desfree: 32077
> minfree/E
minfree:
minfree: 16038
> shminfo_shmmax/E
shminfo_shmmax:
shminfo_shmmax: 8388608
> seminfo_semmns/D
seminfo_semmns:
seminfo_semmns: 60
<ctrl>d
Sample output on a x64 server (64 bit):sparcv9
$ pagesize
8192
$ mdb -k
Loading modules: [ unix genunix specfs dtrace zfs sd mpt px ip hook neti sctp arp usba ldc fcp fctl qlc nca lofs cpc random crypto fcip logindmux ptm ufs sppp nfs ipc ]
> ::version
mdb 1.1
> physmem/E
physmem:
physmem: 4117091
> segkpsize/E
segkpsize:
segkpsize: 262144
> noexec_user_stack/D
noexec_user_stack:
noexec_user_stack: 0
> maxusers/D
maxusers:
maxusers: 2048
> maxuprc/D
maxuprc:
maxuprc: 29995
> max_nprocs/D
max_nprocs:
max_nprocs: 30000
> pidmax/D
pidmax:
pidmax: 30000
> maxpid/D
maxpid:
maxpid: 30000
> lotsfree/E
lotsfree:
lotsfree: 64155
> desfree/E
desfree:
desfree: 32077
> minfree/E
minfree:
minfree: 16038
> shminfo_shmmax/E
shminfo_shmmax:
shminfo_shmmax: 8388608
> seminfo_semmns/D
seminfo_semmns:
seminfo_semmns: 60
<ctrl>d
$ isainfo -k
amd64
$ pagesize
4096
$ mdb -k
Loading modules: [ unix krtld genunix specfs dtrace cpu.AuthenticAMD.15 uppc pcplusmp ufs ip sctp usba fcp fctl qlc nca random lofs zfs nfs md cpc fcip crypto logindmux ptm sppp ipc ]
> ::version
mdb 1.1
> physmem/E
physmem:
physmem: 4159373
> segkpsize/E
segkpsize:
segkpsize: 524288
> noexec_user_stack/D
noexec_user_stack:
noexec_user_stack: 0
> maxusers/D
maxusers:
maxusers: 1022
> maxuprc/D
maxuprc:
maxuprc: 16357
> max_nprocs/D
max_nprocs:
max_nprocs: 16362
> pidmax/D
pidmax:
pidmax: 30000
> maxpid/D
maxpid:
maxpid: 30000
> lotsfree/E
lotsfree:
lotsfree: 63606
> desfree/E
desfree:
desfree: 31803
> minfree/E
minfree:
minfree: 15901
> shminfo_shmmax/E
shminfo_shmmax:
shminfo_shmmax: 8388608
> seminfo_semmns/D
seminfo_semmns:
seminfo_semmns: 60
<ctrl>d
For displaying the value of physmem in MB (SPARC or x64), you can use the following ksh command sequence:amd64
$ pagesize
4096
$ mdb -k
Loading modules: [ unix krtld genunix specfs dtrace cpu.AuthenticAMD.15 uppc pcplusmp ufs ip sctp usba fcp fctl qlc nca random lofs zfs nfs md cpc fcip crypto logindmux ptm sppp ipc ]
> ::version
mdb 1.1
> physmem/E
physmem:
physmem: 4159373
> segkpsize/E
segkpsize:
segkpsize: 524288
> noexec_user_stack/D
noexec_user_stack:
noexec_user_stack: 0
> maxusers/D
maxusers:
maxusers: 1022
> maxuprc/D
maxuprc:
maxuprc: 16357
> max_nprocs/D
max_nprocs:
max_nprocs: 16362
> pidmax/D
pidmax:
pidmax: 30000
> maxpid/D
maxpid:
maxpid: 30000
> lotsfree/E
lotsfree:
lotsfree: 63606
> desfree/E
desfree:
desfree: 31803
> minfree/E
minfree:
minfree: 15901
> shminfo_shmmax/E
shminfo_shmmax:
shminfo_shmmax: 8388608
> seminfo_semmns/D
seminfo_semmns:
seminfo_semmns: 60
<ctrl>d
$ echo physmem/E | mdb -k | nawk 'NR==2{print $NF*'$(pagesize)'/1024/1024}'
16247.6
16247.6
No comments:
Post a Comment