System Settings
When creating actions or debugging issues, it is important to know the system settings and limitations. Here are the ones you should consider when designing your actions.
429: TOO MANY REQUESTSX-OW_EXTRA-LOGGING: on per namespace per minute. If exceeded, the error is 429: TOO MANY REQUESTS429: TOO MANY REQUESTS429: TOO MANY REQUESTSSequences and Timeout
Sequences that are invoked in a blocking manner (for example web actions have a hard limit for timeout and this limit can't be changed 60 seconds). Essentially, adding up the execution time taken by each action has to be 60 seconds or less.
Although the system lets you set a higher timeout on the sequence, this value is ignored and the 60 seconds limit per action is enforced.
If one of your actions needs more than 60 seconds, then the only solution is to invoke a non-blocking action using the OpenWhisk npm module. So, using the same example, you could have actionA calling another action in a non-blocking manner. You can see an example of how to do this here.
Using pre-warm containers or optimizing against cold-starts
You can maximize your chances of having the best low latency possible by creating actions that use the default Node version and a memory setting that is 256MB, 512MB, or 1024MB - this way you avoid cold-starts in most cases.
The system has a pool of containers with these settings waiting to be used for any incoming call that can't be sent to an existing running container and the action matches the container settings (Node version and memory setting). In this scenario, time will only be spent for injecting your action code as opposed to wait for both creating a container and then get the code injected.
Timeout
If you want to change the default timeout setting, you need to do it explicitly. This is how you increase the timeout to 5 minutes: aio rt:action:create action-name source.js -t 300000
When you plan on increasing the timeout to more than one minute, you should be aware of:
- Blocking calls (web actions for example) will timeout in one minute regardless of the timeout set and return an error to the caller. However, the action execution continues until it finishes or the timeout value is exceeded (at this point you get a developer error as the result). You will retrieve the result by polling for activationId and use the right activationId to get the result
- Async calls respond immediately with an activationId. The execution continues, until the work is done or the timeout value is reached
Activations TTL
The activation TTL (Time To Live) is seven days. This is a system setting, not a user setting (it can't be changed by developers).
Thus, if you don't see any activations or not seeing an activation you know that has happened, it could be that they happened more than 7 days ago.