NetSuite has put internal mechanisms in place to detect “runaway scripts” that include infinite loops. Once caught, these scripts will be terminated and an SSS_INSTRUCTION_COUNT_EXCEEDED error message is thrown. Should you receive this error, NetSuite recommends that you examine the for loops in your script to ensure that they contain either a terminating condition or a condition that can be met.
You also may want to consider the below points
NetSuite governs the use of
nlapiLogExecution(type, title, details)
The governance model is meant to safeguard against unreasonably excessive logging, which can negatively affect performance for other NetSuite customers sharing the same database. The governance model is not meant to impact companies (or scripts) that are using nlapiLogExecution()
appropriately.
The governance model is as follows:
Within a 60 minute time period, a company is allowed to make up to 100,000 calls to nlapiLogExecution() across all of their scripts.
If within a 60 minute time period NetSuite detects a given script is excessively logging (and pushing a company close to the 100,000 nlapiLogExecution() call limit), NetSuite will change the offending script's log level to the next level higher. The offending script will continue its execution, however, its log level will go from Debug to Audit, or Audit to Error, or Error to Emergency, depending on the script.
The capacity for script execution logs is shared by customers on the same database. For further protection against excessive logging, script execution logs are governed by a total storage limit on each instance of the NetSuite database. On each NetSuite server, if the database table that stores logs reaches this limit, all logs (across all customers on that server) are purged. For this reason, NetSuite recommends that you store information using custom records.
Example
Company ABC has 10 scripts running during a 60 minute period. If one out of the 10 scripts calls
nlapiLogExecution('DEBUG', 'My log', x.getID())
70,000 times within only a 20 minute time period, NetSuite will raise the script's log level.
The change to the log level will appear in the Log Level field on the script's Script Deployment page (see figure). In the figure below, if the offending script's Log Level was originally set to Debug, NetSuite will increase the log level to Audit. This means the line of code that reads
nlapiLogExecution('DEBUG', 'My log', x.getID())
will continue to execute, however nothing will be logged, as the log level for the script has been raised to Audit.
Script Owners Are Notified
If NetSuite detects that one script is logging excessively, the owner of the script is notified. The script owner is alerted that the script is the primary contributor to his or her company possibly exceeding the 100,000 logging threshold (for a given 60 minute time period).
NetSuite sends notifications through email and adds a log entry to the script's Execution Log. Both the email and the NetSuite-generated log alerts script owners that a script's Log Level has been increased.
Reference : Netsuite Help Center [ Governance on Script Logging ]