分享
 
 
 

ConfiguringanHP-UXKernel

王朝other·作者佚名  2008-05-18
窄屏简体版  字體: |||超大  

Kernel Commands

A new set of kernel-related commands has been developed that have a common behavior. This section covers all the commands and provides examples of using some of them.

kcmodule

kcmodule queries and changes kernel modules in the currently running kernel configuration or a saved kernel configuration that you are staging for future use. Hundreds of modules are present in an HP-UX kernel that consists of device drivers, kernel subsystems, and other kernel code.

kcmodule with no options provides the modules in your system and both their current state and the state on next boot if any changes are pending, as shown in this abbreviated example:

# kcmodule

Module State Cause Notes

DeviceDriver unused

KeyboardMUX unused

LCentIf static best

MouseMUX unused

UsbBootKeyboard unused

UsbBootMouse unused

UsbHub unused

UsbMiniBus unused

UsbOhci unused

acpi_node static best

arp static depend

asio0 static best

audio static best

autofsc static best

azusa_psm static best

beep static depend

btlan static best

c460gx_psm static depend

c8xx static best

cachefsc static best

ccio unused

cdfs auto best auto-loadable, unloadable

cec_hp static depend

cell static best

cifs static best

clone static best

consp1 unused

diag2 static best

dlpi static best

dm_sample_fsid unused

dmapi unused

dmp static depend

dmsample unused

echo static best

ehci unused

fcd static best

fcms static depend

fcp static depend

fcp_cdio static depend

fcparray static depend

fcpdev static depend

fcpmux static depend

fddi4 static best

ffs static best

framebuf unused

gelan static best

graph3 unused

gvid unused

gvid_core unused

hcd unused

hid unused

hpstreams static best

hsx static explicit loadable, unloadable

hub unused

ia64_psm static best

idds unused

.

.

.

This abbreviated output shows some of the modules in the system without much detail. We modify the last module shown, idds, in a later example. To get detailed information on a specific module, use the -v option, as shown for vxfs:

# kcmodule -v vxfs

Module vxfs [3F559170]

Description Veritas Journal File System (VxFS)

State static (best state)

State at Next Boot static (best state)

Capable static unused

Depends On module libvxfs:0.0.0

interface HPUX_11_23:1.0

#This verbose output shows more information for the specific module that we specified, or would have shown verbose output for every module if I had not specified the name of a specific module.

For every module in the verbose output, there is a name and description such as a name of vxfs, the version number in square brackets after the name, and a short description of the module in the example. It is possible for multiple versions to be listed if, for instance, the currently running kernel uses a different version than will be used on the next boot.

The state of the module is relative to the currently running kernel (which is shown in the example), the next boot (both the currently running and next boot states are shown), or a saved configuration. The module in the example is for the currently running kernel, so static means that the module is statically bound into the kernel and changing this state would require relinking the kernel executable and rebooting. The module could also be in the unused state, which means it is installed but not used, the loaded state, which means it has been dynamically loaded into the kernel, or the auto state, which means it will be dynamically loaded when it is first needed but hasn't been loaded yet.

The following list shows commonly used options to kcmodule:

kcmodule command-line flags:

-a

Includes all modules in the output.

-B

Backs up the currently running configuration prior to changing it.

-c config

Specifies the saved configuration to manage. If none is specified, manage the currently running configuration.

-C comment

Includes a comment pertaining to this invocation of the command in the kernel configuration log file.

-d

Adds the description for each item.

-D

Displays elements for which there is a pending change at the next boot.

-h

Holds the specified change(s) for the next boot.

-K

Keeps the currently running configuration, but does not back it up. Keep the existing backup unmodified.

-P

Parses using the specified output format.

-S

Displays the elements that have been set to something other than the default.

-v

Displays items using verbose output.

Some of these options will be used in the upcoming example of updating the kernel.

kctune

kctune queries and changes the value of kernel tunable parameters in the currently running kernel configuration or a saved kernel configuration that you are staging for future use.

kctune with no options provides the parameters in your system, as shown in the following abbreviated example:

# kctune

Tunable Value Expression Changes

