Network tuning Solaris

Setting up TCP stack for best performance in solaris:

 

set ndd:tcp_wscale_always=1
set ndd:tcp_tstamp_if_wscale=1
set ndd:tcp_max_buf=16777216
set ndd:tcp_cwnd_max=8388608
set ndd:tcp_xmit_hiwat=1048576
set ndd:tcp_recv_hiwat=1048576

ndd -set /dev/ip ip_forwarding 0
ndd -set /dev/tcp tcp_wscale_always 1
ndd -set /dev/tcp tcp_tstamp_if_wscale 1
ndd -set /dev/tcp tcp_max_buf 16777216
ndd -set /dev/tcp tcp_cwnd_max 8388608
ndd -set /dev/tcp tcp_xmit_hiwat 2048576
ndd -set /dev/tcp tcp_recv_hiwat 2048576

# memory interface this is the big gainer
set net.ipv4.tcp_sack = 0
# sets min/default/max TCP read buffer, default 4096 87380 174760
set net.ipv4.tcp_rmem = 10000000 10000000 10000000
# sets min/pressure/max TCP write buffer, default 4096 16384 131072
set net.ipv4.tcp_wmem = 10000000 10000000 10000000
# sets min/pressure/max TCP buffer space, default 31744 32256 32768
set net.ipv4.tcp_mem = 10000000 10000000 10000000
### CORE settings
# maximum receive socket buffer size, default 131071
set net.core.rmem_max = 524287
# maximum send socket buffer size, default 131071
set net.core.wmem_max = 524287
# default receive socket buffer size, default 65535
set net.core.rmem_default = 524287
# default send socket buffer size, default 65535
set net.core.wmem_default = 524287
# maximum amount of option memory buffers, default 10240
set net.core.optmem_max = 524287
# number of unprocessed input packets before kernel starts dropping
# them, default 300
set net.core.netdev_max_backlog = 300000