Commit 3aced03
committed
Raise default HTTP/2 receive windows
Default connection receive window is now 16 MB (was 65_535), sent via
a WINDOW_UPDATE on stream 0 as part of the connection preface. Default
stream receive window is now 4 MB (was 65_535), advertised via
SETTINGS_INITIAL_WINDOW_SIZE in the same preface. Both settable via
the new `:connection_window_size` option and the existing
`:client_settings` option.
Window size / RTT sets a hard cap on per-stream throughput. At the
previous 65_535-byte stream window:
Path (typical RTT) | 65 KB | 4 MB | 16 MB
-------------------------|----------|----------|----------
LAN (1 ms) | 62 MB/s | 4 GB/s | 16 GB/s
Region (20 ms) | 3.1 MB/s | 200 MB/s | 800 MB/s
Cross-country (70 ms) | 0.9 MB/s | 57 MB/s | 229 MB/s
Transatlantic (100 ms) | 0.6 MB/s | 40 MB/s | 160 MB/s
Transpacific (130 ms) | 0.5 MB/s | 31 MB/s | 123 MB/s
Antipodal (230 ms) | 0.3 MB/s | 17 MB/s | 70 MB/s
Any caller talking to a server more than a few milliseconds away was
bottlenecked well below their link bandwidth without knowing why. 4 MB
per stream saturates gigabit anywhere on earth; 16 MB at the connection
level lets four streams run in parallel at full rate before the shared
pool binds.
Callers who want the old behaviour can pass `connection_window_size:
65_535` and `client_settings: [initial_window_size: 65_535]` to
`connect/4`.1 parent 26759f2 commit 3aced03
4 files changed
Lines changed: 105 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
241 | 246 | | |
242 | 247 | | |
243 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
188 | 191 | | |
189 | 192 | | |
190 | 193 | | |
| |||
216 | 219 | | |
217 | 220 | | |
218 | 221 | | |
219 | | - | |
| 222 | + | |
220 | 223 | | |
221 | 224 | | |
222 | 225 | | |
| |||
1101 | 1104 | | |
1102 | 1105 | | |
1103 | 1106 | | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
1104 | 1113 | | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1105 | 1118 | | |
1106 | 1119 | | |
1107 | 1120 | | |
| |||
1130 | 1143 | | |
1131 | 1144 | | |
1132 | 1145 | | |
1133 | | - | |
| 1146 | + | |
| 1147 | + | |
1134 | 1148 | | |
1135 | 1149 | | |
| 1150 | + | |
| 1151 | + | |
1136 | 1152 | | |
1137 | | - | |
1138 | | - | |
1139 | 1153 | | |
1140 | 1154 | | |
1141 | 1155 | | |
| |||
1148 | 1162 | | |
1149 | 1163 | | |
1150 | 1164 | | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
1151 | 1185 | | |
1152 | 1186 | | |
1153 | 1187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
| |||
1865 | 1867 | | |
1866 | 1868 | | |
1867 | 1869 | | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
1868 | 1915 | | |
1869 | 1916 | | |
1870 | 1917 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
152 | 160 | | |
153 | 161 | | |
0 commit comments