From 19091145f3c10bb7748f3902f31c9f1d5ee28ae6 Mon Sep 17 00:00:00 2001 From: stubenhuang Date: Thu, 23 Nov 2023 11:23:27 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=BD=91?= =?UTF-8?q?=E5=85=B3=E5=86=85=E6=A0=B8=E5=8F=82=E6=95=B0=20#9706?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helm-charts/core/ci/templates/gateway/deployment.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helm-charts/core/ci/templates/gateway/deployment.yaml b/helm-charts/core/ci/templates/gateway/deployment.yaml index 208bfc6c647..a1af226c687 100644 --- a/helm-charts/core/ci/templates/gateway/deployment.yaml +++ b/helm-charts/core/ci/templates/gateway/deployment.yaml @@ -53,6 +53,8 @@ spec: initContainers: - name: frontend image: {{ include "bkci-frontend.image" . }} + securityContext: + privileged: true volumeMounts: - mountPath: /tmp/frontend name: frontend @@ -61,6 +63,8 @@ spec: - "-c" - | cp -r /data/workspace/frontend/* /tmp/frontend/ + sysctl -w net.core.somaxconn=65535 + sysctl -w net.ipv4.ip_local_port_range="1024 65535" containers: - name: gateway image: {{ include "bkci-gateway.image" . }} From c2822bc3391176fe21c272b418e0f3eb8367a15e Mon Sep 17 00:00:00 2001 From: stubenhuang Date: Fri, 24 Nov 2023 15:31:21 +0800 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=BD=91?= =?UTF-8?q?=E5=85=B3=E5=86=85=E6=A0=B8=E5=8F=82=E6=95=B0=20#9706?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helm-charts/core/ci/templates/gateway/deployment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/helm-charts/core/ci/templates/gateway/deployment.yaml b/helm-charts/core/ci/templates/gateway/deployment.yaml index a1af226c687..ee50bd1ace1 100644 --- a/helm-charts/core/ci/templates/gateway/deployment.yaml +++ b/helm-charts/core/ci/templates/gateway/deployment.yaml @@ -65,6 +65,7 @@ spec: cp -r /data/workspace/frontend/* /tmp/frontend/ sysctl -w net.core.somaxconn=65535 sysctl -w net.ipv4.ip_local_port_range="1024 65535" + sysctl -w net.ipv4.tcp_tw_reuse=0 containers: - name: gateway image: {{ include "bkci-gateway.image" . }} From 24742cb9156098450cce0cd39ab0616ccf43a39f Mon Sep 17 00:00:00 2001 From: stubenhuang Date: Thu, 30 Nov 2023 17:34:22 +0800 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=BD=91?= =?UTF-8?q?=E5=85=B3=E5=86=85=E6=A0=B8=E5=8F=82=E6=95=B0=20#9706?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gateway/core/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gateway/core/nginx.conf b/src/gateway/core/nginx.conf index 00918b6bd12..290feba7850 100644 --- a/src/gateway/core/nginx.conf +++ b/src/gateway/core/nginx.conf @@ -1,5 +1,5 @@ # 线上生产环境请一定要修改此参数,OpenResty绑定的nginx版本低于1.2以下时,不支持此参数设置为auto -worker_processes 12; +worker_processes 8; events { # 线上生产环境请一定要修改此参数,在用作网关(反向代理)服务器时,支持的最大连接数=worker_processes*worker_connections/4(一个浏览器两个连接,对内对外乘以4) From 77aa9d3119742c5c0b3b8705b02d41d40d583e97 Mon Sep 17 00:00:00 2001 From: stubenhuang Date: Fri, 1 Dec 2023 14:49:29 +0800 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=BD=91?= =?UTF-8?q?=E5=85=B3=E5=86=85=E6=A0=B8=E5=8F=82=E6=95=B0=20#9706?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helm-charts/core/ci/templates/gateway/deployment.yaml | 3 +-- src/gateway/core/nginx.conf | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/helm-charts/core/ci/templates/gateway/deployment.yaml b/helm-charts/core/ci/templates/gateway/deployment.yaml index ee50bd1ace1..2673ee52682 100644 --- a/helm-charts/core/ci/templates/gateway/deployment.yaml +++ b/helm-charts/core/ci/templates/gateway/deployment.yaml @@ -63,9 +63,8 @@ spec: - "-c" - | cp -r /data/workspace/frontend/* /tmp/frontend/ - sysctl -w net.core.somaxconn=65535 - sysctl -w net.ipv4.ip_local_port_range="1024 65535" sysctl -w net.ipv4.tcp_tw_reuse=0 + sysctl -w net.ipv4.tcp_max_tw_buckets = 16384 containers: - name: gateway image: {{ include "bkci-gateway.image" . }} diff --git a/src/gateway/core/nginx.conf b/src/gateway/core/nginx.conf index 290feba7850..0a02fb6a4ca 100644 --- a/src/gateway/core/nginx.conf +++ b/src/gateway/core/nginx.conf @@ -1,14 +1,15 @@ # 线上生产环境请一定要修改此参数,OpenResty绑定的nginx版本低于1.2以下时,不支持此参数设置为auto worker_processes 8; +worker_cpu_affinity auto; events { # 线上生产环境请一定要修改此参数,在用作网关(反向代理)服务器时,支持的最大连接数=worker_processes*worker_connections/4(一个浏览器两个连接,对内对外乘以4) - worker_connections 10240; + worker_connections 20000; } pid run/nginx.pid; # 大于worker_processes*worker_connections 10240*(12+4); -worker_rlimit_nofile 163840; +worker_rlimit_nofile 241000; # 优雅停机, 最多等待30秒 worker_shutdown_timeout 30; @@ -19,7 +20,7 @@ http { charset utf-8; sendfile on; - keepalive_timeout 65; + keepalive_timeout 60; gzip on; gzip_types text/plain text/css application/x-javascript application/javascript application/xml; From 0247185fdf6f1fc52290991b53016755fe978b22 Mon Sep 17 00:00:00 2001 From: stubenhuang Date: Fri, 1 Dec 2023 15:35:59 +0800 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=BD=91?= =?UTF-8?q?=E5=85=B3=E5=86=85=E6=A0=B8=E5=8F=82=E6=95=B0=20#9706?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helm-charts/core/ci/templates/gateway/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-charts/core/ci/templates/gateway/deployment.yaml b/helm-charts/core/ci/templates/gateway/deployment.yaml index 2673ee52682..f1617fa095b 100644 --- a/helm-charts/core/ci/templates/gateway/deployment.yaml +++ b/helm-charts/core/ci/templates/gateway/deployment.yaml @@ -64,7 +64,7 @@ spec: - | cp -r /data/workspace/frontend/* /tmp/frontend/ sysctl -w net.ipv4.tcp_tw_reuse=0 - sysctl -w net.ipv4.tcp_max_tw_buckets = 16384 + sysctl -w net.ipv4.tcp_max_tw_buckets=16384 containers: - name: gateway image: {{ include "bkci-gateway.image" . }} From 654038a0ea3478db110cae112c9509ac322b3304 Mon Sep 17 00:00:00 2001 From: stubenhuang Date: Mon, 4 Dec 2023 09:46:21 +0800 Subject: [PATCH 6/6] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=BD=91?= =?UTF-8?q?=E5=85=B3=E5=86=85=E6=A0=B8=E5=8F=82=E6=95=B0=20#9706?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gateway/core/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gateway/core/nginx.conf b/src/gateway/core/nginx.conf index 0a02fb6a4ca..b1b6c791374 100644 --- a/src/gateway/core/nginx.conf +++ b/src/gateway/core/nginx.conf @@ -4,12 +4,12 @@ worker_cpu_affinity auto; events { # 线上生产环境请一定要修改此参数,在用作网关(反向代理)服务器时,支持的最大连接数=worker_processes*worker_connections/4(一个浏览器两个连接,对内对外乘以4) - worker_connections 20000; + worker_connections 10240; } pid run/nginx.pid; # 大于worker_processes*worker_connections 10240*(12+4); -worker_rlimit_nofile 241000; +worker_rlimit_nofile 163840; # 优雅停机, 最多等待30秒 worker_shutdown_timeout 30;