Clojure · Job board · Those easily-missed type details in clojure-jobs

1.6K
CLr/clojure-jobs·posted by tang_hao·3 hours agoTooling

Those easily-missed type details in clojure-jobs

Short version: clojure-jobs needs almost no tuning at small and medium scale — the point where it starts to hurt is much further out than most people assume. Full measurements below.

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 clojure-jobs itself but our upstream connection reuse — the load test traffic was too clean and hid the long-tail requests.

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.

Ggithub.comExternal link · opens in a new tab
205 comments

205 comments

· first 120 loaded
M
Zzhu_zongOP·12 minutes ago

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

518
Bbob_chen·1 hour 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.

297
Zzhu_zongOP·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.

444
Bbob_chen·2 days ago

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

133
Oops_wang·2 days ago

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

1
Mmike_xuMod·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.

98
Kkernel_panic·2 days ago

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

474
Rran_bo·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.

462
Mmike_xu·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.

442
Sslow_query·2 days agoedited

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

440
Aalice_dev·just now

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.

413
Sswoole_lee·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.

109
Aalice_dev·12 minutes 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.

4
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.

410
Rran_bo·just now

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.

21
Sswoole_lee·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.

2
Wwinter·2 hours ago

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

384
Zzhou_yi·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.

375
Zzhou_yi·5 hours ago

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

349
Sswoole_leeOP·2 days ago

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

39
Aalice_dev·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.

296
Nnikic·2 days ago

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

260
Nnikic·2 days 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.

254
Zzhu_zong·2 days ago

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

247
Hhuang_ke·2 days agoedited

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

161
Lli_ming·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.

98
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.

272
Kkite·28 minutes ago

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

94
Kkernel_panic·2 days ago

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

89
Oops_wangOP·5 hours ago

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

24
Lli_ming·1 hour 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.

82
Bbob_chenOP·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.

21
Aalice_dev·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.

62
Aalice_dev·12 minutes ago

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

57
Hhuang_ke·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.

55
Sslow_query·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.

164
Aalice_dev·2 days agoedited

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

83
Kkite·3 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.

48
Kkite·yesterday

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

43
Sswoole_lee·just nowedited

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.

35
Lli_ming·2 days ago

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

21
Lli_ming·3 minutes ago

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

103
Aalice_dev·2 days ago

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

55
Zzhu_zong·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.

1
Rran_boOP·2 days ago

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

36
NnikicOP·2 hours ago

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

13
Aalice_dev·2 days ago

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

494
Aalice_dev·2 days agoeditedLevel 6

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

90
Kkernel_panic·3 minutes ago

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

363
Lli_ming·2 days agoeditedLevel 6

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.

26
Cchen_dev·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.

65
Rran_bo·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.

161
Wwinter·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.

40
Mmike_xu·2 days agoedited

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

31
Lli_ming·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.

46
Ddev_zhou·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.

23
Kkite·yesterdayedited

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.

16
Rrase·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.

6
Zzhu_zong·5 hours 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.

5
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.

496
Hhuang_ke·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.

5
Oops_wang·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.

474
Kkernel_panicOP·28 minutes ago

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

2
Hhuang_ke·yesterday

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

4
Rran_bo·1 hour 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.

125
Lli_ming·2 hours 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.

331
Oops_wang·12 minutes ago

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

440
Lli_mingMod·2 days ago

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

36
Kkite·2 days agoLevel 6

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

6
Kkite·3 minutes ago

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

1
Sswoole_lee·2 hours ago

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

221
Hhuang_ke·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.

60
Mmike_xu·2 days ago

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

8
Sswoole_leeOP·12 minutes 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
Hhuang_ke·2 days ago

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

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

53
Rran_boOP·2 days ago

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

42
Aalice_dev·2 days ago

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

289
Ttang_hao·2 days agoLevel 6

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
Rran_boOP·12 minutes ago

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

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

2
Sslow_query·2 days agoeditedLevel 6

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.

9
Oops_wang·12 minutes ago

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

3
Ttang_hao·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
Zzhu_zong·2 days ago

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

133
Sslow_queryOP·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.

124
Sswoole_lee·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.

75
Wwinter·2 days ago

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

4
Zzhu_zong·2 days ago

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

12
Kkernel_panic·2 days ago

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

29
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.

6
Mmike_xu·12 minutes ago

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

2
Ddev_zhou·3 minutes ago

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

437
Mmike_xu·5 hours ago

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

217
Ddev_zhou·1 hour 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.

213
Zzhu_zong·28 minutes ago

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

271
Kkernel_panicMod·2 days ago

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

190
NnikicMod·2 days ago

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

104
Rran_bo·2 days ago

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

42
Hhuang_keMod·1 hour 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.

27
Zzhu_zong·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.

308
Cchen_dev·1 hour 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.

1
Cchen_dev·2 days agoedited

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

468
Aalice_dev·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.

459
Kkite·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.

139
Nnikic·2 days ago

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

281
Rran_bo·2 days ago

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

115
Llinlin·2 days 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.

412
Kkite·2 hours agoedited

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

194
Kkernel_panic·28 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.

53
RraseOP·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.

1
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.

52
Bbob_chen·yesterday

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

4
Mmike_xu·2 days ago

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

221
Cchen_devOP·2 hours 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.

329
Lli_ming·2 days agoLevel 6

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

51
Kkernel_panic·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.

2
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.

404
Oops_wangMod·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.

1
Kkite·2 days ago

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

1

This is the post detail page /en/c/clojure-jobs/post/p6. 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 →