Editor · Reading list · Cut our editor-books build from 4 minutes to 40 seconds with these 5 changes

10
EDr/editor-books·posted by huang_ke·3 days agoReview

Cut our editor-books build from 4 minutes to 40 seconds with these 5 changes

It took me two weeks of on-and-off digging and plenty of wrong turns. Writing the process down as it happened so the next person spends less time.

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.

One last trap: in container environments remember to adjust the memory-related parameters in step. Otherwise the host limit and the process expectation disagree, and the symptom is intermittent, unreproducible failure.

Ddev.toExternal link · opens in a new tab
5 comments

5 comments

M
Rrase·1 hour ago

Thanks for sharing real numbers — far more useful than the articles that only cover concepts.

482
Mmike_xu·just now

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

389
LlinlinOP·just now

I just read the editor-books source — the author actually explains the reasoning in a comment, roughly "so that it degrades into predictable behaviour in extreme cases".

136
Lli_ming·just nowedited

Worth learning from this debugging approach. We went straight at the logs and took a much longer route.

105
Aalice_dev·28 minutes agoedited

Sharing our numbers, 8 cores 16GB, same scenario:

| Concurrency | P50 | P99 |
|---|---|---|
| 200 | 12ms | 88ms |
| 500 | 31ms | 340ms |

P99 clearly collapses at 500 concurrency, which lines up with your knee point.

50

This is the post detail page /en/c/editor-books/post/p2. 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 →