NSTREVENT 50 Default

NSTRPUSH 16 Default

NSTRSCHED 0 Default

STRCTLSZ 1024 Default

STRMSGSZ 0 Default

acctresume 4 Default

acctsuspend 2 Default

aio_listio_max 256 Default Immed

aio_max_ops 2048 Default Immed

aio_monitor_run_sec 30 Default Immed

aio_physmem_pct 10 Default

aio_prio_delta_max 20 Default Immed

aio_proc_thread_pct 70 Default Immed

aio_proc_threads 1024 Default Immed

aio_req_per_thread 1 Default Immed

allocate_fs_swapmap 0 Default

alwaysdump 0 Default Immed

bufcache_hash_locks 128 Default

chanq_hash_locks 256 Default

core_addshmem_read 1 1 Immed

core_addshmem_write 1 1 Immed

create_fastlinks 0 Default

dbc_max_pct 50 Default Immed

dbc_min_pct 5 Default Immed

default_disk_ir 0 Default

disksort_seconds 0 Default

dma32_pool_size 268435456 Default

dmp_rootdev_is_vol 0 Default

dmp_swapdev_is_vol 0 Default

dnlc_hash_locks 512 Default

dontdump 0 Default Immed

dst 1 Default

dump_compress_on 1 Default Immed

enable_idds 0 Default Immed

eqmemsize 15 Default

executable_stack 0 Default Immed

fs_async 0 Default

fs_symlinks 20 Default Immed

ftable_hash_locks 64 Default

hp_hfs_mtra_enabled 1 Default

io_ports_hash_locks 64 Default

ksi_alloc_max 33600 Default Immed

ksi_send_max 32 Default

max_acct_file_size 2560000 Default Immed

max_async_ports 50 Default

max_mem_window 0 Default

max_thread_proc 256 Default Immed

maxdsiz 1073741824 Default Immed

maxdsiz_64bit 4294967296 Default Immed

maxfiles 8192 8192

maxfiles_lim 8192 8192 Immed

maxrsessiz 8388608 Default

maxrsessiz_64bit 8388608 Default

maxssiz 8388608 Default Immed

maxssiz_64bit 268435456 Default Immed

maxtsiz 100663296 Default Immed

maxtsiz_64bit 1073741824 Default Immed

maxuprc 256 Default Immed

maxvgs 10 Default

msgmap 1026 Default

msgmax 8192 Default Immed

msgmnb 16384 Default Immed

msgmni 512 Default

msgseg 8192 Default

msgssz 96 Default

msgtql 1024 Default

ncdnode 150 Default Immed

nclist 8292 Default

ncsize 8976 Default

nfile 65536 Default Auto

nflocks 4096 Default Auto

ninode 4880 Default

.

.

.

This output shows the tunable parameter, its current value, the expressions used to compute the value (which is the default in all cases in the example except for maxfiles), and changes to the value if any are pending. In an upcoming example, I modify the nproc tunable.

Using the -d option, which also works with kcmodule, adds a description for each parameter, as shown in the following truncated example:

# kctune -d

Tunable Value Expression Changes

Description

NSTREVENT 50 Default

Maximum number of concurrent Streams bufcalls

NSTRPUSH 16 Default

Maximum number of Streams modules in a stream

NSTRSCHED 0 Default

Number of Streams scheduler daemons to run (0 = automatic)

STRCTLSZ 1024 Default

Maximum size of the control portion of a Streams message (bytes)

STRMSGSZ 0 Default

Maximum size of the data portion of a Streams message (bytes; 0 = unlimited)

acctresume 4 Default

Relative percentage of free disk space required to resume accounting

acctsuspend 2 Default

Relative percentage of free disk space below which accounting is suspended

aio_listio_max 256 Default Immed

Maximum number of async IO operations that can be specified in lio_list call

aio_max_ops 2048 Default Immed

Maximum number of async IO operations that can be queued at any time

aio_monitor_run_sec 30 Default Immed

Frequency of AIO Thread Pool Monitor Execution (in seconds)

aio_physmem_pct 10 Default

.

.

.

Each module now has a more detailed description associated with it as a result of using the -d option.

