I would like to have a HTTP2 client with a very small TCP socket read buffer. Other sockets in the system should remain with the default settings (adjusting the global tcp setting via /proc/sys/net/ipv4/tcp_rmem is not an option)
Is there a utility (such as curl) that allows adjusting the read buffer of a client?
(Big Picture: I'm testing a server and my main objecting is to fill up that server's tcp write buffer. My first approach is trying to create a client with a very small read buffer so that the server's buffer will fill up quickly. Any other approach is also welcome...)
Thanks
You don't need to tweak the low-level TCP socket read buffer of the client, in order to fill the TCP server write buffer.
What you need is to A) have the client send to the server (at connection setup) a very large HTTP/2 receive window, so that TCP flow control kicks in before HTTP/2 flow control; and B) have the server send a large content to the client and have the client not reading the content (or read very slowly 1 byte at a time every N milliseconds).
Step A) is fundamental, otherwise the default HTTP/2 flow control window (only 65535 byte) will stall the server download well before the server TCP write buffers are filled up (even with the client not reading any content).
The steps above can be performed with any sufficiently configurable HTTP/2 client.
Disclaimer, I'm the implementer of HTTP/2 in Jetty, and if you use Java you can use the Jetty HTTP/2 client and follow the steps above. An example usage of Jetty's HTTP/2 client can be seen here.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments