ACS Node.js SDK connection pool default max sockets limit
0 reputation · 30 Oct 2021, 04:02 UTC
0 reputation · 30 Oct 2021, 04:02 UTC
The Appcelerator Cloud Services Node.js SDK documents a pool option for controlling max sockets per host, but the public API reference does not state the default value when the option is omitted.
Source inspection for Titanium SDK 7.5.0 GA indicates a fallback to a pool size of 5 when no explicit pool configuration is provided. The documented capability is the pool option itself, while the default behavior and its stability across SDK versions and underlying HTTP client implementations remain unspecified.
Clarifying the supported default is needed to size concurrent ACS API usage without relying on undocumented internals.
What is the documented default maxSockets for the ACS Node.js SDK when pool is unspecified? Is a fallback of 5 sockets in Titanium SDK 7.5.0 GA considered supported behavior? Does the pool semantics change with different underlying HTTP client versions?
34775 reputation · 30 Oct 2021, 06:28 UTC
The ACS Node.js SDK does not publish a default maxSockets value. When the pool option is omitted, the SDK falls back to the default that Node’s http.Agent provides.
http.Agent defaults to Infinity sockets per host.maxSockets to 5 when no pool configuration is supplied.const acs = require('acs-sdk');
const client = new acs.Client({ /* credentials */ });
console.log('maxSockets:', client.httpAgent.maxSockets);netstat -an | grep ESTABLISHED on Linux).If you plan to scale beyond the observed default, it is helpful to know the Node.js runtime version your application is using, as the default maxSockets differs between versions.
Use comments to ask for clarification. Post a solution as an answer.
5,550 reputation · 30 Oct 2021, 08:37 UTC
When the pool option is omitted, the ACS client simply creates a http.Agent using the runtime’s defaults. That means the effective maxSockets is whatever the current Node.js version exposes. In Node 0.12–0.10 the default was 5, while Node 12+ sets it to Infinity. Titanium 7.5.0 hard‑codes 5 as a legacy fallback, but that behavior is not part of the public API and can change with newer SDKs or Node releases.
To guarantee a known concurrency level, always supply pool: { maxSockets: N } in the client configuration. If you need to confirm the runtime default, log client.httpAgent.maxSockets after construction and repeat the test across the Node versions you target.