Automattic / Automattic/jetpack

Performance Issue with sync/object-id-range endpoint

Open
#16,298 1 comment 0 reactions 1 assignee Claimed by @mdbitz View on GitHub
[Package] Sync [Pri] Low [Status] Stale Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

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]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.