Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#9709 from stubenhuang/issue-gw-9706
Browse files Browse the repository at this point in the history
feat: 优化网关内核参数 TencentBlueKing#9706
  • Loading branch information
bkci-bot authored Dec 6, 2023
2 parents ab65eb4 + 654038a commit b127d6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions helm-charts/core/ci/templates/gateway/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ spec:
initContainers:
- name: frontend
image: {{ include "bkci-frontend.image" . }}
securityContext:
privileged: true
volumeMounts:
- mountPath: /tmp/frontend
name: frontend
Expand All @@ -61,6 +63,8 @@ spec:
- "-c"
- |
cp -r /data/workspace/frontend/* /tmp/frontend/
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" . }}
Expand Down
5 changes: 3 additions & 2 deletions src/gateway/core/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 线上生产环境请一定要修改此参数,OpenResty绑定的nginx版本低于1.2以下时,不支持此参数设置为auto
worker_processes 12;
worker_processes 8;
worker_cpu_affinity auto;

events {
# 线上生产环境请一定要修改此参数,在用作网关(反向代理)服务器时,支持的最大连接数=worker_processes*worker_connections/4(一个浏览器两个连接,对内对外乘以4)
Expand All @@ -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;

Expand Down

0 comments on commit b127d6d

Please sign in to comment.