Skip to content

Commit

Permalink
feat: customize nginx timeout config
Browse files Browse the repository at this point in the history
  • Loading branch information
Jia Xu committed Aug 1, 2024
1 parent 0c84f99 commit df7ede6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion charts/apisix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ The command removes all the Kubernetes components associated with the chart and
| apisix.nginx.customLuaSharedDicts | list | `[]` | Add custom [lua_shared_dict](https://github.com/openresty/lua-nginx-module#toc88) settings, click [here](https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/values.yaml#L27-L30) to learn the format of a shared dict |
| apisix.nginx.enableCPUAffinity | bool | `true` | |
| apisix.nginx.envs | list | `[]` | |
| apisix.nginx.keepaliveTimeout | string | `"60s"` | Timeout during which a keep-alive client connection will stay open on the server side. |
| apisix.nginx.keepaliveTimeout | string | `60s` | Timeout during which a keep-alive client connection will stay open on the server side. |
| apisix.nginx.clientHeaderTimeout | string | `60s` | Timeout for reading client request header, then 408 (Request Time-out) error is returned to the client. |
| apisix.nginx.clientBodyTimeout | string | `60s` | Timeout for reading client request body, then 408 (Request Time-out) error is returned to the client. |
| apisix.nginx.sendTimeout | string | `10s` | Timeout for transmitting a response to the client, then the connection is closed. |
| apisix.nginx.logs.accessLog | string | `"/dev/stdout"` | Access log path |
| apisix.nginx.logs.accessLogFormat | string | `"$remote_addr - $remote_user [$time_local] $http_host \\\"$request\\\" $status $body_bytes_sent $request_time \\\"$http_referer\\\" \\\"$http_user_agent\\\" $upstream_addr $upstream_status $upstream_response_time \\\"$upstream_scheme://$upstream_host$upstream_uri\\\""` | Access log format |
| apisix.nginx.logs.accessLogFormatEscape | string | `"default"` | Allows setting json or default characters escaping in variables |
Expand Down
5 changes: 4 additions & 1 deletion charts/apisix/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ data:
access_log_format: '{{ .Values.apisix.nginx.logs.accessLogFormat }}'
access_log_format_escape: {{ .Values.apisix.nginx.logs.accessLogFormatEscape }}
{{- end }}
keepalive_timeout: {{ .Values.apisix.nginx.keepaliveTimeout | quote }}
keepalive_timeout: {{ .Values.apisix.nginx.keepaliveTimeout }} # timeout during which a keep-alive client connection will stay open on the server side.
client_header_timeout: {{ .Values.apisix.nginx.clientHeaderTimeout }} # timeout for reading client request header, then 408 (Request Time-out) error is returned to the client
client_body_timeout: {{ .Values.apisix.nginx.clientBodyTimeout }} # timeout for reading client request body, then 408 (Request Time-out) error is returned to the client
send_timeout: {{ .Values.apisix.nginx.sendTimeout }} # timeout for transmitting a response to the client, then the connection is closed
client_header_timeout: 60s # timeout for reading client request header, then 408 (Request Time-out) error is returned to the client
client_body_timeout: 60s # timeout for reading client request body, then 408 (Request Time-out) error is returned to the client
send_timeout: 10s # timeout for transmitting a response to the client.then the connection is closed
Expand Down
6 changes: 6 additions & 0 deletions charts/apisix/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,12 @@ apisix:
enableCPUAffinity: true
# -- Timeout during which a keep-alive client connection will stay open on the server side.
keepaliveTimeout: 60s
# -- Timeout for reading client request header, then 408 (Request Time-out) error is returned to the client.
clientHeaderTimeout: 60s
# -- Timeout for reading client request body, then 408 (Request Time-out) error is returned to the client.
clientBodyTimeout: 60s
# -- Timeout for transmitting a response to the client, then the connection is closed.
sendTimeout: 10s
envs: []
# access log and error log configuration
logs:
Expand Down

0 comments on commit df7ede6

Please sign in to comment.