Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change: disable reuseport in development mode, it more easy to manage worker process. #1175

Merged
merged 4 commits into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .travis/apisix_cli_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

set -ex

git checkout conf/config.yaml

# check whether the 'reuseport' is in nginx.conf .
make init

Expand Down Expand Up @@ -73,6 +75,25 @@ done
sed -i '/dns_resolver:/,+4s/^#//' conf/config.yaml
echo "passed: system nameserver imported"

# enable enable_dev_mode
sed -i 's/enable_dev_mode: false/enable_dev_mode: true/g' conf/config.yaml

make init

count=`grep -c "worker_processes 1;" conf/nginx.conf`
if [ $count -ne 1 ]; then
echo "failed: worker_processes is not 1 when enable enable_dev_mode"
exit 1
fi

count=`grep -c "listen 9080.*reuseport" conf/nginx.conf || true`
if [ $count -ne 0 ]; then
echo "failed: reuseport should be disabled when enable enable_dev_mode"
exit 1
fi

git checkout conf/config.yaml

# check whether the 'worker_cpu_affinity' is in nginx.conf .

make init
Expand Down
1 change: 1 addition & 0 deletions bin/apisix
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ local function init()

if(sys_conf["enable_dev_mode"] == true) then
sys_conf["worker_processes"] = 1
sys_conf["enable_reuseport"] = false
else
sys_conf["worker_processes"] = "auto"
end
Expand Down