summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.rr.yaml4
-rw-r--r--service/http/config.go12
-rw-r--r--service/http/service.go4
3 files changed, 19 insertions, 1 deletions
diff --git a/.rr.yaml b/.rr.yaml
index 973bc03f..fa94bcff 100644
--- a/.rr.yaml
+++ b/.rr.yaml
@@ -33,6 +33,10 @@ http:
# FastCGI connection DSN. Supported TCP and Unix sockets.
address: tcp://0.0.0.0:6920
+ # HTTP service provides HTTP2 transport
+ http2:
+ maxConcurrentStreams: 128
+
# max POST request size, including file uploads in MB.
maxRequestSize: 200
diff --git a/service/http/config.go b/service/http/config.go
index 4b5950b3..caf94d98 100644
--- a/service/http/config.go
+++ b/service/http/config.go
@@ -18,6 +18,8 @@ type Config struct {
// SSL defines https server options.
SSL SSLConfig
+ HTTP2 *HTTP2Config
+
FCGI FCGIConfig
// MaxRequestSize specified max size for payload body in megabytes, set 0 to unlimited.
@@ -39,6 +41,10 @@ type FCGIConfig struct {
Address string
}
+type HTTP2Config struct {
+ MaxConcurrentStreams uint32
+}
+
// SSLConfig defines https server configuration.
type SSLConfig struct {
// Port to listen as HTTPS server, defaults to 443.
@@ -81,6 +87,12 @@ func (c *Config) Hydrate(cfg service.Config) error {
c.SSL.Port = 443
}
+ if c.HTTP2 == nil {
+ c.HTTP2 = &HTTP2Config{
+ MaxConcurrentStreams: 128,
+ }
+ }
+
c.Uploads.InitDefaults()
c.Workers.InitDefaults()
diff --git a/service/http/service.go b/service/http/service.go
index b309cd45..8e0d10ee 100644
--- a/service/http/service.go
+++ b/service/http/service.go
@@ -210,7 +210,9 @@ func (s *Service) initSSL() *http.Server {
s.throw(EventInitSSL, server)
// Enable HTTP/2 support by default
- http2.ConfigureServer(server, &http2.Server{})
+ http2.ConfigureServer(server, &http2.Server{
+ MaxConcurrentStreams: s.cfg.HTTP2.MaxConcurrentStreams,
+ })
return server
}