-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http.createServer highwatermark config #32731
Comments
What would that do? It's not at all clear to me what use that has. Please elaborate. |
We are trying to generate backpressure over the network. we would like our highwatermark to be 5kb, but this is negated since response's highwatermark is always set to 16kb. we would like to be able to decrease it. so that it can generate back pressure faster. var server = http.createServer(function (request, response) {
myReadable.pipe(response); //response's highwater marks is set to 16kb by default.
}); |
Do I understand correctly you want to be able to override var server = http.createServer(function (request, response) {
response.writableHighWaterMark = 5 * 1024;
myReadable.pipe(response);
}); |
Yes that's exactly what we would like to do. But I don't think it's possible to overwrite |
It's read-only right now but that could probably be changed if there's a good enough use case. I've updated the labels. Having requests inherit it from the |
@bnoordhuis how do we go about this? As far as I can tell both objectMode and highwatermark values for our stream are useless as long as we can't edit those values for response stream. |
You can open a pull request with your suggested change. If you're not completely sure yet what direction to take, it's okay to open it in an incomplete state as a draft, to collect feedback.
You mentioned response in your original comment. Which one is it? |
response. yea that was a typo, and I will try to get a pull request, soon. |
There are other way to create back pressure. You can pipe it through a transform stream that applies it. |
Is your feature request related to a problem? Please describe.
http.get allows you to set highwatermark values as of node 13.x. Both IncomingMessage and OutgoingMessage supports setting hwm values in config, those settings are also applied to socket. why can't we do the same for http.createServer
#30135
Describe the solution you'd like
set highwatermark and enable objectMode for response (writable).
Describe alternatives you've considered
Please describe alternative solutions or features you have considered.
The text was updated successfully, but these errors were encountered: