diff --git a/bin/ngxway b/bin/ngxway index a11e150..9f137a8 100755 --- a/bin/ngxway +++ b/bin/ngxway @@ -42,17 +42,14 @@ function start(){ mkdir -p $localVolumeLogsDir && chmod -R 777 $localVolumeLogsDir # Run container. - docker run --name ngxwayContainer -d -p $ngxwayAddr:8090 -v $localVolumeLogsDir:/dist/logs/ ngxway + docker run --ulimit nofile=1048576:1048576 \ + --sysctl net.ipv4.ip_local_port_range="1024 65535" \ + --name ngxwayContainer -d -p $ngxwayAddr:8090 -v $localVolumeLogsDir:/dist/logs/ ngxway if [ $? -ne 0 ]; then echo -e ">>>>>>>>Start failure: failed to run<<<<<<<<" exit 1 fi - # Exec command: adjust the system parameters. - # docker run --sysctl net.ipv4.ip_local_port_range="32768 65535" \ - # --ulimit nofile=1024000:1024000 - # docker run -d --ulimit nofile=1024000:1024000 ngxway - # Exec command: start the go server. docker exec -d ngxwayContainer /dist/bin/goserver if [ $? -ne 0 ]; then diff --git a/conf/nginx/nginx.conf b/conf/nginx/nginx.conf index d13eed1..7aa8e6e 100644 --- a/conf/nginx/nginx.conf +++ b/conf/nginx/nginx.conf @@ -19,9 +19,10 @@ # Enables the use of JIT for regular expressions to speed-up their processing. pcre_jit on; -# worker_processes auto; -worker_processes 8; -worker_cpu_affinity 000 001 010 011 100 101 110 111; +# worker_processes 8; +# worker_cpu_affinity 000 001 010 011 100 101 110 111; +worker_processes auto; +worker_cpu_affinity auto; events { worker_connections 1024; diff --git a/scripts/adjust_system_param.sh b/scripts/adjust_system_param.sh deleted file mode 100644 index cb106c4..0000000 --- a/scripts/adjust_system_param.sh +++ /dev/null @@ -1,18 +0,0 @@ -# Go back to the root directory of ngxway. -ngxwayPath=$(cd `dirname $0`; cd ..; pwd) -cd $ngxwayPath - -# Require the common shell scripts. -. $ngxwayPath/scripts/common.sh - -# Check the system, only available for Linux and Unix series. -whichSystem=$(printWhichSystem) - -# Adjust system parameters to improve the performance of ngxway. -if [ "${whichSystem}" == "Linux" ] ; then - echo $systemParamTemplate1 >> ~/.bashrc - source ~/.bashrc -else - echo $systemParamTemplate1 >> ~/.bash_profile - source ~/.bash_profile -fi