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.

Distinguished Engineer, Serverless / FaaS & IBM Cloud Functions Chief Architect

More How-tos stories
December 13, 2018

Java Microservices with MicroProfile – API Documentation

To benefit from the reuse and consistency microservice APIs offer, other developers will need guidance to use your APIs correctly. With annotations defined in the MicroProfile OpenAPI specification from Java EE, it's easy to generate clear documentation.

Continue reading

December 13, 2018

Tutorial: Deploying the Jenkins Helm Community Chart on IBM Cloud Kubernetes Service

The IBM Hybrid Cloud Team has authored a tutorial that will guide you through the steps required to set up and install a Jenkins server and deploy a sample Node and React application on IBM Cloud Kubernetes Service.

Continue reading

December 12, 2018

Deploying to IBM Cloud Private 3.1 with IBM Cloud Developer Tools CLI

IBM Cloud Developer Tools CLI version 2.1.12 adds deployment support for IBM Cloud Private 3.1.

Continue reading