Optimization Detective should be further hardened to account for high traffic sites
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with the discussion in issue 1496 and the changes in pull request 1641, then trace the Optimization Detective REST API path that stores URL Metrics and the related WP Cron cache-clearing behavior. Done requires an agreed and implemented approach for preventing or managing concurrent URL Metrics database writes at high traffic volumes.
Written by the indexing model from the issue text.
Description
Originally discussed in https://github.com/WordPress/performance/issues/1496#issuecomment-2471868739:
- Do we add an endpoint for getting the which URL Metrics are needed. The problem is that the endpoint cache wouldn't be reliably flushed. But if it were reliably flushed:
- Check what happens when there is a race condition between two requests to store a URL Metric from two application servers connected to the same database when there wasn't a
od_url_metricspost that already existed. - Do we need a lock or throttling mechanism?
- When a persistent object cache is available, perhaps the POST request would only write to the object cache and then WP Cron would read from the object cache to actually create the URL Metrics posts.
Already addressed as part of https://github.com/WordPress/performance/pull/1641:
To deal with the page cache stampede problem, we can schedule the clearing of the cache for a URL periodically via WP Cron.
So the page cache stampede problem is addressed, but what is not addressed is what to do with a stampede of database writes for potentially thousands (or millions) of visitors attempting to submit URL Metrics for storage via the REST API.
- Dominant language
- PHP
- Stars
- 461
- Forks
- 165
- Avg merge
- 11h 12m
- Merged PRs (30d)
- 28
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WordPress/performance
-
[Plugin] Optimization Detective [Type] Enhancement ContributorDay
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
WordPress/performance#2224 · 2 comments · 1 reaction ·
-
[Plugin] Modern Image Formats [Type] Enhancement Needs Discussion
WordPress/performance#2662 · 1 assignee ·
-
[Type] Bug
WordPress/performance#2643 · 4 comments · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WordPress/performance#2640 · 3 comments ·
-
[Plugin] Optimization Detective [Type] Bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
WordPress/performance#2622 · 8 comments ·
All issues in WordPress/performance
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getgrav/grav-plugin-api#45 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
phingofficial/phing#2025 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100