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.

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

More How-tos stories
March 20, 2019

Getting Started with the Couchbase Autonomous Operator on IBM Cloud Kubernetes Service

We're excited to be working with Couchbase Server to bring you this step-by-step guide to "Getting Started with the Couchbase Autonomous Operator on IBM Cloud Kubernetes Service."

Continue reading

March 12, 2019

Connecting to IBM Cloud Databases for MongoDB with Robo3T

We're going to show you how to connect to IBM Cloud Databases for MongoDB using Robo3T (formerly Robomongo), a popular GUI for managing your MongoDB deployments.

Continue reading

March 11, 2019

Increasing your Connections and Configuring IBM Cloud Databases for PostgreSQL

IBM Cloud Databases for PostgreSQL has just released two configuration settings that now give you control over your connections and prepared transactions in PostgreSQL.

Continue reading