To adapt to changes in different scenarios, you can adjust the parameters of a cloud-native API gateway. Proper parameter tuning improves network performance, reliability, and security, which helps ensure stable operation and a better user experience. However, modifying gateway parameters may affect network connectivity and the applications that use the gateway. Before you modify parameters, make sure that you understand the valid range and effect of each modifiable parameter. This topic describes how to modify gateway parameters and provides parameter details.
Prerequisites
A gateway is created. For more information, see Create a cloud-native API gateway.
Steps
Only parameters that are displayed in the console can be modified. Parameters that are not displayed in the console cannot be modified. This restriction ensures stable operation of the instance.
Before you modify a parameter value, check the Value Range column on the Gateway Engine Parameters page in the console.
Log on to the API Gateway console.
In the left-side navigation pane, click . In the top navigation bar, select a region.
On the Instance page, click the target instance ID.
In the left-side navigation pane, choose Parameters. In the Gateway Engine Parameters section, find the target parameter, click Edit in the Actions column, set the parameter value as described in the following table, and then click OK.
Gateway engine parameters
Parameter Name | Parameter Type | Value Range | Default Value | Parameter Description |
EnableHttp2 | bool | [true, false] | false | Request phase. Specifies whether to use HTTP/2 during protocol negotiation.
|
EnableGenerateRequestId | bool | [true, false] | true | Request phase. When enabled, the gateway generates an X-Request-Id header to uniquely identify each request.
|
EnableGzip | bool | [true, false] | false | Request and response phases.
|
EnableGzipHardwareAccelerate | bool | [true, false] | false | Hardware-accelerated Gzip compression. Significantly reduces gateway traffic with higher performance and lower CPU usage than software-based Gzip.
Important
|
EnableSlashMerge | bool | [true, false] | false | Request phase. Specifies whether to merge consecutive slashes (
|
DownstreamIdleTime | integer | [0, 600] | 180 | Gateway connections. Closes client-to-gateway connections idle for the specified duration. Unit: seconds. |
PreserveHeaderFormat | bool | [true, false] | false | Request and response phases. By default, header names are lowercased for HTTP/2 compatibility.
|
DownstreamConnectionBufferLimits | integer | [0, 2147483647] | 32768 | Gateway connections. Controls the per-connection buffer size, affecting throughput and memory usage. Unit: bytes. |
EnableHardwareAccelerate | bool | [true, false] | true | TLS encryption and decryption. Enables hardware-accelerated TLS processing. Does not take effect if hardware acceleration is unsupported in your region or was not enabled at purchase.
Note Due to underlying hardware limitations, hardware acceleration is currently supported only in the China (Beijing), China (Hangzhou), China (Shanghai), China (Shenzhen), and Singapore regions. |
XffTrustedNum | integer | [0, 10] | 0 | Request phase. Number of trusted proxies before the gateway, affecting how client-generated headers such as x-forwarded-for and x-request-id are handled. If set to 0, the gateway uses the peer socket IP as the originating IP and passes it to the backend in the x-envoy-external-address header. If non-zero, the gateway determines the originating IP from the x-forwarded-for header by skipping the specified number of hops from right to left. This IP is passed to the backend in the x-envoy-external-address header. The gateway also preserves client-sent x-request-id and x-forwarded-proto headers. |
DownstreamHttp2MaxConcurrentStream | integer | [0, 2147483647] | 100 | Request phase. Maximum concurrent HTTP/2 streams per client connection. |
InitialStreamWindowSize | integer | [65535, 2147483647] | 65535 | Request phase. Initial HTTP/2 stream-level flow control window size. Unit: bytes. |
InitialConnectionWindowSize | integer | [0, 2147483647] | 1048576 | Request phase. Initial HTTP/2 connection-level flow control window size. Unit: bytes. |
EnableHttp3 | bool | [true, false] | false | Request phase. Specifies whether to use HTTP/3 for client-to-gateway communication.
|
UpstreamIdleTimeout | int | [0, 600] | 30 | Gateway connections. Closes gateway-to-upstream connections idle for the specified duration. Unit: seconds. |
PathWithEscapedSlashes | string |
| KEEP_UNCHANGED | Forwarding rule for requests whose URI path contains encoded slashes (%2F, %2f, %5C, or %5c).
|
ZipAlgorithm | List<string> | [brotli, gzip] | gzip | Compression algorithm. Supported values: brotli, gzip. When both are specified with equal q-values in Accept-Encoding, the first algorithm in the list takes precedence. |
EnableProxyProtocol | bool | [true, false] | false | Enables the PROXY protocol. Required when ingress traffic passes through a Network Load Balancer (NLB) to obtain the client's originating IP address. Does not affect requests that do not use the PROXY protocol. |
EnableCustomAuthConfigPush | bool | [true, false] | false | Self-managed authentication scenarios. When enabled, authentication rule changes do not interrupt existing connections. Suitable for WebSocket and online business scenarios. |