-
Notifications
You must be signed in to change notification settings - Fork 210
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
Make the link fetching process asynchronous #6609
Comments
@piotrbak Have you been using the alpha1 version? In which case, it should be expected to double this time with this PR that is already merged on develop. (not on alpha1). To consider:
Then, we'll need product direction on the exact behavior we should target for the initial release: no warmup, no mobile warmup, wait for async to be implemented, etc. |
For the release:
For the future enhancement, the objective would be to implement async before the end of the staggered. If applying the the two points will lower the time significantly, we could lower the priority here and do it later. WDYT? |
The main reason for latency here is the visit of the homepage. So it depends what would be "acceptable". If 10s is OK, then we should be fine in most cases with your plan. But if we're targeting let's say 5s, then removing the delay and only doing one visit won't be enough to meet this criteria for many websites. So the decision should be based on:
Regarding the schedule, I'll send my directions on Slack for next week in a few. |
Doing 2 visits doesn't sound like a must to be honest. From our perspective we could remove it anyways to reduce the load, even if it's async task.
Removing the delay on our testing website reduced the time from 13s to 8s already. So I think we can win a lot by removing the second visit. Async fetch would be an enhancement anyways, the thing is only about its priority. |
Right, but here I am looking for the fastest path to reach the target of lowering latency. If we go with async in the first place, then there is no added value in removing the 2nd visit when it comes to lowering latency, so that would become something with a much lower priority.
Are those numbers from alpha1 or develop branch? See my message here |
It's coming from |
Then on develop, even without the 2nd visit and no delay, you'll get something above 8s. There is no gain available anymore and it'll be slightly worst because we'll do 10 more requests to the SaaS. |
Note for test: we need to ensure that both mobile/desktop are there in WPR log after fresh install, after clear critical images, after switch theme and change permalinks |
Scope a solution ✅In
In
In
In Engine\Media\AboveTheFold\WarmUp::Subscriber
Update tests Estimate the effort ✅[S] |
@MathieuLamiot Since we are touching the warmup, I think the way we fetch links can be a bit optimized based on number to return on the filter. As now if we need 10 links and we have 100 links on the homepage, we will go through the whole 100 before finally slicing the remaining 90 and returning it. is this something we want to look into now? |
Good catch. Maybe it'd be more appropriate to open a dedicated GH issue? The sprint is already quite full so I'd prefer not adding optional optimizations to the scope. |
LGTM |
@Tabrisrp @jeawhanlee I might be missing something here but I feel like with the proposed grooming, AC n°2 won't be covered.
WDYT? |
But we currently send the home url for warm up here in the |
Ah we would have to remove it from fetch_links then as well. |
The Grooming has been updated. |
Is your feature request related to a problem? Please describe.
In 3.16 we introduced the feature that's fetching the links from the homepage. Currently, this process is happening synchronously, whenever the critical images data is cleared.
It's causing potential problems on the slower environments, as we need to wait until the homepage is loaded and fetched synchronously. It can even cause timeouts.
On our testing environment, clearing the data took 13s compared to 2.4s when putting static data into
fetch_links()
function.Describe the solution you'd like
We should make fetching process asynchronous, either using AS or WP Cron.
Acceptance Criteria
rocket_atf_warmup_links_number
filter working without regression, should be set back to 10usleep
between sending the requests here.The text was updated successfully, but these errors were encountered: