ユーザ用ツール

サイト用ツール


サイドバー

このページの翻訳:



最近の更新



Tag Cloud

01_linux:09_ベンチマーク:05_tuning_linux

文書の過去の版を表示しています。


05 Linuxチューニング

ディスクIO

①.午前四時の高負荷(Cron)

mlocate, makewhatis のCronを停止する。

  chmod 0 /etc/cron.daily/mlocate.cron
  chmod 0 /etc/cron.daily/makewhatis.cron
  chmod 0 /etc/cron.weekly/makewhatis.cron

②.Swap

③.IOキューサイズ変更

ディスクIOのキューサイズは低いほどレスポンス重視、高いほどスループット重視

 # echo 1024 > /sys/block/ディスクデバイス名/queue/nr_requests
 # echo 128 > /sys/block/ディスクデバイス名/queue/nr_requests

④.IOスケジューラ

http://city.hokkai.or.jp/~hachikun/IOScheduler.html

 # echo deadline > /sys/block/ディスクデバイス名/queue/scheduler
 # echo noop > /sys/block/ディスクデバイス名/queue/scheduler

⑤.noatime

⑥.Writebackの設定

ネットワーク

①.sysctl.confに下記を追加

#net.ipv4.tcp_syncookies
net.ipv4.tcp_syncookies = 1
# net.ipv4.tcp_window_scaling
net.ipv4.tcp_window_scaling = 1
# net.core.rmem_max
net.core.rmem_max = 16777216
# net.core.wmem_max
net.core.wmem_max = 16777216
# net.ipv4.tcp_rmem
net.ipv4.tcp_rmem = 4096 87380 16777216
# net.ipv4.tcp_wmem
net.ipv4.tcp_wmem = 4096 87380 16777216
# net.ipv4.tcp_no_metrics_save
net.ipv4.tcp_no_metrics_save = 1
# net.ipv4.tcp_moderate_rcvbuf
net.ipv4.tcp_moderate_rcvbuf = 1
# net.core.netdev_max_backlog
net.core.netdev_max_backlog = 5000
#net.core.somaxconn
net.core.somaxconn = 4096

New

https://pleiades.ucsc.edu/hyades/Linux_Network_Tuning

# http://fasterdata.es.net/host-tuning/linux/
# allow testing with buffers up to 128MB
net.core.rmem_max = 134217728
net.core.wmem_max = 134217728
# increase Linux autotuning TCP buffer limit to 128MB
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864
# increase the length of the processor input queue
net.core.netdev_max_backlog = 250000
# recommended default congestion control is cubic
net.ipv4.tcp_congestion_control=cubic
# recommended for hosts with jumbo frames enabled
net.ipv4.tcp_mtu_probing=1
/sbin/ifconfig eth0 txqueuelen 10000
/sbin/ifconfig eth1 txqueuelen 10000
反映
# sysctl -p

②.NICのオフロード機能を無効

for file in `ls /etc/sysconfig/network-scripts/ifcfg-eth[0-9]`
do
  ETH=`echo $file| sed 's/.*\(eth[0-9]\)/\1/g'`
  ethtool -K $ETH rx off
  ethtool -K $ETH tx off
  ethtool -K $ETH tso off
  ethtool -K $ETH gro off
done

CentOS6

CentOS6 ではなら TSO on / GSO off が良さそう。
http://uzy-exe.hateblo.jp/entry/2014/05/10/144824

for file in `ls /etc/sysconfig/network-scripts/ifcfg-eth[0-9]`
do
  ETH=`echo $file| sed 's/.*\(eth[0-9]\)/\1/g'`
  ethtool -K $ETH tso on
  ethtool -K $ETH gro off
done
01_linux/09_ベンチマーク/05_tuning_linux.1525158286.txt.gz · 最終更新: 2018/05/01 16:04 by matsui