From a520c179b89610248ef97f614d6b831ccee54c6b Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 12 Oct 2017 15:02:09 +0200 Subject: HTTP/2 protocol handler: tweak receive window sizes We were using the default ones, provided by RFC7540. It appears they are way too restrictive and conservative: when downloading something relatively big, a stream keeps spending the whole session/its own 'recv' windows and thus we have to constantly send WINDOW_UPDATE frames. This significantly slows down our HTTP/2 implementation, making it orders of magnitude slower than HTTP/1.1. To fix this: - We send SETTINGS_INITIAL_WINDOW_SIZE in the first SETTINGS frame to inform our peer that per-stream WINDOW is bigger than 64Kb - We increase the session's receive window size. Task-number: QTBUG-63722 Change-Id: I31312fcfd5f0fc0aee6aaa5d3562cc7d1b931adc Reviewed-by: Edward Welbourne --- src/network/access/http2/http2protocol.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/network/access/http2/http2protocol.cpp') diff --git a/src/network/access/http2/http2protocol.cpp b/src/network/access/http2/http2protocol.cpp index 54811aeab0..bb3d6bf575 100644 --- a/src/network/access/http2/http2protocol.cpp +++ b/src/network/access/http2/http2protocol.cpp @@ -216,6 +216,8 @@ Frame default_SETTINGS_frame() // MAX frame size (16 kb), disable/enable PUSH_PROMISE builder.append(Settings::MAX_FRAME_SIZE_ID); builder.append(quint32(maxFrameSize)); + builder.append(Settings::INITIAL_WINDOW_SIZE_ID); + builder.append(initialStreamReceiveWindowSize); builder.append(Settings::ENABLE_PUSH_ID); builder.append(quint32(is_PUSH_PROMISE_enabled())); -- cgit v1.2.3