Manage published functions

Once published, all types of functions can be viewed and managed using the Ontology Manager.

Searching for functions

To search for functions, navigate to the Ontology Manager and select the Functions tab. You can search for functions by most metadata on the function, including but not limited to the function name, description, API name and RID.

Search for functions in the Ontology Manager

Function overview page

After selecting a function in the Ontology Manager, you can view basic information about the function, including its inputs and outputs and any associated usage history for the function.

View function overview in the Ontology Manager

Function configuration page

Some types of functions allow you to configure resources such as timeouts or memory limits. If your function supports any configuration options, you can view and edit them in the Configuration tab. If this tab is not present, the function does not support any configuration options.

Configuration overrides are applied on a per-function version basis. Depending on the application from which you publish your function, new versions may have the default configuration and you may need to reapply any configuration overrides.

For example, you can configure the timeout on a TypeScript function as seen in the following image.

Manage function runtime configurations in the Ontology Manager

Configuration inheritance

Functions provide out-of-the-box support for inheriting configuration overrides when publishing new versions. The configuration is inherited from the prior stable version according to the semantic version specification. If publishing a non-stable version, configurations will be inherited from the prior version, regardless of whether it is a stable release.

Configuration inheritance requires your repository to contain updated template configurations. You can check the hidden templateConfiguration.json file to confirm the version your repository is on.

  • For TypeScript v1 functions repositories, you must have parentTemplateVersion >= 3.512.0
  • For Python functions repositories, you must have parentTemplateVersion >= 0.423.0

Enforced limits

Several limits are in place to prevent functions from consuming too many resources when they are executed. When running a function through live preview, all limits will follow the default configuration, even if limits are modified on the function configuration page.

Time limit

Each function execution is limited to a default of 30 seconds of CPU time. If loading data over the network, execution can run for up to 60 seconds by default. When a function times out by exceeding the threshold, the culprit is often inefficient data loading logic.

When using TypeScript v1 functions, refer to the section on optimizing performance for tips on how to avoid timeouts.

When using TypeScript v2 or Python functions, both deployed and serverless functions are limited to 60 seconds of elapsed run time by default, which includes 30 seconds of CPU time and a 30 second buffer for network delays. These limits can be modified on the function configuration page for both deployed and serverless functions.

Memory limit

Memory limits differ between TypeScript v1, TypeScript v2, and Python functions.

TypeScript v1

Function execution is limited to 128 Megabytes of memory usage. This limit is rarely reached; often, functions run into time limits or object loading limits before memory limits.

Deployed Python functions

Deployed Python functions have 2 Gigabytes of memory usage by default. Currently, deployed Python functions cannot configure memory usage on the function configuration page.

Serverless Python and TypeScript v2 functions

Serverless functions have 1024 Mebibytes of memory usage by default. This can be configured from 512 Mebibytes to 5120 Mebibytes on the function configuration page.

Multithreading

For TypeScript v1, function execution is on a single thread, allowing only one computation at any given time. However, you can parallelize loading of object sets or links. Refer to optimizing performance for more information.

For Python, function execution can use multithreading. You can parallelize work by using the built-in threading library.

Copied!
1 import threading

Object set limits with TypeScript v1

When using object sets, calling .all() or .allAsync() will throw an error if:

  • More than 100,000 objects are loaded at once from the object set. In general, even loading tens of thousands of objects will run into time limits or memory limits. For use cases where you are running into this limit, consider fetching summary data using aggregations or fetching a subset of objects using ordering and limiting.
  • More than 3 search arounds are used at once.

Some aggregation and bucketing operations have limits. See the aggregations section for details.