How-tos

IBM Cloud Functions: we’re doubling the time limit on executing actions

Share this post:

If you work with Cloud Functions, you know that building serverless applications mainly happens by creating actions–small pieces of code that each do one thing well.

You can of course sequence actions together or create event-driven workflows.

Through our work with customers, we have realized that some scenarios (for example, image processing, file processing, data pipelines) require more time to execute than the 5 minutes allowed.

Sure, being clever, you have figured out some tricks to get around the time limit–for example, by handing over state as part of invoking actions in sequence. In many situations, though, there either are no workarounds or increasingly tortuous ones. And in any case, the need to invent workarounds tells us it’s time for a change.

So based on that experience, we’re happy to announce that we have doubled the maximum time for executing an action from 5 to 10 minutes.

Keep in mind that any timeout value currently set on existing actions remains the same. You must manually change those, if change is needed.

Setting the timeout (CLI)

You use the ‘timeout’ parameter to set or reset the timeout for an action. These examples show how to do it via the CLI. Though the sample actions are in Node.js, the commands work exactly the same for actions in any other code language.

To set the timeout on a new action to 10 minutes, you add the ‘—timeout’ parameter to the ‘bx wsk action create’ command, setting the timeout value (in milliseconds):

bx wsk action create myNewAction myNewAction.js –timeout 600000

Similarly, to reset the timeout value on an existing action to 10 minutes, you add the ‘—timeout’ parameter to the ‘bx wsk action update’ command, again setting the value (in milliseconds):

bx wsk action update myExistingAction myExistingAction.js —timeout 600000

Setting the timeout (Web)

In the IBM Cloud web console, it takes just a few clicks to set a timeout:

  1. Use the navigation control (top left) to select Functions.
  2. Click Actions.
  3. For the relevant action, click the value under Timeout. The Runtime page opens.
  4. Type in a value (in seconds) or use -/+ to make small adjustments.
  5. Click Save.
More How-tos stories

Configuring IBM Cloud App ID From the Toolchain

Learn how to configure the IBM Cloud App ID from a toolchain as part of continuous delivery process. This post gives some background and the script we use.

Continue reading

How to Backup Your IBM Cloud Linux Server

This post covers how to backup entire partitions in Linux systems. The process utilizes the tar command in IBM Cloud's unique rescue environment and showcases the simplicity and flexibility of the process.

Continue reading

Speed up your WordPress with IBM Cloud

WordPress is one of the most popular content management systems available, but the many websites and blogs that use it experience issues with speed. At IBM Cloud, there are several solutions that can help alleviate some of these issues and allow you to have a better and faster WordPress experience.

Continue reading