From 1a725d24cefb0b08d3709c6df1137261bc80a504 Mon Sep 17 00:00:00 2001 From: luqiuwen Date: Fri, 21 Jun 2019 16:17:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0r2,r3=E5=92=8Csysctl=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E7=9A=84=E9=9B=86=E6=88=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/system/80-tfe.conf | 32 ++++++++++++++++++++++++++++++++ script/user/r2_tfe | 2 ++ script/user/r3_tfe | 20 ++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 script/system/80-tfe.conf create mode 100644 script/user/r2_tfe create mode 100644 script/user/r3_tfe diff --git a/script/system/80-tfe.conf b/script/system/80-tfe.conf new file mode 100644 index 0000000..4f59377 --- /dev/null +++ b/script/system/80-tfe.conf @@ -0,0 +1,32 @@ +# read/write buffer +net.core.rmem_default = 256960 +net.core.rmem_max = 256960 +net.core.wmem_default = 256960 +net.core.wmem_max = 256960 + +# disable rpfilter +net.ipv4.conf.all.rp_filter=0 +net.ipv4.conf.default.rp_filter=0 + +# fs +fs.file-max=1048560 +net.core.netdev_max_backlog=1000000 +net.core.somaxconn=131072 + +# tcp options about TIME_WAIT +net.ipv4.tcp_fin_timeout=10 +net.ipv4.tcp_tw_reuse=1 +net.ipv4.tcp_max_tw_buckets=4096 +net.ipv4.tcp_max_orphans=131072 +net.ipv4.tcp_max_syn_backlog=131072 + +# bbr +net.ipv4.tcp_congestion_control=bbr + +# tcp feature +net.ipv4.tcp_ecn=0 +net.ipv4.tcp_sack=1 +net.ipv4.tcp_timestamps=1 + +# disable tcp windows scaling for kernel bugs +net.ipv4.tcp_window_scaling=0 \ No newline at end of file diff --git a/script/user/r2_tfe b/script/user/r2_tfe new file mode 100644 index 0000000..41a8b4a --- /dev/null +++ b/script/user/r2_tfe @@ -0,0 +1,2 @@ +killall r3_tfe tfe +./r3_tfe &> /dev/null & diff --git a/script/user/r3_tfe b/script/user/r3_tfe new file mode 100644 index 0000000..e330038 --- /dev/null +++ b/script/user/r3_tfe @@ -0,0 +1,20 @@ +#!/bin/sh + +while [ 1 ]; do + count=`ls -l core.* |wc -l` + echo $count + if [ $count -lt 5 ] + then + echo "set unlimited" + ulimit -c unlimited + else + ulimit -c 0 + fi + + export ASAN_OPTIONS=abort_on_error=1:log_path=./asan.log + + ulimit -n 655350 + ./bin/tfe > /dev/null + echo program crashed, restart at `date +"%w %Y/%m/%d, %H:%M:%S"` >> RESTART.log + sleep 1 +done