You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`micro-1x1`| Smallest Dubbo consumer pod, low or moderate traffic, DB-backed provider with a small pool. | <small><code>reactor.runtime.profile=micro-dubbo</code><br><code>reactor.dubbo.native-connections-per-endpoint=1</code><br><code>reactor.dubbo.native-async-workers=1</code><br><code>reactor.dubbo.native-async-queue-capacity=32</code><br><code>reactor.dubbo.max-inflight=16</code></small> | Lowest RSS. Spikes may get controlled `503`. |
412
-
|`micro-2x2`| Full sample writes to DB, or Hikari is `2` and `1x1` serializes calls before the DB. | <small><code>sample.dubbo.capacity-profile=micro-2x2</code><br><code>reactor.dubbo.native-connections-per-endpoint=2</code><br><code>reactor.dubbo.native-async-workers=2</code><br><code>reactor.dubbo.native-async-queue-capacity=64</code><br><code>reactor.dubbo.max-inflight=64</code></small> |One extra native worker and connection. This is the full sample default; catalog-only stays `1x1`. |
412
+
|`micro-2x2`| Full sample writes to DB, or Hikari is `2` and `1x1` serializes calls before the DB. | <small><code>sample.dubbo.capacity-profile=micro-2x2</code><br><code>reactor.dubbo.native-connections-per-endpoint=2</code><br><code>reactor.dubbo.native-async-workers=2</code><br><code>reactor.dubbo.native-async-queue-capacity=64</code><br><code>reactor.dubbo.max-inflight=64</code><br><code>POST /customers=4/250ms</code><br><code>POST /customers/typed=4/250ms</code></small> |Keeps the two hot create routes from building a 16-request queue in front of one shared `2x2` backend. This is the full sample default; catalog-only stays `1x1`. |
413
413
|`balanced-stable-4x4`| Read-heavy service, provider returns ready JSON, and you want more 2xx without hiding overload. | <small><code>reactor.runtime.profile=balanced-dubbo</code><br><code>reactor.dubbo.native-connections-per-endpoint=4</code><br><code>reactor.dubbo.native-async-workers=4</code><br><code>reactor.dubbo.native-async-queue-capacity=512</code><br><code>reactor.dubbo.max-inflight=64</code></small> | Higher RPS. Needs provider CPU/DB proof. |
414
414
|`balanced-mid-4x4`| Distributed commands need more accepted work and provider capacity is measured. | Same `4x4` native settings, with wider route budgets than `stable`. | More 2xx possible. p99/RSS must be watched. |
415
415
|`balanced-wide-4x4`| Only for a measured high-capacity provider, not as a default. | Same `4x4` native settings, with the widest route budgets. | Can hide overload in queues. Use with caution. |
@@ -433,6 +433,11 @@ Use this rule for DB-backed endpoints: do not size the consumer for client concu
433
433
from provider and Hikari capacity first. If the provider has only two DB connections, `c64` traffic
434
434
must either wait briefly or get controlled `503`; deep queues only increase RSS and p99.
435
435
436
+
Route limits are not isolated capacity. If raw and typed create routes both call the same command
437
+
service, their accepted work is added together. With a two-worker/two-connection backend, `8 + 8`
438
+
allows sixteen requests to wait behind two durable PostgreSQL commits. The `micro-2x2` recipe uses
439
+
`4 + 4` and a `250 ms` wait budget so WAL/fsync variance does not amplify across a deep queue.
440
+
436
441
Run the repeatable mixed raw/typed write gate after the consumer, provider, and PostgreSQL containers
437
442
join the same Docker network:
438
443
@@ -447,6 +452,17 @@ docker run --rm --network YOUR_NETWORK `
447
452
The normal gate requires zero failed writes and p99 below `250 ms`. A high-concurrency overload test
448
453
may allow controlled `503`, but it must not report native Dubbo errors, DB rollbacks, or pool exhaustion.
449
454
455
+
Use the repeat gate for the `c16` tail-latency check. It rejects a result when one run exceeds
456
+
`200 ms` p99, the p99 spread exceeds `75 ms`, or non-2xx exceeds `0.10%`:
457
+
458
+
```powershell
459
+
.\benchmark\dubbo-write-repeat-gate.ps1 `
460
+
-Network YOUR_NETWORK `
461
+
-BaseUrl http://consumer:8080 `
462
+
-VirtualUsers 16 `
463
+
-Repeats 3
464
+
```
465
+
450
466
## Production Recipes
451
467
452
468
### Recipe 1: Kubernetes Consumer With ZooKeeper Discovery
@@ -496,7 +512,7 @@ Use this when the provider address is known and your REST API only exposes read
| `reactor.rust.route-admission.get.api.v1.customers.db.queue-timeout-ms` | `150` | Customer DB read queue wait. Lower for faster fail-fast under DB saturation. |
2000
2018
| `reactor.rust.route-admission.get.api.v1.customers.db.stats/by-segment/id.*` | `4-8` / `150` | Typed DB stats, list, and record lookup caps. Keep list queries lower than raw byte pass-through routes. |
2001
2019
| `reactor.rust.route-admission.get.api.v1.customers.id.exists/display-name.*` | `8` / `150` | Small scalar lookup caps. Tune with provider DB pool if these call the database. |
2002
-
| `reactor.rust.route-admission.post.api.v1.customers.max-concurrent` | `8` | Create command cap. Keep bounded to avoid duplicate-write pressure and DB queue buildup. |
2003
-
| `reactor.rust.route-admission.post.api.v1.customers.queue-timeout-ms` | `150` | Create command wait budget. Lower if write p99 matters more than absorbing bursts. |
2004
-
| `reactor.rust.route-admission.post.api.v1.customers.typed.*` | `8` / `250` | Typed create cap for `micro-2x2`. This removes false admission timeouts at the normal write gate. |
2020
+
| `reactor.rust.route-admission.post.api.v1.customers.max-concurrent` | `4` | Raw create cap for `micro-2x2`. Raw and typed limits add up because both use the same two RPC/DB permits. |
2021
+
| `reactor.rust.route-admission.post.api.v1.customers.queue-timeout-ms` | `250` | Raw create wait budget. It absorbs short WAL/fsync variance without allowing a deep queue. |
2022
+
| `reactor.rust.route-admission.post.api.v1.customers.typed.*` | `4` / `250` | Typed create cap for `micro-2x2`. Together with the raw route, at most eight create requests enter the shared backend path. |
|`micro-1x1`| En küçük Dubbo consumer pod, düşük/orta trafik, küçük DB pool kullanan provider. | <small><code>reactor.runtime.profile=micro-dubbo</code><br><code>reactor.dubbo.native-connections-per-endpoint=1</code><br><code>reactor.dubbo.native-async-workers=1</code><br><code>reactor.dubbo.native-async-queue-capacity=32</code><br><code>reactor.dubbo.max-inflight=16</code></small> | En düşük RSS. Spike altında kontrollü `503` dönebilir. |
427
-
|`micro-2x2`| Full sample DB'ye yazıyor veya Hikari `2` olduğu halde `1x1` çağrıları DB'ye ulaşmadan seri hale getiriyor. | <small><code>sample.dubbo.capacity-profile=micro-2x2</code><br><code>reactor.dubbo.native-connections-per-endpoint=2</code><br><code>reactor.dubbo.native-async-workers=2</code><br><code>reactor.dubbo.native-async-queue-capacity=64</code><br><code>reactor.dubbo.max-inflight=64</code></small> |Bir ek native worker ve connection kullanır. Full sample varsayılanıdır; catalog-only `1x1` kalır. |
427
+
|`micro-2x2`| Full sample DB'ye yazıyor veya Hikari `2` olduğu halde `1x1` çağrıları DB'ye ulaşmadan seri hale getiriyor. | <small><code>sample.dubbo.capacity-profile=micro-2x2</code><br><code>reactor.dubbo.native-connections-per-endpoint=2</code><br><code>reactor.dubbo.native-async-workers=2</code><br><code>reactor.dubbo.native-async-queue-capacity=64</code><br><code>reactor.dubbo.max-inflight=64</code><br><code>POST /customers=4/250ms</code><br><code>POST /customers/typed=4/250ms</code></small> |İki yoğun create route'unun ortak `2x2` backend önünde 16 istek biriktirmesini engeller. Full sample varsayılanıdır; catalog-only `1x1` kalır. |
428
428
|`balanced-stable-4x4`| Read-heavy servis, provider hazır JSON dönüyor ve overload saklanmadan daha çok 2xx isteniyor. | <small><code>reactor.runtime.profile=balanced-dubbo</code><br><code>reactor.dubbo.native-connections-per-endpoint=4</code><br><code>reactor.dubbo.native-async-workers=4</code><br><code>reactor.dubbo.native-async-queue-capacity=512</code><br><code>reactor.dubbo.max-inflight=64</code></small> | RPS artar. Provider CPU/DB ölçümü gerekir. |
429
429
|`balanced-mid-4x4`| Distributed command endpoint'leri daha çok kabul edilen iş istiyor ve provider kapasitesi ölçüldü. | Aynı `4x4` native ayarları, `stable` değerinden daha geniş route budget. | Daha çok 2xx alınabilir. p99/RSS izlenmelidir. |
430
430
|`balanced-wide-4x4`| Sadece ölçülmüş yüksek kapasiteli provider için. Default yapılmamalıdır. | Aynı `4x4` native ayarları, en geniş route budget. | Overload queue içinde saklanabilir. Dikkatli kullanın. |
@@ -448,6 +448,12 @@ DB-backed endpoint için kural basittir: consumer'ı önce client concurrency de
448
448
provider ve Hikari kapasitesine göre boyutlandırın. Provider'da iki DB connection varsa `c64`
449
449
trafik ya kısa süre beklemeli ya da kontrollü `503` almalıdır. Derin queue sadece RSS ve p99 artırır.
450
450
451
+
Route limitleri birbirinden bağımsız backend kapasitesi değildir. Raw ve typed create route'ları aynı
452
+
command service'e gidiyorsa kabul ettikleri işler toplanır. İki worker ve iki DB connection önünde
453
+
`8 + 8` kullanmak, iki güvenli PostgreSQL commit işleminin arkasında 16 istek biriktirir. `micro-2x2`
454
+
reçetesi bu nedenle `4 + 4` ve `250 ms` bekleme bütçesi kullanır. WAL/fsync gecikmesi derin queue
455
+
boyunca büyüyerek p99 değerini bozmaz.
456
+
451
457
Consumer, provider ve PostgreSQL container'ları aynı Docker network'üne bağlandıktan sonra tekrarlanabilir
452
458
raw/typed karma write gate'i çalıştırın:
453
459
@@ -462,6 +468,17 @@ docker run --rm --network YOUR_NETWORK `
462
468
Normal gate sıfır hatalı write ve `250 ms` altında p99 ister. Yüksek concurrency overload testinde
463
469
kontrollü `503` kabul edilebilir. Ancak native Dubbo hatası, DB rollback veya pool exhaustion olmamalıdır.
464
470
471
+
`c16` tail-latency kontrolü için repeat gate'i kullanın. Tek bir koşuda p99 `200 ms` değerini aşarsa,
472
+
p99 yayılımı `75 ms` değerinden büyükse veya non-2xx oranı `%0,10` üzerine çıkarsa test başarısız olur:
473
+
474
+
```powershell
475
+
.\benchmark\dubbo-write-repeat-gate.ps1 `
476
+
-Network YOUR_NETWORK `
477
+
-BaseUrl http://consumer:8080 `
478
+
-VirtualUsers 16 `
479
+
-Repeats 3
480
+
```
481
+
465
482
## Production Reçeteleri
466
483
467
484
### Reçete 1: ZooKeeper Discovery Kullanan Kubernetes Consumer
@@ -511,7 +528,7 @@ expose ediyorsa bunu kullanın.
| `reactor.rust.route-admission.get.api.v1.customers.db.queue-timeout-ms` | `150` | Customer DB read queue wait. DB saturation altında hızlı fail-fast için düşürün. |
2013
2032
| `reactor.rust.route-admission.get.api.v1.customers.db.stats/by-segment/id.*` | `4-8` / `150` | Typed DB stats, list ve record lookup cap'leri. List query'leri raw byte pass-through route'larından düşük tutun. |
2014
2033
| `reactor.rust.route-admission.get.api.v1.customers.id.exists/display-name.*` | `8` / `150` | Küçük scalar lookup cap'leri. Bu method'lar DB'ye gidiyorsa provider DB pool ile tune edin. |
2015
-
| `reactor.rust.route-admission.post.api.v1.customers.max-concurrent` | `8` | Create command cap. Duplicate write baskısı ve DB queue büyümesini önlemek için bounded kalmalı. |
| `reactor.rust.route-admission.post.api.v1.customers.max-concurrent` | `4` | `micro-2x2` raw create sınırıdır. Raw ve typed limitleri aynı iki RPC/DB iznini kullandıkları için toplanır. |
2035
+
| `reactor.rust.route-admission.post.api.v1.customers.queue-timeout-ms` | `250` | Raw create bekleme bütçesidir. Derin queue oluşturmadan kısa WAL/fsync dalgalanmasını karşılar. |
2036
+
| `reactor.rust.route-admission.post.api.v1.customers.typed.*` | `4` / `250` | Typed create sınırıdır. Raw route ile birlikte ortak backend yoluna en fazla sekiz create isteği girer. |
0 commit comments