Repository navigation
perf: pin database routes to iad1 (search ~6×, views ~3× faster) - #168
Merged
Merged
Conversation
benthecoder
force-pushed
the
neon-region
branch
from
October 28, 2026 15:49
18e5903 to
0fd747d
Compare
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Owner
Author
|
Measured on this PR's preview deploy (blog-git-neon-region…vercel.app), same queries as production:
|
Owner
Author
|
Added app/api/views/route.ts to the iad1 pin. Measured on a preview, view-count reads went from ~470ms in sin1 to ~140ms in iad1 (warm, with identical counts), so the Upstash database is US-side too. Same change: one more |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #167. #167 had no effect: its preview still ran in sin1 (
x-vercel-id: iad1::sin1) at the same 1.6–2.6s per search. Vercel ignores Next's per-routepreferredRegionhere. The supported mechanism isregionsunderfunctionsin vercel.json (per the Vercel docs on configuring function regions).This removes #167's dead
preferredRegionlines and setsregions: ["iad1"]for app/api/search, app/api/thoughts and app/api/tweet.Plan caveat: Hobby allows a single function region, and a deploy asking for a second fails before the build. If this preview fails for that reason, the fix is to move the whole project's default region to iad1 (Settings → Functions → Function Regions, or
"regions": ["iad1"]at the top of vercel.json). Measurements will follow in a comment.tsc, tests and knip pass.