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
September 19, 2018

Tutorial: Apply End-to-End Security to Cloud Applications

A new tutorial will show you how to use IBM Cloud services to secure your cloud application. Capture and review security-related events, encrypt storage, integrate authentication, and more.

Continue reading

September 18, 2018

How To Convert CSV Objects to Parquet in Cloud Object Storage

If you're looking to lower storage costs by compressing your data and get better query performance when querying the data in Cloud Object Storage, you may want to click to learn how to convert CSV objects to Parquet.

Continue reading

September 17, 2018

How To Consolidate PostgreSQL Data to IBM Cloud Object Storage for IBM Cloud SQL Query

Consolidating PostgreSQL data into a durable and highly reliable data storage service like IBM Cloud Object Storage will not only reduce costs, but it provides a flexible, durable, and scalable solution for storing all sorts of unstructured data.

Continue reading