4 ms·
You are absolutely right. But if you i.e. load foo.com/ which is just 10kb of HTML, you have a very good chance that your TCP congestion window is not yet scale
by littlecranky67 4y ago
You are absolutely right. But if you i.e. load foo.com/ which is just 10kb of HTML, you have a very good chance that your TCP congestion window is not yet scaled to match your actual path bandwidth, so transferring foo.com/static.js might take longer than from a CDN or a "hot" tcp connection. On the other hand, if you load too many ressources from either foo.com or mycdn.com, you might hit the TCP multiplexing limits (6 TCP connections in browsers) and stall loading. Equally distributing resources across foo.com and mycdn.com will give you 2x6 TCP connections, so a stall is less likely. It really depends on a ton of factors, your network link, the amount of resources and their size, OS parameters etc. So there is no general rule of thumb here.
- weird-eye-issue 4y agoI was just talking about DNS not this other stuff. But now that you bring it up, isn't the 6 resources per domain outdated? At least for HTTP2? When I've done performance testing on my site lately it definitely seemed to load more than 6 resources in parallel from one domain but I haven't looked into this topic in a long time (back when it definitely was limited)
- deleted 4y ago[deleted]
- littlecranky67 4y agoYes, I was explicitly referring to HTTP1/1. With HTTP2, connection multiplexing is baked into the HTTP/2 protocol. But again, whether or not this speeds things is hard to tell without knowing all relevant parameters. There is a reason HTTP/3 uses QUIC over UDP, the main motivation was to put the userspace (i.e. browser) more in control over congestion control and such things (while TCP is always kernel-implementation dependent). And I think we will see lot of different implementations and innovations in this field (just as there is a ton of different TCP congestion window scaling algorithms).
- lelandfe 4y ago> you might hit the TCP multiplexing limits (6 TCP connections in browsers) Isn’t the maximum concurrent multiplex streams on one connection, like, 1000? (I suspect you didn’t mean to say multiplexing)
- littlecranky67 4y agoI was refering to a sane default of 6 TCP sockets that some browsers use per host when using HTTP/1.1. I don't think this is standardized, so its just an implementation detail and might vary across browsers and plattforms. Maybe you can even increase this in your browser settings. From a quick glance at the HTTP/2 spec, it seems the actual number of multiplexed steams is configurable per session: https://httpwg.org/specs/rfc7540.html#SettingValues https://httpwg.org/specs/rfc7540.html#SettingValues (SETTINGS_MAX_CONCURRENT_STREAMS). Of course, OSes have limits how much outgoing TCP connections you can have (per user, per process, system wide) but I think will be much higher than 1000. Edit: Firefox by default uses no more than 900 parallel HTTP connections (check your about:config page), and I assume this holds true for all windows/tabs combined - which is plenty.