PR

バッファサイズのメモ – SendBufferSize

バッファサイズに関するメモ。

サーバは TCP バッファサイズを指定されたバイト数に設定します。 高速で高レイテンシな環境で (例 100ms 程度、大陸横断高速通信路など) 古い一般的な OS のデフォルト値を増やすのに非常に便利です。 0にした場合、OS のデフォルト値が使用されます。(「mpm_common – Apache HTTP サーバ」より引用)

スポンサードリンク

システムのバッファサイズ

Linuxシステムに設定されているTCP/IPの送信バッファサイズ(tcp_wmem)を確認する場合は、sysctlコマンドを使用(「A.73 SendBufferSize」より引用)

Ubuntu Server 10.04 LTS Default

$ /sbin/sysctl -n net.ipv4.tcp_wmem
 4096    16384   905792

CentOS 6.2 Default

# /sbin/sysctl -n net.ipv4.tcp_wmem
 4096    16384   3469312

CentOS 5.8 cPanel & WHM

# /sbin/sysctl -n net.ipv4.tcp_wmem
 4096    16384   4194304

FreeBSD の”ある”レンタルサーバー

%sysctl net.inet.tcp.recvspace
 net.inet.tcp.recvspace: 131072

Iperf コマンド

インストール

yum

# yum install iperf
 Loaded plugins: fastestmirror, presto
 Determining fastest mirrors
 * base: rsync.atworks.co.jp
 * extras: rsync.atworks.co.jp
 * updates: rsync.atworks.co.jp
 Setting up Install Process
 No package iperf available.
 Error: Nothing to do

標準的なyum には無いらしい。

Ubuntu

$ sudo aptitude install iperf
ダウンロード

コマンド概要

$ iperf
 Usage: iperf [-s|-c host] [options]
 Try `iperf --help' for more information.

現在状態

$ iperf -s
 ------------------------------------------------------------
 Server listening on TCP port 5001
 TCP window size: 85.3 KByte (default)
 ------------------------------------------------------------

localhost

$ iperf -c localhost -t 60 -i 1 -p 80
 ------------------------------------------------------------
 Client connecting to localhost, TCP port 80
 TCP window size: 49.5 KByte (default)
 ------------------------------------------------------------
 [  3] local 127.0.0.1 port 49861 connected with 127.0.0.1 port 80
 [ ID] Interval       Transfer     Bandwidth
 [  3]  0.0- 1.0 sec   147 MBytes  1.23 Gbits/sec
 [  3]  1.0- 2.0 sec   146 MBytes  1.22 Gbits/sec
 [  3]  2.0- 3.0 sec   146 MBytes  1.23 Gbits/sec
 [  3]  3.0- 4.0 sec   146 MBytes  1.23 Gbits/sec
 [  3]  4.0- 5.0 sec   146 MBytes  1.23 Gbits/sec

海外サーバー

$ iperf -c xxx.xxx.xxx -t 60 -i 1 -p 80
 ------------------------------------------------------------
 Client connecting to xxx.xxx.xxx, TCP port 80
 TCP window size: 16.0 KByte (default)
 ------------------------------------------------------------
 [  3] local 192.168.1.11 port 39282 connected with xxx.xxx.xxx port 80
 [ ID] Interval       Transfer     Bandwidth
 [  3]  0.0- 1.0 sec   384 KBytes  3.15 Mbits/sec
 [  3]  1.0- 2.0 sec   128 KBytes  1.05 Mbits/sec
 [  3]  2.0- 3.0 sec   128 KBytes  1.05 Mbits/sec
 [  3]  3.0- 4.0 sec   256 KBytes  2.10 Mbits/sec
 [  3]  4.0- 5.0 sec   256 KBytes  2.10 Mbits/sec

理研

sudo iperf -c ftp.riken.jp -t 60 -i 1 -p 80
 ------------------------------------------------------------
 Client connecting to ftp.riken.jp, TCP port 80
 TCP window size: 16.0 KByte (default)
 ------------------------------------------------------------
 [  3] local 192.168.1.11 port 47681 connected with 134.160.38.1 port 80
 [ ID] Interval       Transfer     Bandwidth
 [  3]  0.0- 1.0 sec   384 KBytes  3.15 Mbits/sec
 [  3]  1.0- 2.0 sec   128 KBytes  1.05 Mbits/sec
 [  3]  2.0- 3.0 sec   256 KBytes  2.10 Mbits/sec
 [  3]  3.0- 4.0 sec   128 KBytes  1.05 Mbits/sec

参考文献

SendBufferSize

prefork

コメント