mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
DoH: change how the active streams number is calculated
This commit changes the way how the number of active HTTP streams is calculated and allows it to scale with the values of the maximum amount of streams per connection, instead of effectively capping at STREAM_CLIENTS_PER_CONN. The original limit, which is intended to define the pipelining limit for TCP/DoT. However, it appeared to be too restrictive for DoH, as it works quite differently and implements pipelining at protocol level by the means of multiplexing multiple streams. That renders each stream to be effectively a separate connection from the point of view of the rest of the codebase.
This commit is contained in:
parent
05e8a50818
commit
a22bc2d7d4
@ -1539,9 +1539,21 @@ nothing_to_send:
|
||||
static inline bool
|
||||
http_too_many_active_streams(isc_nm_http_session_t *session) {
|
||||
const uint64_t active_streams = session->received - session->processed;
|
||||
/*
|
||||
* The motivation behind capping the maximum active streams number
|
||||
* to a third of maximum streams is to allow the value to scale
|
||||
* with the max number of streams.
|
||||
*
|
||||
* We do not want to have too many active streams at once as every
|
||||
* stream is processed as a separate virtual connection by the
|
||||
* higher level code. If a client sends a bulk of requests without
|
||||
* waiting for the previous ones to complete we might want to
|
||||
* throttle it as it might be not a friend knocking at the
|
||||
* door. We already have some job to do for it.
|
||||
*/
|
||||
const uint64_t max_active_streams =
|
||||
ISC_MIN(ISC_NETMGR_MAX_STREAM_CLIENTS_PER_CONN,
|
||||
session->max_concurrent_streams);
|
||||
ISC_MAX(ISC_NETMGR_MAX_STREAM_CLIENTS_PER_CONN,
|
||||
session->max_concurrent_streams / 3);
|
||||
|
||||
if (session->client) {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user