Skip to main content
All CollectionsRealm
Why do I get an execution timeout error with my App Services function?
Why do I get an execution timeout error with my App Services function?

Understand Realm function timeout error and resolution

Clevyyy avatar
Written by Clevyyy
Updated over a year ago

App Services functions have a 90 second timeout, which may cause an execution timeout error if your App Services function runs for longer than this window.

You can confirm the issue by navigation to App Services Application Logs, selecting Function > Type and Error > Status in the filter bar, and clicking Apply. Search for the log entry containing timeout and observe if the Time Taken column returns a value of around 90 seconds.

Reducing function execution time resolves this issue. Here are some solutions:

1. Optimize the query to reduce the total number of scanned documents per query by:

2. Apply App Services filters on the collection in your Realm application, and configure them for best use.

3. Separate your current App Services function into several smaller functions. Then add these functions into an (outer) function and execute the smaller functions in parallel to reduce runtime. However, note that the outer function must still complete within 90 seconds. To debug, you can add timing messages to the log after each smaller function block and review their execution times to understand where timeout occurs (see Troubleshooting App Services Functions for more information).

There is no way to extend this runtime limit currently. However, we periodically re-evaluate this request. Follow this feature request post for more information.

Did this answer your question?