Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(ingress): state that the IP tier also counts shed requests
Yudhi Armyndharis967daceee8ed
diff --git a/src/modules/integration/ingress-instance-limit.ts b/src/modules/integration/ingress-instance-limit.tsindex 4eed50357..532c62f98 100644--- a/src/modules/integration/ingress-instance-limit.ts+++ b/src/modules/integration/ingress-instance-limit.ts@@ -9,8 +9,9 @@ export interface IngressAdmission {/*** The per-instance ingress rate bucket, charged by IngressService only once a delivery has passed* signature verification. Providers deliver every tenant's webhooks from one egress IP, so this is- * what keeps a noisy (pluginId, instanceId) from starving its neighbours. Traffic that fails earlier- * is bounded by the per-client-IP tier in InstanceThrottlerGuard alone.+ * what keeps a noisy (pluginId, instanceId) from starving its neighbours, up to INGRESS_IP_LIMIT:+ * every request also spends the per-client-IP tier first. Traffic that fails earlier is bounded by+ * the per-client-IP tier in InstanceThrottlerGuard alone.** Header names and values match what the throttler guard emitted for this tier. Every value is a* string, because safeAckHeaders drops anything else on the way to the wire.diff --git a/src/modules/integration/instance-throttler.guard.ts b/src/modules/integration/instance-throttler.guard.tsindex c4aa04f79..f8ec9f2a1 100644--- a/src/modules/integration/instance-throttler.guard.ts+++ b/src/modules/integration/instance-throttler.guard.ts@@ -25,10 +25,10 @@ export class InstanceThrottlerGuard extends ProxyAwareThrottlerGuard {// the very first hit. An explicit 0 is still rejected at boot by env.validation.this.throttlers = [{- // Sized well ABOVE the per-instance limit so it never becomes the binding constraint for a- // legitimate provider fanning many tenants through one egress IP: 10x the instance default.- // Raise it with `INGRESS_IP_LIMIT` when one IP legitimately drives more than that. The tier- // keeps the inherited proxy-aware client-IP tracker.+ // Sized 10x the per-instance default. It counts every request, including those the+ // per-instance bucket later sheds, so one tenant pushing a shared egress IP past it sheds+ // its neighbours too. Raise it with `INGRESS_IP_LIMIT` when one IP legitimately drives more+ // than that. The tier keeps the inherited proxy-aware client-IP tracker.name: 'ingress-ip',limit: resolveNonNegativeIntEnv(process.env.INGRESS_IP_LIMIT, 1200),ttl: resolveNonNegativeIntEnv(process.env.INGRESS_INSTANCE_TTL, 60000),