日期:2014-05-16  浏览次数:20939 次

linux sysctl命令学习

sysctl命令用于运行时配置内核参数,这些参数位于/proc/sys目录下。

使用sysctl -a可以用来查看当前系统中所有的内核参数配置,
了解这些内核参数的意义对于解决问题会很有帮助。
sh-# sysctl -a
kernel.sched_child_runs_first = 0
kernel.sched_min_granularity_ns = 750000
kernel.sched_latency_ns = 6000000
kernel.sched_wakeup_granularity_ns = 1000000
kernel.sched_tunable_scaling = 1
kernel.sched_migration_cost = 500000
kernel.sched_nr_migrate = 32
kernel.sched_time_avg = 1000
kernel.sched_shares_window = 10000000
kernel.timer_migration = 1
kernel.sched_rt_period_us = 1000000
kernel.sched_rt_runtime_us = 950000
kernel.panic = 0
kernel.core_uses_pid = 0
kernel.core_pattern = core
kernel.core_pipe_limit = 0
kernel.tainted = 1
kernel.print-fatal-signals = 0
kernel.ctrl-alt-del = 0
kernel.modprobe = /sbin/modprobe
kernel.modules_disabled = 0
kernel.hotplug = /sbin/hotplug
kernel.sg-big-buff = 32768
kernel.cad_pid = 1
kernel.threads-max = 4606
kernel.random.poolsize = 4096
kernel.random.entropy_avail = 152
kernel.random.read_wakeup_threshold = 64
kernel.random.write_wakeup_threshold = 128
kernel.random.boot_id = 9e7b0657-6f91-4e94-9c05-55c49dd99da9
kernel.random.uuid = 309f03a1-28d0-47e0-9616-a390bb0349ba
kernel.usermodehelper.bset = 4294967295 4294967295
kernel.usermodehelper.inheritable = 4294967295  4294967295
kernel.overflowuid = 65534
kernel.overflowgid = 65534
kernel.pid_max = 32768
kernel.panic_on_oops = 0
kernel.printk = 7       4       1       7
kernel.printk_ratelimit = 5
kernel.printk_ratelimit_burst = 10
kernel.printk_delay = 0
kernel.dmesg_restrict = 0
kernel.kptr_restrict = 0
kernel.ngroups_max = 65536
kernel.randomize_va_space = 1
kernel.max_lock_depth = 1024
kernel.poweroff_cmd = /sbin/poweroff
kernel.blk_iopoll = 1
kernel.ostype = Linux
kernel.osrelease = 3.0.13
kernel.version = #1 PREEMPT Tue Oct 8 16:24:52 CST 2013
kernel.hostname = 1234
kernel.domainname = (none)
kernel.shmmax = 33554432
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.msgmax = 8192
kernel.msgmni = 575
kernel.msgmnb = 16384
kernel.sem = 250        32000   32      128
kernel.auto_msgmni = 1
kernel.pty.max = 4096
kernel.pty.nr = 0
vm.overcommit_memory = 0
vm.panic_on_oom = 0
vm.oom_kill_allocating_task = 0
vm.oom_dump_tasks = 1
vm.overcommit_ratio = 50
vm.page-cluster = 3
vm.dirty_background_ratio = 10
vm.dirty_background_bytes = 0
vm.dirty_ratio = 20
vm.dirty_bytes = 0
vm.dirty_writeback_centisecs = 500
vm.dirty_expire_centisecs = 3000
vm.nr_pdflush_threads = 0
vm.swappiness = 60
vm.lowmem_reserve_ratio = 256   32      32
vm.drop_caches = 0
vm.min_free_kbytes = 2188
vm.min_free_order_shift = 1
vm.percpu_pagelist_fraction = 0
vm.max_map_count = 65530
vm.laptop_mode = 0
vm.block_dump = 0
vm.vfs_cache_pressure = 100
vm.mmap_min_addr = 4096
vm.highmem_is_dirtyable = 0
vm.scan_unevictable_pages = 0
fs.inode-nr = 2145      0
fs.inode-state = 2145   0       0       0       0       0       0
fs.file-nr = 297        0       29469
fs.file-max = 29469
fs.nr_open = 1048576
fs.dentry-state = 2777  2184    45      0       0     &