Commit 98c8aaac authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b6a830d8
...@@ -142,6 +142,7 @@ $@ ...@@ -142,6 +142,7 @@ $@
# init_net - initialize networking # init_net - initialize networking
init_net() { init_net() {
# local our external address IPv4 or IPv6 # local our external address IPv4 or IPv6
# XXX better parse `ip addr`
myaddr=$(getent hosts `hostname` |grep -v 127.0 |awk '{print $1}') myaddr=$(getent hosts `hostname` |grep -v 127.0 |awk '{print $1}')
test -n "$myaddr" || die "init_net: cannot determine my network address" test -n "$myaddr" || die "init_net: cannot determine my network address"
...@@ -507,9 +508,12 @@ system_info() { ...@@ -507,9 +508,12 @@ system_info() {
mntdev=`findmnt -n -o source $mntpt` # mountpoint -> device mntdev=`findmnt -n -o source $mntpt` # mountpoint -> device
blkdev=`echo $mntdev |sed -e 's/[0-9]*$//'` # /dev/sda3 -> /dev/sda blkdev=`echo $mntdev |sed -e 's/[0-9]*$//'` # /dev/sda3 -> /dev/sda
blkdev1=`basename $blkdev` # /dev/sda -> sda blkdev1=`basename $blkdev` # /dev/sda -> sda
# XXX lsblk: tmpfs: not a block device
# XXX lsblk: /dev/md: not a block device
echo "# $blkdev1: `lsblk -dn -o MODEL $blkdev` rev `lsblk -dn -o REV,SIZE $blkdev`" echo "# $blkdev1: `lsblk -dn -o MODEL $blkdev` rev `lsblk -dn -o REV,SIZE $blkdev`"
# all NICs # all NICs
# XXX warn if ethtool is not there
find /sys/class/net -type l -not -lname '*virtual*' | \ find /sys/class/net -type l -not -lname '*virtual*' | \
while read nic; do while read nic; do
nicname=`basename $nic` # /sys/class/net/eth0 -> eth0 nicname=`basename $nic` # /sys/class/net/eth0 -> eth0
...@@ -623,6 +627,8 @@ system_info() { ...@@ -623,6 +627,8 @@ system_info() {
s+=", gro_flush_timeout=`python -c "print '%.3f' % ($tgroflush_ns / 1E3)"`µs" s+=", gro_flush_timeout=`python -c "print '%.3f' % ($tgroflush_ns / 1E3)"`µs"
echo "$s" echo "$s"
# XXX warn if gro_flush_timeout=0 ?
# emit NIC warnings # emit NIC warnings
for warn in "${nicwarnv[@]}"; do for warn in "${nicwarnv[@]}"; do
...@@ -871,6 +877,15 @@ cmd_bench-cluster() { ...@@ -871,6 +877,15 @@ cmd_bench-cluster() {
on $url "sudo -n ping -i0 -w3 -s ${size} -q \$(echo \${SSH_CONNECTION%% *}) || echo \\\"# skipped -> enable ping in sudo for \`whoami\`@\`hostname\`\\\"" on $url "sudo -n ping -i0 -w3 -s ${size} -q \$(echo \${SSH_CONNECTION%% *}) || echo \\\"# skipped -> enable ping in sudo for \`whoami\`@\`hostname\`\\\""
done done
# TODO
# echo 1 > /proc/sys/net/ipv4/tcp_low_latency
# netstat -s
# /sys/class/net/ethX/gro_flush_timeout
# /proc/sys/net/ipv4/tcp_limit_output_bytes
# ( https://lwn.net/Articles/507065/ "The default value of this
# limit is 128KB; it could be set lower on systems where latency is the primary concern" )
# ? tcp pacing
# net.ipv4.tcp_autocorking (f54b3111 "tcp: auto corking")
echo -e "\n*** TCP latency:" echo -e "\n*** TCP latency:"
# 1 = minimum TCP payload # 1 = minimum TCP payload
# 1460 = 1500 (Ethernet MTU) - 20 (IPv4 header !options) - 20 (TCP header !options) # 1460 = 1500 (Ethernet MTU) - 20 (IPv4 header !options) - 20 (TCP header !options)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment