SuiteScript Governance and Limits

NetSuite uses a SuiteScript governance model to optimize performance, based on usage units. If the number of allowable usage units is exceeded, script execution is terminated.

Usage units are tracked in two ways: by script type and by API. Each script type and each SuiteScript API has a set number of usage units.

In map/reduce scripts, keys are limited to 3,000 characters (specifically, in mapContext or reduceContext objects). You'll also see error messages if a key is longer than 3,000 characters or a value is larger than 10 MB. Keys longer than 3,000 characters will return the error KEY_LENGTH_IS_OVER_3000_BYTES. Values larger than 10 MB will return the error VALUE_LENGTH_IS_OVER_10_MB.

When using mapContext.write() or reduceContext.write(), keep your key strings under 3,000 characters and value strings under 10 MB. Also, consider the potential length of any dynamically generated strings, which might exceed these limits. It's also a good idea to avoid using keys to pass data -use values instead.

You can find governance limits for each SuiteScript 2.x API in their respective method topics. Methods are organized by modules, and all modules are listed in the help topic SuiteScript 2.x Modules. Also see SuiteScript 2.x API Governance.

Important:

SuiteScript thresholds are based on the volume of activity that a company's users can manually generate. However, automated functions that generate excessive levels of activity may trigger metering of script execution as referenced in the NetSuite Main Terms of Service (TOS).

See the following help topics for more information:

Governance limits are also enforced on certain aspects of script execution. When you run a search using the N/search module, the number of search results you receive is limited. There are also limits on how long a script can run, based on the script type. See the following help topics to learn about these limits:

Important:

NetSuite uses internal mechanisms to detect scripts that may include infinite loops when executing. When they occur, script execution is terminated and an SSS_INSTRUCTION_COUNT_EXCEEDED error message is thrown. If you receive this error, you should examine all of the execution loops in your script to ensure that they contain either a terminating condition or a condition that can be met.

Related Topics

General Notices