luci ssr plus: add multithreading cpu banlance for UDP relay

This commit is contained in:
coolsnowwolf 2018-12-19 17:48:40 +08:00
parent a7aa94748f
commit ad54ad2919
2 changed files with 5 additions and 4 deletions

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=1
PKG_RELEASE:=71
PKG_RELEASE:=72
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \

View File

@ -325,9 +325,10 @@ start_redir() {
gen_config_file $UDP_RELAY_SERVER 1
last_config_file=$CONFIG_UDP_FILE
pid_file="/var/run/ssr-reudp.pid"
$ucmd \
-c $last_config_file $ARG_OTA -U \
-f $pid_file >/dev/null 2>&1
for i in $(seq 1 $threads)
do
$ucmd -c $last_config_file $ARG_OTA -U -f $pid_file >/dev/null 2>&1
done
elif [ "$utype" == "v2ray" ] ; then
lua /usr/share/shadowsocksr/genv2config.lua $UDP_RELAY_SERVER udp $(uci_get_by_name $UDP_RELAY_SERVER local_port) > /var/etc/v2-ssr-reudp.json
$ucmd -config /var/etc/v2-ssr-reudp.json >/dev/null 2>&1 &