17 tuning kernel behavior through /proc

in /proc there is status information about kernel and /sys subdirectory which helps to optimize kernel parameters

[svn@svn proc]$ cat cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz
stepping : 3
microcode : 0x10
cpu MHz : 2493.758
cache size : 3072 KB


[svn@svn proc]$ cat partitions 
major minor  #blocks  name

   8       16    5242880 sdb
   8       17     102400 sdb1
   8       18     102400 sdb2
   8        0   31457280 sda
   8        1    1048576 sda1
   8        2   19921920 sda2
  11        0    8086528 sr0
 253        0   17821696 dm-0
 253        1    2097152 dm-1
[svn@svn proc]$ 

[svn@svn proc]$ cat meminfo 
MemTotal:        1842688 kB
MemFree:          119016 kB
MemAvailable:     562412 kB
Buffers:             144 kB
Cached:           994440 kB
SwapCached:          488 kB
Active:           898948 kB
Inactive:         551496 kB
Active(anon):     605752 kB

for optimization let's have a look at /sys subdirectory

[svn@svn proc]$ cd sys
[svn@svn sys]$ ll
total 0
dr-xr-xr-x. 1 root root 0 Aug 27 16:50 abi
dr-xr-xr-x. 1 root root 0 Aug 27 15:35 crypto
dr-xr-xr-x. 1 root root 0 Aug 27 16:50 debug
dr-xr-xr-x. 1 root root 0 Aug 27 16:50 dev
dr-xr-xr-x. 1 root root 0 Aug 27 15:34 fs
dr-xr-xr-x. 1 root root 0 Aug 27 15:34 kernel
dr-xr-xr-x. 1 root root 0 Aug 27 15:34 net #networking
dr-xr-xr-x. 1 root root 0 Aug 27 16:50 sunrpc
dr-xr-xr-x. 1 root root 0 Aug 27 15:35 vm #virtual memory
[svn@svn sys]$ 


[svn@svn sys]$ cd kernel/
[svn@svn kernel]$ ls
acct                               panic_on_warn
acpi_video_flags                   perf_cpu_time_max_percent
auto_msgmni                        perf_event_max_sample_rate
bootloader_type                    perf_event_mlock_kb
bootloader_version                 perf_event_paranoid
cad_pid                            pid_max
cap_last_cap                       poweroff_cmd
compat-log                         print-fatal-signals
core_pattern                       printk
core_pipe_limit                    printk_delay
core_uses_pid                      printk_ratelimit
ctrl-alt-del                       printk_ratelimit_burst
dmesg_restrict                     pty
domainname                         random
ftrace_dump_on_oops                randomize_va_space
ftrace_enabled                     real-root-dev
hardlockup_all_cpu_backtrace       sched_autogroup_enabled
hardlockup_panic                   sched_cfs_bandwidth_slice_us
hostname                           sched_child_runs_first
hotplug                            sched_domain


[svn@svn kernel]$ cat osrelease 
3.10.0-514.el7.x86_64

[svn@svn kernel]$ cat /proc/version 
Linux version 3.10.0-514.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Tue Nov 22 16:42:41 UTC 2016
[svn@svn kernel]$ 

/proc/sys/kernel
[svn@svn kernel]$ cat hostname 
svn.localdomain
[svn@svn kernel]$ hostname
svn.localdomain
[svn@svn kernel]$ 
==========================
by default linux configured as a router to forward packages
/proc/sys/net
[svn@svn net]$ cat ipv4/ip_forward
1

==============================
swappiness indicates the willingness of kernel to swap file which are no longer needed
[svn@svn net]$ cd ../vm/
[svn@svn vm]$ cat swappiness 
30
[svn@svn vm]$ pwd
/proc/sys/vm
[svn@svn vm]$ echo 60 > swappiness

swappiness to 100
==============================








Comments

Popular posts from this blog

HAproxy logging

teamcity Automatic Agent Start under Linux

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all