Proper configurations of the cloud-native API gateway engine can improve network performance, reliability, and security, ensuring stable operation and user experience. This article introduces how to adjust parameters and provides detailed information on each one.
Prerequisites
Steps
To ensure instance stability, only the parameters displayed in the console can be modified.
Before modifying a parameter value, refer to its valid range 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 navigation pane on the left, choose Parameter Settings. In the Gateway Engine Parameters section, find the target parameter and click Edit in the Actions column. Set the parameter value according to the following table and click OK.
Gateway engine parameter description
Parameter | Type | Valid range | Default value | Description |
EnableHttp2 | bool | [true, false] | false | Applies to the request phase. Specifies whether to use HTTP/2 when the server and client negotiate the protocol.
|
EnableGenerateRequestId | bool | [true, false] | true | Applies to the request scope. If enabled, the gateway generates a request ID (X-Request-Id) in the request header to uniquely identify the request.
|
EnableGzip | bool | [true, false] | false | Applies to the response phases.
|
EnableGzipHardwareAccelerate | bool | [true, false] | false | Performs Gzip compression based on dedicated hardware. If enabled, responses are compressed, which significantly reduces gateway traffic. This method provides higher performance and lower CPU consumption than software-based Gzip compression.
Important
|
EnableSlashMerge | bool | [true, false] | false | Applies to the request phase. Specifies whether to merge consecutive slashes (
|
DownstreamIdleTime | integer | [0, 600] | 300 | Applies to gateway connections. If no requests are sent from a client to the gateway within the specified period, the connection is closed. Unit: seconds. |
PreserveHeaderFormat | bool | [true, false] | false | Applies to the request and response phases. According to the HTTP/1.1 specification, header names are case-insensitive. To ensure compatibility with the HTTP/2 specification, header names are converted to lowercase by default.
|
DownstreamConnectionBufferLimits | integer | [0, 2147483647] | 32768 | Applies to gateway connections. Controls the buffer size for a single connection. This setting affects throughput and the memory usage of the gateway. Unit: bytes. |
EnableHardwareAccelerate | bool | [true, false] | true | Applies to TLS encryption and decryption. Specifies whether to enable hardware acceleration. This parameter does not take effect if your region does not support hardware acceleration or if you did not enable it when you purchased the instance.
Note Due to hardware limitations, hardware acceleration is supported only in the China (Beijing), China (Hangzhou), China (Shanghai), China (Shenzhen), and Asia Pacific SE 1 (Singapore) regions. |
XffTrustedNum | integer | [0, 10] | 0 | Applies to the request phase and specifies the number of trusted proxies located before the gateway. It affects whether the gateway will use client-generated request headers such as x-forwarded-for and x-request-id If the value is 0, the gateway uses the peer socket IP address as the originating IP address and passes it to the backend in the `x-envoy-external-address` request header. If the value is not 0, the gateway determines the originating IP address from the `x-forwarded-for` header, which already includes the socket IP address. The gateway skips the specified number of hops from right to left and then extracts the originating IP address. This IP address is then passed to the backend in the `x-envoy-external-address` request header. The gateway also preserves the client-sent `x-request-id` and `x-forwarded-proto` headers without modification. |
DownstreamHttp2MaxConcurrentStream | integer | [0, 2147483647] | 100 | Applies to the request phase. The maximum number of concurrent streams on a single connection when a client uses HTTP/2. |
InitialStreamWindowSize | integer | [65535, 2147483647] | 65535 | Applies to the request phase. The initial stream window size negotiated between the gateway and the client when using HTTP/2. Unit: byte. |
InitialConnectionWindowSize | integer | [0, 2147483647] | 1048576 | Applies to the request phase. The initial connection-level window size when the gateway and client use HTTP/2. Unit: byte. |
EnableHttp3 | bool | [true, false] | false | Applies to the request phase. Specifies whether the downstream client and the gateway use HTTP/3 or not.
|
UpstreamIdleTimeout | int | [0, 600] | 30 | Applies to gateway connections. If no requests are sent from the gateway to the upstream service within the specified period, the connection is closed. Unit: seconds. |
PathWithEscapedSlashes | string |
| KEEP_UNCHANGED | The forwarding rule for requests whose Uniform Resource Identifier (URI) path contains escape characters such as %2F, %2f, %5C, or %5c.
|
ZipAlgorithm | List<string> | [brotli, gzip] | gzip | The algorithm to use after compression is enabled. You can select brotli or gzip. If you specify both gzip and brotli, and their q-values in the `Accept-Encoding` header are the same, the algorithm that appears first in the list is used. |
EnableProxyProtocol | bool | [true, false] | false | Enables the Proxy protocol. If the ingress traffic of the gateway is routed through a Network Load Balancer (NLB), you must enable this feature to obtain the originating IP address of the client. Enabling this feature does not affect requests that do not use the Proxy protocol. |
EnableCustomAuthConfigPush | bool | [true, false] | false | Applies to scenarios where a self-managed authentication service is used. If enabled, changes to authentication rules do not cause connection interruptions. This is suitable for WebSocket and online business scenarios. |