Skip to content

Optimization Detective should be further hardened to account for high traffic sites #1655

@westonruter

Description

@westonruter

Originally discussed in #1496 (comment):

  • 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_metrics post 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 #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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Definition ✏️

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions