Jupyter · Advanced · jupyter-pro logging: what separates "readable" from "usable"

876
JUr/jupyter-pro·posted by huang_ke·3 days agoDiscussion

jupyter-pro logging: what separates "readable" from "usable"

Most jupyter-pro articles stop at "how to use it" and never cover "when not to use it". This is an attempt at the second half.

We also fixed monitoring along the way: replaced average-based alerts with percentiles and split them per endpoint. False alerts dropped by about seventy percent and the on-call rotation visibly cheered up.

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.

What genuinely surprised me was the tail. The average looked great while P99 jumped by an order of magnitude past some threshold. The cause was not jupyter-pro itself but our upstream connection reuse — the load test traffic was too clean and hid the long-tail requests.

273 comments

273 comments

· first 120 loaded
M
Mmike_xuOP·12 minutes agoedited

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

510
Sswoole_leeOP·2 days ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

480
Zzhu_zongOP·2 days agoedited

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.

73
Cchen_dev·2 days 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.

112
Mmike_xuOP·2 days ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

434
Zzhou_yiOP·2 days ago

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

5
Kkite·2 days ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

8
Hhuang_ke·28 minutes ago

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.

92
Rran_bo·2 hours ago

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.

1
Aalice_dev·2 days ago

One counter-example: below jupyter-pro 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

516
Oops_wang·2 days ago

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.

94
LlinlinMod·2 days ago

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

35
Llinlin·2 days agoedited

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.

1
Sslow_query·2 days ago

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

493
Ddev_zhou·2 days agoedited

Saved. I am reworking this area this week — this saves a lot of wrong turns.

483
Ddev_zhou·2 days 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.

476
Ttang_haoMod·2 days ago

One counter-example: below jupyter-pro 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

470
Mmike_xu·2 days ago

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

358
WwinterMod·2 days 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.

9
Kkernel_panic·2 days 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.

351
Cchen_dev·28 minutes ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

294
Aalice_dev·2 days ago

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

289
Ttang_hao·2 hours ago

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

280
Sslow_query·2 hours ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

276
Hhuang_ke·just now

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

262
Oops_wang·2 days agoedited

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

256
Mmike_xu·2 days ago

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

253
Bbob_chen·2 days ago

One counter-example: below jupyter-pro 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

503
Sswoole_lee·2 days ago

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

4
Llinlin·2 hours ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

454
Ttang_hao·3 minutes ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

79
Kkite·2 days ago

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

25
Oops_wang·2 days ago

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

151
Kkernel_panic·2 days ago

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.

238
Kkite·2 days ago

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

234
Kkernel_panic·28 minutes ago

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

217
Cchen_dev·2 days ago

One counter-example: below jupyter-pro 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

21
Ddev_zhou·2 days ago

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

186
Kkernel_panic·2 days ago

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

179
Bbob_chen·2 days ago

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

178
Lli_ming·2 days ago

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

172
Llinlin·2 days ago

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.

163
Hhuang_ke·2 days ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

408
Sslow_query·2 days agoedited

Saved. I am reworking this area this week — this saves a lot of wrong turns.

185
Bbob_chen·2 days ago

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

143
Hhuang_ke·2 days ago

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

130
Lli_ming·28 minutes ago

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

123
Rran_bo·yesterday

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.

149
Rran_bo·1 hour ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

56
Zzhou_yi·3 minutes ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

1
Sslow_query·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

20
Hhuang_ke·1 hour agoedited

Saved. I am reworking this area this week — this saves a lot of wrong turns.

102
Oops_wang·2 days ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

95
Kkernel_panic·yesterday

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

500
Kkernel_panic·3 minutes ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

116
Ttang_haoMod·2 days 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.

82
Hhuang_ke·2 days ago

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

37
Nnikic·2 days ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

263
Cchen_dev·2 days ago

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

1
RraseOP·2 days ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

24
RraseOP·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

18
Sswoole_lee·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

71
Aalice_dev·2 days ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

46
Zzhou_yi·3 minutes ago

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

30
Aalice_dev·2 days ago

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

17
Lli_ming·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

85
Cchen_dev·12 minutes ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

13
Aalice_dev·1 hour ago

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

7
Zzhou_yi·2 days agoedited

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

3
LlinlinOP·2 days ago

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

427
Zzhu_zong·2 days ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

30
Rrase·12 minutes ago

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

25
Sslow_queryOP·2 days ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

171
Mmike_xu·2 days ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

287
Rran_bo·2 days ago

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

187
Aalice_dev·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

34
Kkernel_panic·28 minutes ago

One counter-example: below jupyter-pro 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

27
Rrase·2 days ago

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

247
Sslow_query·12 minutes ago

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.

20
Rran_bo·2 days ago

One counter-example: below jupyter-pro 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

40
Zzhu_zong·2 days ago

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

18
Oops_wang·2 days ago

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

422
Kkite·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

313
Mmike_xu·2 days ago

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

111
Sswoole_lee·3 minutes agoedited

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

196
Rran_bo·2 days ago

One counter-example: below jupyter-pro 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

11
Rrase·2 days agoLevel 6

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

3
Sswoole_lee·3 minutes ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

2
Rran_bo·2 days ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

17
Rrase·2 days 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.

18
Llinlin·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

354
Llinlin·2 days ago

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

14
Llinlin·just now

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

5
Rran_bo·2 hours ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

397
Llinlin·2 days ago

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.

7
Rrase·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

190
Ddev_zhouOP·2 days ago

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

58
Kkite·2 days ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

2
Cchen_dev·3 minutes ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

4
Wwinter·2 days ago

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

95
Cchen_dev·2 days ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

1
Bbob_chen·just now

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

3
Lli_ming·2 days agoedited

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

2
Lli_ming·2 days ago

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.

264
Aalice_dev·just now

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

310
Ddev_zhouOP·2 days ago

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.

31
Bbob_chen·3 minutes agoedited

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.

1
Hhuang_ke·28 minutes agoedited

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

192
Aalice_dev·1 hour 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.

81
Sswoole_lee·2 days ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

92
Zzhou_yi·yesterday

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.

1
Kkernel_panic·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

2
Llinlin·2 days ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

428
Oops_wangOP·2 days ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

68
Bbob_chen·2 days ago

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.

8
Sslow_queryMod·1 hour ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

1
Kkernel_panic·5 hours ago

One counter-example: below jupyter-pro 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

1
Zzhou_yi·3 minutes ago

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

1
Ttang_hao·2 days ago

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.

230
Rrase·2 days ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

1

This is the post detail page /en/c/jupyter-pro/post/p3. 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 →