<!-- llms-explorer concept facts · https://llms-explorer.com/tree/azure-app-service-scale-out-mongodb-pool-and-snat-budgets/ · pack 2026-11-02 · ~1186 tokens -->

# Azure App Service scale-out MongoDB pool and SNAT budgets

> Source-anchored research for Azure App Service scale-out MongoDB pool and SNAT budgets. Run status: COMPLETED.

Parent: [MongoDB Atlas on Azure](https://llms-explorer.com/tree/mongodb-atlas-on-azure/) · 3 facets · 6 facts · page: https://llms-explorer.com/tree/azure-app-service-scale-out-mongodb-pool-and-snat-budgets/

## How it works

- App Service scale-out can distribute outbound demand across additional worker SNAT allocations, while unchanged per-process MongoDB pools increase the fleet connection ceiling. MongoDB documents simultaneous reconnects during application-tier scaling as a connection-storm cause. Therefore validate both per-worker outbound pressure and Atlas connection capacity during scale-out and restart load tests. (medium confidence) — [source](https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/troubleshoot-intermittent-outbound-connection-errors) · [also](https://www.mongodb.com/docs/v8.0/troubleshooting/connection-storms/) · [also](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/connection-pools/)
- Network mitigation depends on the actual outbound route: regional VNet integration with private endpoints removes the documented App Service public-SNAT restriction for traffic to that private destination. NAT Gateway is another documented option for public outbound traffic. Neither changes the number of independent MongoClient pools, so retain the process-and-worker connection budget after changing the network path. (medium confidence) — [source](https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/troubleshoot-intermittent-outbound-connection-errors) · [also](https://azureossd.github.io/2022/03/10/NodeJS-with-Keep-Alives-and-Connection-Reuse/index.html) · [also](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/connection-pools/)

## Problems, failure modes and limitations

- Diagnose suspected SNAT exhaustion using App Service Diagnose and solve problems: inspect the SNAT Port Exhaustion detector per instance and the SNAT Failed Connections Endpoint detector for implicated destinations. Correlate these with application connection errors and Atlas Connections graphs or connection-creation indicators; aggregate TCP connection counts alone cannot establish SNAT exhaustion, and HTTP 5xx symptoms are not specific to it. (medium confidence) — [source](https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/troubleshoot-intermittent-outbound-connection-errors) · [also](https://azureossd.github.io/2022/03/10/NodeJS-with-Keep-Alives-and-Connection-Reuse/index.html) · [also](https://www.mongodb.com/docs/v8.0/troubleshooting/connection-storms/)
- The Azure OSS MongoDB example sets maxPoolSize to 128, or to 128 / os.cpus().length when Node runs across multiple CPUs. MongoDB documents monitoring connections outside the application pool. The example therefore omits that monitoring allowance if it is used as the entire worker socket budget; it is not a universal safe MongoDB or SNAT limit. (medium confidence) — [source](https://azureossd.github.io/2022/03/10/NodeJS-with-Keep-Alives-and-Connection-Reuse/index.html) · [also](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/connection-pools/) · [also](https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/troubleshoot-intermittent-outbound-connection-errors)

## Facts and statements

- For the public-endpoint path described by Microsoft, 128 SNAT ports is the initial per-instance allocation, and contention particularly affects repeated connections to one destination address and port; additional allocation can occur. Closed connections can retain their allocation during a four-minute reclamation delay. Repeatedly opening and closing clients can therefore sustain port pressure after application sockets close. (low confidence) (verified as of 2026-08-26) — [source](https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/troubleshoot-intermittent-outbound-connection-errors)
- A published App Service B1 experiment reports timeout failures with relatively stable CPU/memory and explicitly limits its findings to one destination, region, day, and default egress path. Those measurements do not establish a universal MongoDB pool size or premium-plan threshold. Its displayed _make_request function constructs a new HTTPSConnection for each call, so the displayed code does not demonstrate connection reuse across calls; the reported timeouts alone do not measure SNAT occupancy. (low confidence) (verified as of 2026-04-10) — [source](https://yeongseon.dev/azure-paas-troubleshooting-labs/app-service/snat-exhaustion/overview/)
