setReusableSandboxOptions
The setReusableSandboxOptions() function configures the reuse of the same underlying sandbox for multiple requests, which can improve performance by avoiding the overhead of initializing a new sandbox for each request.
Syntax
setReusableSandboxOptions(options)
Parameters
options: Object- The configuration options for the reusable sandbox.
maxRequests: number (default:1,0means unlimited)- The maximum number of requests that can be handled by a single sandbox before it is recycled.
betweenRequestTimeoutMs: number (default: not specified)- The amount of time in milliseconds to wait between requests before recycling the sandbox.
maxMemoryMiB: number (default: no limit)- The maximum amount of memory in MiB that the sandbox can use before it is recycled.
sandboxTimeoutMs: number (default: no timeout)- The maximum amount of time in milliseconds that a sandbox can be active before it is recycled.
- The configuration options for the reusable sandbox.