Turborepo · Job board · Cut our turborepo-jobs build from 4 minutes to 40 seconds with these 5 changes

9
TUr/turborepo-jobs·posted by kernel_panic·32 minutes agoExperience

Cut our turborepo-jobs build from 4 minutes to 40 seconds with these 5 changes

Some background first. Our setup is turborepo-jobs plus three downstream services, seven figures of daily requests, peaking around nine in the evening.

On trade-offs, my view is this: if nobody on the team owns this area long-term, do not introduce a second mechanism. With two coexistence you first have to work out which one is even in play when things break, and that costs far more than the performance you saved.

Image placeholder · object storage in production
POST /api/uploads → CDN origin pull
3 comments

3 comments

M
Zzhu_zongOP·just now

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

428
Mmike_xu·12 minutes ago

This is not a turborepo-jobs problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

331
Cchen_dev·3 minutes ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

187

This is the post detail page /en/c/turborepo-jobs/post/p12. Posts and comments are generated deterministically from a seeded PRNG, so the same post always renders the same content and the link can be shared, reloaded and indexed. In production this page reads MySQL for the post, Redis for hot-post caching, and fetches the whole comment tree in a single query on the path column.

See the database schema →