To ensure fair usage and optimal performance across users, the following execution limits are enforced:

FeatureLimitDescription
CPU Time per request30sMaximum CPU time allocated per request.
Active memory128 MBMaximum memory available to isolate instance.
Subrequests50Number of subrequests a script can make per request.
Script size10 MBMaximum size of the script code.
Startup time500msMaximum time to startup the script.
Environment variables per Script128Maximum number of environment variables per script.
Environment variable size2KBMaximum size of environment variable value.

The limits are designed to accommodate typical use cases under normal operating conditions and provide a fair execution environment for all users.

Edge Scripting environments have built-in flexibility to handle occasional spikes that exceed these limits. However, if a script consistently hits or exceeds these limits, it will be subject to termination or other throttling measures to maintain system stability and performance.

📘

Best Practices for Managing Limits

  • Optimize Script Performance: Regularly review and optimize your script's code to ensure it executes within the time and memory limits.
  • Manage Subrequests Efficiently: Design your scripts to minimize the number of subrequests. Cache responses whenever possible to reduce load and improve response times.
  • Monitor and Log: Utilize logging and monitoring tools to track your script's performance and resource usage. This can help in identifying potential issues before they lead to limit violations.

CPU Time

CPU time is measured when script actually uses CPU to execute script logic. It directly affects how quickly a script can respond to requests. It is allocated per request, ensuring that each script execution has a fair amount of processing time.

The platform is designed to be forgiving for infrequent spikes in CPU usage; however, consistent exceedance will lead to script termination. This enforcement helps maintain the health of the system and ensures fair resource allocation across all scripts running on the platform.