SuiteScript Governance Limits and Performance in NetSuite
Understand SuiteScript governance in NetSuite, focusing on usage units, script limits, and best practices for performance optimization.
NetSuite employs a SuiteScript governance model to enhance performance by managing usage units. This governance structure ensures that if your scripts exceed their allowable usage units, execution will be terminated, maintaining system stability.
Understanding Usage Units
Usage units in NetSuite are categorized by script type and API usage. Each SuiteScript type, as well as each API method, has a predefined number of usage units allocated to it. This ensures efficient resource management while executing scripts. For instance, when using map/reduce scripts, you must adhere to limits such as:
- Key Length: Limited to 3,000 characters. Exceeding this limit results in the error
KEY_LENGTH_IS_OVER_3000_BYTES. - Value Size: Limited to 10 MB, failing which you will encounter the error
VALUE_LENGTH_IS_OVER_10_MB.
Best Practices for Map/Reduce Scripts
When utilizing methods like mapContext.write() or reduceContext.write(), follow these best practices:
- Keep key strings under 3,000 characters.
- Ensure value strings do not exceed 10 MB.
- Aim to use values for data transfer instead of keys to optimize execution.
More details regarding usage limits for specific SuiteScript 2.x APIs can be found in the governance documentation for each method depending on their respective modules.
Governance Limits Beyond Usage Units
Limits also apply to various aspects of script execution, including:
- Search Results: The number of results returned by a search is restricted.
- Execution Time: Each script type is allocated a specific maximum run time, ensuring that no single process monopolizes resources.
For deeper insights into the governance features, review the following resources:
- Script Type Usage Unit Limits
- SuiteScript 2.x API Governance
- Monitoring Script Usage
- Governance on Script Logging
- Search Result Limits
- Script Execution Time Limits
By adhering to these limits and best practices, you can ensure your scripts run efficiently and without unnecessary termination due to governance violations.
Who This Affects
- Developers: Responsible for writing and optimizing SuiteScripts.
- Administrators: Overseeing script management and performance.
- Support Teams: Addressing issues related to script execution and governance limits.
Source: This article is based on Oracle's official NetSuite documentation.
Key Takeaways
- SuiteScript governance manages resource usage through defined limits.
- Keys and values in scripts must adhere to specified character and size limits.
- Governance also tracks execution time and search result counts to maintain system performance.
Frequently Asked Questions (4)
What is the limit for key length when using map/reduce scripts in NetSuite?
How can I optimize script performance using map/reduce scripts in SuiteScript?
What are the execution time limits for SuiteScript types?
How does NetSuite ensure resource management through SuiteScript governance?
Was this article helpful?
More in General
- Payment Date Prediction Feature in NetSuite
Payment Date Prediction in NetSuite utilizes machine learning to enhance financial planning by predicting invoice payment dates.
- NetSuite Ship Central Enhancements for Packing & Shipping
NetSuite Ship Central features enhance packing and shipping operations for improved efficiency and accuracy.
- Generative AI Features in NetSuite 2026.1
Discover new generative AI features in NetSuite 2026.1, enhancing reporting, search, predictions, and development productivity.
- Field Service Management Enhancements and Bug Fixes for 2026
Overview of the 2026 Field Service Management SuiteApp updates showcasing enhancements and bug fixes.
Advertising
Reach General Professionals
Put your product in front of NetSuite experts who work with General every day.
Sponsor This Category