直接export即可
cd $install_path
ulimit -c unlimited -S
export PATH=$PATH:/usr/local/sbin:/usr/local/bin
export GOTRACEBACK=crash
export SENTRY_DSN=http://1112802786904e13a5607325882bba46@sentry.woa.com/3370
export SENTRY_ENVIRONMENT=formal
export SENTRY_RELEASE=`cat ./bin/version.git`
export GODEBUG="madvdontneed=1"
# 设置使用的 CPU 最大数量
cpu_count=$(grep -c ^processor /proc/cpuinfo)
max_procs=$(( ${cpu_count#0}*80/100 ))
export GOMAXPROCS=$max_procs
export GOGC=50
env=`cat ../env | grep -o "[^ ]\+\( \+[^ ]\+\)*"`
get_conf() {
conf="./conf/trpc_go_${env}.yaml"
echo "Using conf: $conf" >&2
echo $conf
}
./bin/admasterstrategy --conf $(get_conf) 1>> /dev/null 2>> ./log/stderr.log &
逃逸分析
https://www.jianshu.com/p/ab2a5519c88e
里面有逃逸分析的命令行。