Merge pull request #16771 from gustavotrott/improve_ws_limit_conn

refactor (nginx): Set limit_conn only for location /html5client/sockjs
This commit is contained in:
Anton Georgiev 2023-02-23 14:15:47 -05:00 committed by GitHub
commit 21a4da47d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 2 deletions

View File

@ -130,7 +130,7 @@ if [ -d /var/mediasoup/screenshare ]; then
fi
sed -i 's/worker_connections 768/worker_connections 4000/g' /etc/nginx/nginx.conf
echo 'limit_conn_zone $uri zone=ws_zone:5m;' > /etc/nginx/conf.d/html5-conn-limit.conf
if grep -q "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

View File

@ -8,6 +8,11 @@ if [ ! -L /etc/nginx/sites-enabled/bigbluebutton ]; then
ln -s /etc/nginx/sites-available/bigbluebutton /etc/nginx/sites-enabled/bigbluebutton
fi
# This config file was renamed, remove from old path if exists
if [ -f /etc/nginx/conf.d/html5-conn-limit.conf ]; then
rm -r /etc/nginx/conf.d/html5-conn-limit.conf
fi
cd /usr/share/meteor
# meteor code should be owned by root, config file by meteor user

View File

@ -0,0 +1 @@
limit_conn_zone $uri zone=ws_zone:5m;

View File

@ -4,7 +4,6 @@ location @html5client {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
limit_conn ws_zone 3;
}
location /html5client/locales {
@ -45,3 +44,8 @@ location /html5client {
alias /usr/share/meteor/bundle/programs/web.browser;
try_files $uri @html5client;
}
location /html5client/sockjs {
try_files $uri @html5client;
limit_conn ws_zone 3;
}

View File

@ -26,6 +26,7 @@ cp bbb-html5.nginx staging/usr/share/bigbluebutton/nginx
mkdir -p staging/etc/nginx/conf.d
cp bbb-html5-loadbalancer.conf staging/etc/nginx/conf.d
cp bbb-html5-conn-limit.conf staging/etc/nginx/conf.d
mkdir -p staging/etc/systemd/system