Repository navigation
HTTPS highwatermark not working #33262
Description
Activity
Ok, I will create a new pr associated with this issue.
Reacted by Alex Yang and Andrei PechkurovI found out that
http.requestalso receives chunks of data of a fixed 64KB size. I'm looking for what went wrong.Unfortunately, the
readableHighWaterMarkparameter may not be supported. The readableHighWaterMark parameter is not supported in http.request and https.requestaucchhh. I will look the proposal of that issue. Anyway, there is an inconsistency between maximun 64Kb buffer in HTTP vs 16KB in HTTPS, isnt it?
That 16k is the TLS record size, its size is fixed by the protocol.
I don't think
readableHighWaterMarkcan be made meaningful for TLS/HTTPS because that 16k will still be sitting in a buffer somewhere.Reacted by Andrei PechkurovAFAIK it is possible to reduce the maximum record size below 16kb but not to increase it. We should likely document that.
- addeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
on May 8, 2020 Yes and no. That 16k is the maximum record size. It can be up to 18k after decompression actually but node doesn't use compression.
There's a
max_fragment_lengthTLS extension that allows negotiating a smaller maximum record size but it has Issues and node never uses it. Practically speaking, the record size is 16k1 - that's what peers can send and that's what node accepts.Peers can of course send smaller records but there's no way to enforce that. It'd be a protocol violation.
1 16k + 5 in fact
Reacted by Alex Yang and Andrei Pechkurov- addedhttpsIssues and PRs related to the https subsystem.Issues and PRs related to the https subsystem.
on May 10, 2020 Considering what's written above, shouldn't we revert 58682d8 or, at least, document the 16KB upper limit?
@puzpuzpuz Reverting and documenting why it's not supported sounds good to me.
Reacted by Andrei Pechkurov and Ruben Bridgewater@bnoordhuis @BridgeAR
I've created the revert PR: #33387. It also includes a short note intlsdocs.Is there a use case for setting a highWatermark of less than 16K and if there is should that be supported?
Reacted by Anna HenningsenAlso, can someone explain why TLS having a record size of 16K means the highWatermark can at most be 16K?
I would naively expect if anything for it to have to be at least 16K since that's the amount required to understand a single record. I have this backwards right?
Reacted by Anna HenningsenThis should have been fixed by b51d1cf. I guess this should be closed?
@benjamingr that seems independent from this issue to me?
I don't think there's anything left to do, all the linked issues and pull requests have been closed.
What steps will reproduce the bug?
In #32781 was fixed that highWatermark was not established in https streams when we passed that option. But after some tests it is still receiving chunks of data of a fixed 16KB size.
Downloading a file from a LAN Server via HTTP with an increased hightwatermark we can see this progress (chunks of ~65kbs)
Downloading the same file, from the same LAN Server via HTTPS we are still receiving chunks of 16KB even traces of the response readadableHighWaterMark are established to 128KB, so it seems there is something that is not propagating well.
How often does it reproduce? Is there a required condition?
Always
Additional information
Attached goes a js what Im using to do those tests.
downloadfile.test.js.txt