Error message when running a service: FunctionEvalTimeoutError: Eval timeout - function took too long to execute (>2000ms)

Hi, I’m trying to set up a service and I kept getting this error once in a while yesterday on the service console log. Today however I keep getting this error all the time and it is impossible to run the service. I’m running it scheduled and I’m having troubles trying to debug it. Do you know what can be the source of this error? The service has to load plenty of data and it would be difficult to reduce the amount of data, so I’m hoping that’s not the issue here.
Thank you for help!

Hi Maciej!
The first thing to check in this case would be function properties in classes that your service uses. If the dataset is large even simple functions like Full Name on a user can cause issues. If your service doesn’t need these properties, you can use the Skip Function Properties option on your data source.

image

You can read more about app optimization in our docs.

Just worth mentioning that there is nothing in the release that should change this behaviour. After the previous release, the “FunctionEvalTimeoutError” should occur less often.

Try the above tip from Joanna and check if it improved! The error is typically seen when reading a lot of data in services, and there are function properties being evaluated (timing out).

Thanks for the replies, I already had skip function properties turned on and I’m also referencing all the data sources I can. Only deleting one of the data sources helped and I’m hoping it won’t be crashing when more data is loaded in production. I just really wish there was an option to raise this 2000ms timeout, because the execution time is not a concern to me here

It’s possible that the timeout limit will be reevaluated at some point, but we don’t see it as a sustainable solution to the problem: independently of the limit, there will always be a case of someone exceeding it, so we’d end up in an infinity loop :wink:

Skip Function Properties should resolve the issue for most cases, but there are a couple more things worth looking into:

  • Use runtime data sources whenever possible
  • When iterating, avoid bigger functions inside of the loop
  • Note that for operations like updating or persisting objects, you can expect better performance when all objects are persisted in 1 operation, rather than persisting each object inside of an iterator
  • Make sure you are not loading data sources you don’t really need (especially if they include function properties)
  • Nested data bindings should be avoided, as these generate database-connected data sources that can impact the performance significantly

Hope this is useful.