Thank you for developing Pingap.
Pingap already supports HTTP/2 upstream connections through the alpn upstream setting. This also allows a cleartext HTTP/2/h2c connection when the upstream does not use TLS:
[upstreams.app]
addrs = ["127.0.0.1:8080"]
alpn = "H2"
However, Pingora’s PeerOptions::max_h2_streams option does not appear to be exposed through Pingap’s upstream configuration.
Pingora defines:
/// How many concurrent h2 streams are allowed in the same connection.
pub max_h2_streams: usize,
and its current default is:
Pingap’s UpstreamConf exposes alpn, connection timeouts, idle timeout, TCP keepalive and related options. When constructing an upstream HttpPeer, Pingap assigns:
p.options.alpn = self.alpn.clone();
but does not assign p.options.max_h2_streams.
This means that an HTTP/2 or h2c upstream appears to retain Pingora’s default of one concurrent stream per connection. That prevents users from configuring practical HTTP/2 multiplexing between Pingap and an application backend.
Proposed configuration
Please consider adding an optional upstream setting:
[upstreams.app]
addrs = ["127.0.0.1:8080"]
alpn = "H2"
max_h2_streams = 100
For example, it could be represented in UpstreamConf as:
pub max_h2_streams: Option<usize>,
stored in the Pingap Upstream structure and applied when constructing the peer:
if let Some(max_h2_streams) = self.max_h2_streams {
p.options.max_h2_streams = max_h2_streams;
}
Keeping the option optional would preserve the existing Pingora default and backward compatibility.
Requested scope
- Add
max_h2_streams to UpstreamConf.
- Validate that the configured value is greater than zero.
- Store and apply it to
HttpPeer.options.max_h2_streams.
- Expose it through Pingap’s web administration interface.
- Add English and Chinese field descriptions.
- Document it in the upstream configuration examples.
- Add configuration parsing and serialization tests.
- Add a test verifying that the configured value reaches the generated
HttpPeer.
Motivation
This would be useful for:
- Axum and other h2c application backends.
- gRPC and Connect RPC services.
- Concurrent or long-lived streaming requests.
- Reducing the number of upstream TCP connections.
- Receiving the main multiplexing benefit of HTTP/2 instead of limiting every connection to one active stream.
Relevant code:
Would you consider exposing this option?
Thank you for developing Pingap.
Pingap already supports HTTP/2 upstream connections through the
alpnupstream setting. This also allows a cleartext HTTP/2/h2c connection when the upstream does not use TLS:However, Pingora’s
PeerOptions::max_h2_streamsoption does not appear to be exposed through Pingap’s upstream configuration.Pingora defines:
and its current default is:
Pingap’s
UpstreamConfexposesalpn, connection timeouts, idle timeout, TCP keepalive and related options. When constructing an upstreamHttpPeer, Pingap assigns:but does not assign
p.options.max_h2_streams.This means that an HTTP/2 or h2c upstream appears to retain Pingora’s default of one concurrent stream per connection. That prevents users from configuring practical HTTP/2 multiplexing between Pingap and an application backend.
Proposed configuration
Please consider adding an optional upstream setting:
For example, it could be represented in
UpstreamConfas:stored in the Pingap
Upstreamstructure and applied when constructing the peer:Keeping the option optional would preserve the existing Pingora default and backward compatibility.
Requested scope
max_h2_streamstoUpstreamConf.HttpPeer.options.max_h2_streams.HttpPeer.Motivation
This would be useful for:
Relevant code:
Pingap upstream configuration:
https://github.com/vicanso/pingap/blob/main/pingap-config/src/common.rs
Pingap upstream peer construction:
https://github.com/vicanso/pingap/blob/main/pingap-upstream/src/upstream.rs
Pingora
PeerOptions:https://github.com/cloudflare/pingora/blob/main/pingora-core/src/upstreams/peer.rs
Would you consider exposing this option?