New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 867412 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

<link rel='prefetch'> requests may consume all available sockets

Project Member Reported by alexilin@chromium.org, Jul 25

Issue description

If a page inserts too many prefetch links, the next navigation can be delayed if all requests go to the same origin.

The chrome has a limit for the number of connections to a HTTP/1.1 origin (g_max_sockets_per_group). Currently its value is 6 for normal socket pools. Prefetch requests could occupy all available sockets so the next more important request will have to wait until one of these sockets is free.

This can be fixed by restricting the maximum number of simultaneous same-origin prefetches to some value lower than 6.
 
Here's a browser test illustrating the issue: https://crrev.com/c/1150146
Components: -Blink>HTML>Link Blink>Loader
Description: Show this description
This problem is not a prefetch specific, right?
Also, since the g_max_sockets_per_group is a global limit, even if we have a per-tab simultaneous same-origin prefetch limit, it still can consume all available sockets among multiple-tabs.

So, adding such a limit sounds an incomplete and ad-hoc approach to me.
Labels: -Type-Bug Needs-Feedback Type-Feature
> This problem is not a prefetch specific, right?

It's not. A page might just manually send a bunch of XHR requests to an origin causing the same problem. But we could add special treatment for prefetch requests though.

> Also, since the g_max_sockets_per_group is a global limit, even if we have a per-tab simultaneous same-origin prefetch limit, it still can consume all available sockets among multiple-tabs.
> 
> So, adding such a limit sounds an incomplete and ad-hoc approach to me.

We could enforce this limit among all tabs, for example at the ResourceScheduler level.

Alternatively, we could just stop all prefetch hints after the user initiates any kind of page load. Mozilla claims they do that: https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ#What_happens_if_I_click_on_a_link_while_something_is_being_prefetched.3F 
Cc: y...@yoav.ws
Status: Available (was: Untriaged)
Prefetch is a speculative fetch (not mandatory) so technically we can surely implement this I suppose (in global way too, the latest architecture allows this).  Marking this Available for now, I'd like to get more inputs/signals/feedback before we actually implement this.

Sign in to add a comment