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.

Time limit

Functions are limited to 60 seconds of elapsed run time by default. These limits can be modified on the function configuration page.

Functions are allowed to run for up to 280 seconds when running in live preview, even if modified on the function configuration page.

TypeScript v1 functions are additionally limited to 30 seconds of CPU time, which is not configurable. When a function exceeds this threshold, the cause is often inefficient data loading logic. Refer to the section on optimizing performance for tips on how to avoid CPU timeouts.

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 TypeScript v2 and Python functions, you can use multithreading with the built-in Node.js worker_threads and Python threading libraries.

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.