To group parameters based on the kernel module that defines the tunable, use the -g option, as shown in the following abbreviated example:

# kctune -g

Module Tunable Value Expression Changes

cdfs ncdnode 150 Default Immed

dump alwaysdump 0 Default Immed

dump dontdump 0 Default Immed

dump dump_compress_on 1 Default Immed

fs bufcache_hash_locks 128 Default

fs dbc_max_pct 50 Default Immed

fs dbc_min_pct 5 Default Immed

fs disksort_seconds 0 Default

fs dnlc_hash_locks 512 Default

fs fs_async 0 Default

fs fs_symlinks 20 Default Immed

fs ftable_hash_locks 64 Default

fs maxfiles 8192 8192

fs maxfiles_lim 8192 8192 Immed

fs ncsize 8976 Default

fs nfile 65536 Default Auto

fs nflocks 4096 Default Auto

fs o_sync_is_o_dsync 0 Default

fs sendfile_max 0 Default

fs vnode_cd_hash_locks 128 Default

fs vnode_hash_locks 128 Default

hpstreams NSTREVENT 50 Default

hpstreams NSTRPUSH 16 Default

hpstreams NSTRSCHED 0 Default

hpstreams STRCTLSZ 1024 Default

hpstreams STRMSGSZ 0 Default

hpstreams streampipes 0 Default

idds enable_idds 0 Default Immed

inet tcphashsz 2048 Default

io aio_listio_max 256 Default Immed

io aio_max_ops 2048 Default Immed

io aio_monitor_run_sec 30 Default Immed

io aio_physmem_pct 10 Default

io aio_prio_delta_max 20 Default Immed

io aio_proc_thread_pct 70 Default Immed

io aio_proc_threads 1024 Default Immed

io aio_req_per_thread 1 Default Immed

io io_ports_hash_locks 64 Default

io max_async_ports 50 Default

ite scroll_lines 100 Default Immed

lvm maxvgs 10 Default

pm acctresume 4 Default

pm acctsuspend 2 Default

pm chanq_hash_locks 256 Default

pm dst 1 Default

.

.

.

This output shows all the tunables grouped with their kernel modules. You can see that, in the case of the fs module, for example, many tunables are associated with some modules.

The -v output, as shown in the following abbreviated example, provides a lot of tunable-related information:

# kctune -v

Tunable NSTREVENT

Description Maximum number of concurrent Streams bufcalls

Module hpstreams

Current Value 50 [Default]

Value at Next Boot 50 [Default]

Value at Last Boot 50

Default Value 50

Can Change At Next Boot Only

Tunable NSTRPUSH

Description Maximum number of Streams modules in a stream

Module hpstreams

Current Value 16 [Default]

Value at Next Boot 16 [Default]

Value at Last Boot 16

Default Value 16

Can Change At Next Boot Only

Tunable NSTRSCHED

Description Number of Streams scheduler daemons to run (0 = automatic)

Module hpstreams

Current Value 0 [Default]

Value at Next Boot 0 [Default]

Value at Last Boot 0

Default Value 0

Can Change At Next Boot Only

Tunable STRCTLSZ

Description Maximum size of the control portion of a Streams message (by

tes)

Module hpstreams

Current Value 1024 [Default]

Value at Next Boot 1024 [Default]

Value at Last Boot 1024

Default Value 1024

Can Change At Next Boot Only

Tunable STRMSGSZ

Description Maximum size of the data portion of a Streams message (bytes

; 0 = unlimited)

Module hpstreams

Current Value 0 [Default]

Value at Next Boot 0 [Default]

Value at Last Boot 0

Default Value 0

Can Change At Next Boot Only

Standard input

.

.

.

This output shows additional information, including the value the parameter will have upon the next boot.

All tunables have manual pages. If, for example, you want to know more about a tunable, just issue the man for the tunable, as shown in the following example for nproc:

# man nproc

nproc(5) nproc(5)

Tunable Kernel Parameters

NAME

nproc - limits the number of processes allowed to exist simultaneously

VALUES

Failsafe

4200

Default

4200

Allowed values

100 - 30000

This may be set higher, but more will not be used. Setting nproc

below 110 will interfere with the systems ability to execute in

multi-user mode. Some configurations may have a higher minimum.

nproc must be greater than nkthread + 100.

Standard input

Only the beginning of the nproc output is shown, but you can see there is a lot of useful information in the man page, such as the default and allowed values. The following list shows commonly used options to kctune.

kctune command-line flags:

-a

Includes all information in the output that is normally suppressed.

-B

Backs up the currently running configuration prior to changing it.

-c config

Specifies the saved configuration to manage. If none is specified, manages the currently running configuration.

-C comment

Includes a comment pertaining to this invocation of the command in the kernel configuration log file.

-d

Displays the descriptions of each item.

-D

Displays elements for which there is a pending change at the next boot.

-g

Groups related tunables in the output.

-h

Holds the specified change(s) for the next boot.

-K

Keeps the currently running configuration, but does not back it up. Keeps the existing backup unmodified.

-P

Parses using the specified output format.

-S

Displays the elements that have been set to something other than the default.

-u

Allows the creation of user-defined tunables.

-v

Displays items using verbose output.

Some of these options are used in the upcoming kernel configuration example.

kconfig

kconfig manages kernel configurations.

Running kconfig with no options shows you all the saved kernel configurations on your system. You can view the output using -a for all, -v for verbose, and -P for parse.

Changes to the kernel can be delayed until the next boot using the -n option to kconfig. (Next boot options are also available with the -h option for kcmodule and kctune.)

To obtain a list of changes being held for the next boot, you would use the -D option to kconfig to show differences between the currently running kernel and what is planned for the next boot. You could also run kcmodule and kctune with the -D option to get this same list. If you don't want these changes to be applied at the next boot, use the -H option to kconfig, which "unholds" the settings.

To obtain a list of non-default kernel values, use the -S option to kconfig. This too is a shortcut for running both kcmodule and kctune with the -S option.

You can specify a saved configuration with no option to kconfig by just naming it on the command line or by using the -c option for kcmodule and kctune.

If you have made changes to the currently running kernel and want to save, use the -s option to kconfig.

You can load a saved configuration using the -l option to kconfig. If the configuration can be loaded without a reboot, the change takes effect immediately. If not, the change is held for the next reboot. You can specify that the change be applied at the next reboot with the -n option for kconfig. You can identify the configuration to be loaded a the next boot using the -w option to kconfig.

Several of these options are used in the upcoming kernel reconfiguration example.

The following is a list of commonly used kconfig options.

kconfig command-line flags:

-a

Includes all information in the output that is normally suppressed. This provides a lot of information so you may want to pipe this to more.

-B

Backs up the currently running configuration prior to changing it.

-C comment

Includes a comment pertaining to this invocation of the command in the kernel configuration log file.

-d config

Deletes the specified kernel configuration.

-D

Displays elements for which there is a pending change at the next boot.

-e

Exports the saved configuration.

-h

Holds the specified change(s) for the next boot.

-H

Discards all changes being held for the next boot.

-i config

Imports the specified configuration.

-K

Keeps the currently running configuration, but does not back it up. Keeps the existing backup unmodified.

-l config

Loads the specified configuration.

-P

Parses using the specified output format.

-S

Displays the elements that have been set to something other than the default.

-v

Displays items using verbose output.

kclog

kclog manages the kernel configuration log file.

All the commands previously covered (kcmodule, kctune, and kconfig) update and maintain the kernel configuration plain text log file called /var/adm/kc.log. You can view this file directly to see the kernel-related commands that have been issued, which is the way that I view kernel-related changes, or issue the kclog command to view /var/adm/kc.log.

kclog has the following commonly used command-line flags:

kclog commonly used command line options:

-a

Prints all entries matching

-c config

Prints log file entries from the specified configuration.

-C comment

Includes the specified comment.

kcusage

kcusage shows the usage level of kernel resources. If you issue the kcusage command with no options, you get output for the currently running system, as shown in the following output:

# kcusage

Tunable Usage / Setting

=============================================

dbc_max_pct 5 / 50

maxdsiz 37666816 / 1073741824

maxdsiz_64bit 7258112 / 4294967296

maxfiles_lim 56 / 8192

maxssiz 1179648 / 8388608

maxssiz_64bit 20480 / 268435456

maxtsiz 421888 / 100663296

maxtsiz_64bit 237568 / 1073741824

maxuprc 0 / 256

max_thread_proc 57 / 256

msgmni 2 / 512

msgseg 0 / 8192

msgtql 0 / 1024

nfile 586 / 65536

nflocks 20 / 4096

ninode 653 / 4880

nkthread 484 / 8416

nproc 150 / 4200

npty 0 / 60

nstrpty 0 / 60

nstrtel 0 / 60

semmni 23 / 2048

semmns 25 / 8192

shmmax 17906400 / 68719476736

shmmni 7 / 400

[rx8620b{root}:/roothome]>

This is an idle system so the resources are used minimally.

You can specify the time period over which data should be printed, including 24 hours, 31 days, and 52 weeks. Two interesting options to kcusage are -l, which prints a long format, and -t, which prints the top 5 users or processes that have consumed each resource. The following is an obviated listing of these two outputs:

# kcusage -l

Parameter: dbc_max_pct

Usage: 5

Setting: 50

Percentage: 10.0

Parameter: maxdsiz

Usage: 37666816

Setting: 1073741824

Percentage: 3.5

Parameter: maxdsiz_64bit

Usage: 7258112

Setting: 4294967296

Percentage: 0.2

Parameter: maxfiles_lim

Usage: 56

Setting: 8192

Percentage: 0.7

Parameter: maxssiz

Usage: 1179648

Setting: 8388608

Standard input

.

.

.

# kcusage -t

Tunable Usage / Setting Usage Id Name

==========================================================================

dbc_max_pct 5 / 50

maxdsiz 37666816 / 1073741824

37666816 3009 java

28766208 1278 prm3d

26869760 1254 midaemon

4468736 1289 scopeux

2424832 2438 rep_server

maxdsiz_64bit 7258112 / 4294967296

7258112 1125 cimserver

2019328 383 utmpd

1814528 1506 icodd

1134592 501 ipmon

69632 1505 cimserverd

maxfiles_lim 56 / 8192

56 3009 java

30 757 inetd

22 1156 pwgrd

20 1289 scopeux

20 2439 agdbserver

maxssiz 1179648 / 8388608

1179648 3009 java

.

.

.

kcusage has the following commonly used command-line flags:

-h

Prints kernel usage data over the past hour in 5- minute intervals

-d

Prints kernel usage data over the past 24 hours in hourly intervals

-m

Prints kernel usage data over the past 31 days in daily intervals

-y

Prints kernel usage data for the past 52 weeks in weekly intervals

-l

Prints the listing in long format

-t

Prints a listing that includes the top 5 processes or users of each resource

kcalarm

kcalarm manages alarms of kernel tunable parameters. By using kcalarm, you can perform a variety of alarm-related tasks.

kcalarm has the following command-line flags:

-a

Adds a tunable alarm.

-d

Deletes a tunable alarm.

-F

Forces a change in the status of an alarm.

-t threshold

Sets the threshold, which is based on a percentage of the current tunable value, such as 80%, which is the default

-e

Specifies the type of event that will trigger an alarm, such as initial, repeat, or return

-i interval

Specifies the sampling interval of the tunable in minutes. The default is 5 minutes

-c comment

Identifies the alarm request with your comment

-k key

Specifies a key that makes clear the alarm

-n notification

Target to be notified if the alarm is triggered such as the email address to which an email will be sent or a syslog entry to be written

-l

Produces a long listing

-s(on|off)

Sets the alarm on or off

-m(on|off|status)

Sets the monitoring of the kernel tunable as on, off, or view its present status

kcmond

The kcmond daemon monitors the amount of kernel resources consumed as part of Event Monitoring Service (EMS.) The data that kcmond captures can be displayed with kcusage. kcmond is an important part of managing alarms with kcalarm as described earlier. kcmond is started as part of EMS and is not designed to be run from the command line.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有