sysctl - Linuxカーネルのパラメータを設定する | Linuxチューニング
2009/09/18 18:27更新
sysctlコマンドは、Linuxカーネルのパラメータを実行時に動的に変更して適応することができます。
sysctl -aで変更できるパラメータを確認
sysctlコマンドで何の変更ができるかを「sysctl -a」で確認できます。
# sysctl -a
sunrpc.tcp_slot_table_entries = 16
sunrpc.udp_slot_table_entries = 16
sunrpc.max_resvport = 1023
sunrpc.min_resvport = 650
...
net.ipv6.conf.eth1.max_addresses = 16
net.ipv6.conf.eth1.max_desync_factor = 600
net.ipv6.conf.eth1.regen_max_retry = 5
net.ipv6.conf.eth1.temp_prefered_lft = 86400
net.ipv6.conf.eth1.temp_valid_lft = 604800
net.ipv6.conf.eth1.use_tempaddr = 0
net.ipv6.conf.eth1.force_mld_version = 0
...
sunrpc.tcp_slot_table_entries = 16
sunrpc.udp_slot_table_entries = 16
sunrpc.max_resvport = 1023
sunrpc.min_resvport = 650
...
net.ipv6.conf.eth1.max_addresses = 16
net.ipv6.conf.eth1.max_desync_factor = 600
net.ipv6.conf.eth1.regen_max_retry = 5
net.ipv6.conf.eth1.temp_prefered_lft = 86400
net.ipv6.conf.eth1.temp_valid_lft = 604800
net.ipv6.conf.eth1.use_tempaddr = 0
net.ipv6.conf.eth1.force_mld_version = 0
...
さらに指定する前のパラメータを探し出すには、grepと合わせて利用します。
# sysctl -a | grep tcp
sunrpc.tcp_slot_table_entries = 16
net.ipv4.tcp_bic_beta = 819
net.ipv4.tcp_tso_win_divisor = 8
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.tcp_bic_low_window = 14
net.ipv4.tcp_bic_fast_convergence = 1
...
sunrpc.tcp_slot_table_entries = 16
net.ipv4.tcp_bic_beta = 819
net.ipv4.tcp_tso_win_divisor = 8
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.tcp_bic_low_window = 14
net.ipv4.tcp_bic_fast_convergence = 1
...
sysctl -wでパラメータを変更
sysctl -w <パラメータ>=<値>
でパラメータを変更します。例えば、
sysctl -w net.ipv4.tcp_syncookie=0
ちなみに、Linuxシステムは、起動時に/etc/sysctl.confを読み込んでパラメータを設定します。
sysctl -w で設定したパラメータは再起動時なくなりますので、
sysctl -p
で/etc/sysctl.confに適応(保存)されます。参考資料
@IT:/procによるLinuxチューニング [前編](1/2)
sysctlによるカーネルのチューニング - SourceForge.JP Magazine
Sponsored Link
- 関連記事
- RPMパッケージから Linuxドライバーのインストール - (2009/06/13 23:36)
- SuSE YaSTで利用する言語の設定および変更 - (2011/03/18 07:43)
- shutdown - システム シャットダウン・再起動 - (2009/06/10 15:53)
- Linuxシェル(Shell)の作成と実行 - (2009/06/10 16:14)
- LinuxでUSBメモリを使う - (2009/06/13 15:33)
- viコマンドを使おう - これだけを覚えておけば - (2009/06/13 20:58)
- uname - Linuxカーネル 確認 - (2009/06/13 23:48)
- df / du コマンド - ハードディスクの使用状況・ファイル/フォルダサイズ表示 - (2009/06/15 14:56)
- tailコマンド活用 - ログ出力をリアルタイムに追跡 - (2009/06/15 15:31)
- psコマンド よくある使い方 - (2009/06/17 11:34)