
# 网关如何配置最大并发流max_concurrent_streams
1. 登录网关所在的集群任意节点执行以下命令，创建资源。 
   ```
   cat>"stream-limit-envoyfilter.yaml"<<EOF
   apiVersion: networking.istio.io/v1alpha3
   kind: EnvoyFilter
   metadata:
     name: http2-stream-limit
     namespace: istio-system
   spec:
     workloadSelector:
       labels:
         istio: ingressgateway
     configPatches:
     - applyTo: NETWORK_FILTER # http connection manager is a filter in Envoy
       match:
         context: GATEWAY
         listener:
           filterChain:
             filter:
               name: "envoy.filters.network.http_connection_manager"
       patch:
         operation: MERGE
         value:
           typed_config:
             "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager"
             http2_protocol_options:
                max_concurrent_streams: 128
   EOF
   ```
   ![](https://support.huaweicloud.com/asm_faq/public_sys-resources/note_3.0-zh-cn.png)
   max_concurrent_streams即控制网关最大并发流参数，您可以根据需要进行配置。
   
   
2. 执行**kubectl apply -f stream-limit-envoyfilter.yaml** 创建envoyfilter。
   
   ![](https://support.huaweicloud.com/asm_faq/zh-cn_image_0000001741647566.png)
   
   
 
