Execution environment and rate limits
This article provides information on the functions execution environment, rate limits, and execution limits.
On June 15, 2024, we will introduce limits on log messages allowed per function per account and on the total log messages allowed per account for all functions. For more information, see Function limitations.
Execution environment
The functions execution environment is built on the GraalVM JavaScript runtime and runs ECMAScript 2020 compatible code.
Function limitations
- Functions cannot use third-party libraries except the libraries listed in APIs and libraries for functions.
- Functions have 32 MB of memory.
If a function attempts to use more than 32 MB, the following error is written to the log:
Exception 400 BAD REQUEST - OutOfMemoryError: memory limit 32 mb is exceeded.
- Maximum function size is 64 KB, which is approximately 1500 lines of code.
Functions larger than 64 KB cannot be saved until the size has been reduced. - Function log messages are limited as follows:
- Limit per function per account: 5MB of log messages per minute. If this limit is reached, logging for the function is throttled for 1 minute. When a function is throttled, information messages are not written to the log. Error and warning messages continue to be written to the log. Full logging resumes after 1 minute.
- Account limit for all functions: 50MB of log messages per minute. Currently, logging will not be throttled. If this limit is exceeded, Tealium may request that you limit the number of log messages.
Runtime Versions
The execution environment for functions, referred to as the runtime version, varies depending on the function type, as follows:
- Data Transformation Functions – The current runtime version is Transformation V0. For more information, see About Data Transformation Functions.
- Event and Visitor Functions – The latest runtime version is Action V3. Existing functions use Action V2, which is deprecated. For more information, see the following:
The runtime version for a function is shown in the code tab of the code editor, as shown below:
Runtime versions may be updated to provide new features. When a new runtime version is available, a message similar to the following is displayed on the Functions Overview page:
As Tealium releases new runtime versions, older versions will be deprecated, and will eventually become obsolete. A message is displayed on the Functions Overview screen and on the Code tab for a function when the runtime version in use is deprecated or becomes obsolete.
Execution time limits for data transformation functions
Data transformation functions have the following execution limits:
- 1 hour of execution time per minute OR
- 250,000 invocations per minute (15 mm per hour)
- 150 milliseconds of execution time for each function invocation
If a function exceeds the 150 milliseconds execution time, the following error is written to the log:
Invocation timeout limit of 150 milliseconds is exceeded
These execution limits are based on the account and the region. The sum of the execution time and the number of invocations for all functions in an account for a region cannot exceed these limits.
If either limit is exceeded, function execution is briefly stopped (throttled). The following message is displayed in the Functions Overview and a yellow alert icon is displayed next to a throttled function, as follows:
For information on how to view details for throttled functions, see View function statistics.
Execution time limits for event and visitor functions
Event and visitor functions have the following execution limits:
- Execution rate: 180,000 events per minute
- Execution time: 8 hours per minute
- Execution time for each function invocation: 10 seconds
If a function exceeds the 10 seconds execution time, the following error is written to the log:
Exception 504 - Invocation timeout limit of 10000 milliseconds is exceeded.
Execution rate and execution time: example 1
In this example, we assume that function that communicates with external APIs takes about 100 ms per invocation. In addition, we assume there is only one function configured for the account and the average execution rate of this function is 1000 invocations per second.
The execution rate and execution time within a 1-minute time window are as follows:
Execution rate = 1000 * 60 * 1 min = execution rate of 60,000 invocations per minute
Execution time = 1000 invocations/second * 100 ms / 1000 = 100 minutes = 1.66 hours execution time per minute
In this case, the execution rate and execution time are both below the limits.
Execution rate and execution time: example 2
In this example, we assume that external API performance temporarily degrades, and the function execution time is 800 ms per invocation. That means that our execution time is increased by 8.
Execution time = (1000 inv/s * 100 ms / 1000) * 8 = 800 minutes = 13.28 hours of execution time per minute.
The execution time in this case is 13.28 hours per minute, which is greater than 8 hours/minute maximum. Function invocations may be throttled.
This page was last updated: May 1, 2024