migrationsLinkgithub.blog ↗
From 2,500 requests to 24: Rebuilding star history without the stargazers
One stargazers endpoint logged nearly 37,000 slow count queries in a week. GitHub replaced it with daily counts: react/react's history went from about 2,511 requests to 24.
Why we picked it · the editor's summary
GitHub's stargazers endpoint recounted every current star on each paginated request, so rebuilding the growth curve for react/react took about 2,511 calls. In the week before access was restricted, nearly 37,000 of those count queries ran slow, averaging almost 3 seconds, and database safeguards killed more than 1,000; scrapers were also harvesting stargazer identities for spam. The replacement returns up to 30 weeks of daily counts per request, without identities: about 24 requests for the same history, 60% fewer stargazer requests to the database, and about 80% less time on the count query. Callers paid part of the bill, since tools built on usernames broke. Price your next fix the same way, in slow queries a week, and say up front who loses what.
Read on The GitHub Blog ↗15m read
Comments
Loading comments…