Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 800 forks source link

Performance Issue with sync/object-id-range endpoint #16298

Open mdbitz opened 4 years ago

mdbitz commented 4 years ago

The sync/object-id-range endpoint is used by Jetpack Validator and other tools to create ranges of Objects to be synced/validated to WordPress.com. How it functions is that it returns the min/max object id for the desired batch size. On large sites (1/2 million objects) this process is time intensive and consumes db resources leading to 504s and degraded response times.

This endpoint should be optimized to minimize queries for large sites to ensure functionality of tools are preserved.

Steps to reproduce the issue

  1. Have a site with 500,000 + posts
  2. Query the sync/object-id-range endpoint

What I expected

A response that includes ranges from the min post_id to max post_id

What happened instead

504 Bad Gateway and Timeouts

Misc

Additional Details of example site can be found at [jpop-5484]

stale[bot] commented 3 years ago

This issue has been marked as stale. This happened because:

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.