3 ms·
a client making N concurrent HTTP requests to a specific server should not require N discrete connections between the client and the server, it should be able t
by preseinger 4y ago
a client making N concurrent HTTP requests to a specific server should not require N discrete connections between the client and the server, it should be able to make those requests over a single connection
request-per-connection is a nice, simple, but ultimately naïve model for network communication
- mgaunard 4y ago"discrete"? Do you even understand how these networking protocols work? All a connection is doing is managing the state of a given byte stream, keeping track of how much was sent on one end and received on the other end. All the packets for all connections go through the same pipes and are even routed the same. The TCP stack sees an IP packet coming in, and in its IP and TCP headers it sees it's from IP:port, so it maps it to the state it is maintaining for that source. HTTP/3 is using UDP, which is inherently connectionless, but is implementing its own logic of multiple streams/connections. It is not doing anything sensibly different.
- preseinger 4y ago> All a connection is doing is managing the state of a given byte stream, keeping track of how much was sent on one end and received on the other end. All the packets for all connections go through the same pipes and are even routed the same. The TCP stack sees an IP packet coming in, and in its IP and TCP headers it sees it's from IP:port, so it maps it to the state it is maintaining for that source. "the state it is maintaining for that source" is the "discrete" thing I'm referring to creating that state requires at least one network round-trip to the remote, and incurs non-negligible costs on the local machine in the application, network, system, and kernel layers those costs define a per-connection overhead which are almost immediately the main performance bottleneck in systems that do connection-per-request those costs amortize to zero if you multiplex requests over a single connection