共 10 句 · 中英对照 · 对应本级 10 个目标词
开始练这一级 →Our nightly aggregation job kept slowing down, so we started with sampling instead of a full run.我们的夜间聚合任务越来越慢,所以我们先做「抽样」,而不是跑全量。 That small sample showed one user producing most of the events, a clear hot spot.小样本显示:一个用户产生了大部分事件,是明显的「热点」。 The old sharding key had low cardinality, so all those events landed on one machine.旧的「分片键」「基数」很低,所以那些事件全落在一台机器上。 We decided to use a new key and to compute a quantile per shard key, not one global number.我们决定换一个新键,并且按分片键计算「分位数」,而不是一个全局数字。
To reduce cache misses, we added memoization, so repeated lookups slowly became amortized.为减少缓存未命中,我们加了「记忆化」,重复查询的开销逐渐变成「摊薄后的」。 We also made the writer idempotent by passing an idempotency key with every record.我们还让写入端幂等:每条记录都带一个「幂等键」。 Deduplication then happened at the source, well before any write.「去重」在源头就完成了,早于任何写入。
The backfill that followed finished overnight, and the p99 latency finally dropped.随后的「回填」一夜跑完,p99「延迟」终于降了下来。 The caveat is simple: our sample was small, and a skewed sample can mislead you.「注意事项」很简单:我们的样本很小,有偏的样本会误导你。
After the fix, each stage stayed deterministic, so a rerun produced the same numbers.修好之后,每个阶段都保持「确定性」,重跑得到同样的数字。
数据来源:NGSL(CC BY-SA 4.0)· ECDICT(MIT License)。短文为本项目为练习编写的配套材料。