Merge pull request #13575 from antobinary/worker_rlimit_nofile
build: Set worker_rlimit_nofile only once in nginx.conf
This commit is contained in:
commit
473bb7bd41
@ -124,7 +124,12 @@ fi
|
||||
|
||||
sed -i 's/worker_connections 768/worker_connections 4000/g' /etc/nginx/nginx.conf
|
||||
|
||||
if ! grep "worker_rlimit_nofile 10000;" /etc/nginx/nginx.conf; then
|
||||
if grep "worker_rlimit_nofile" /etc/nginx/nginx.conf; then
|
||||
num=$(grep worker_rlimit_nofile /etc/nginx/nginx.conf | grep -o '[0-9]*')
|
||||
if [[ "$num" -lt 10000 ]]; then
|
||||
sed -i 's/worker_rlimit_nofile [0-9 ]*;/worker_rlimit_nofile 10000;/g' /etc/nginx/nginx.conf
|
||||
fi
|
||||
else
|
||||
sed -i 's/events {/worker_rlimit_nofile 10000;\n\nevents {/g' /etc/nginx/nginx.conf
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user