# Timeout - function took too long to execute

**URL:** <https://community.appfarm.io/t/timeout-function-took-too-long-to-execute/421>\
**Category:** Ask the community\
**Created:** [April 20, 2023, 8:35am UTC](https://community.appfarm.io/t/timeout-function-took-too-long-to-execute/421 "2023-04-20T08:35:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lequeuxa](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/lequeuxa/32/128_2.png) [@lequeuxa](https://community.appfarm.io/u/lequeuxa)\
**Post date:** [April 20, 2023, 8:35am UTC](https://community.appfarm.io/t/timeout-function-took-too-long-to-execute/421/1 "2023-04-20T08:35:31Z")

</div>

Hi Appfarm,

For Jerouville solution (as well as for Cocottes), we experience the following error in our services action “Timeout - function took too long to execute”.  
Sometimes it will work without any problem and sometimes this error will be triggered, what can we do?

Thanks

---

<div class="post-metadata">

**Author:** ![anon32498448](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@anon32498448](https://community.appfarm.io/u/anon32498448)\
**Post date:** [April 20, 2023, 10:52am UTC](https://community.appfarm.io/t/timeout-function-took-too-long-to-execute/421/2 "2023-04-20T10:52:11Z")

</div>

Hi,

a few questions: can you give us some hints on what these Services are doing:

- what action nodes are you using?

- how are you manipulating the data?  
etc.

- has this been an ongoing issue or started happening recently?

Maybe this post might be useful:

> [@Error message when running a service: FunctionEvalTimeoutError: Eval timeout - function took too long to execute (\>2000ms)](https://community.appfarm.io/t/error-message-when-running-a-service-functionevaltimeouterror-eval-timeout-function-took-too-long-to-execute-2000ms/290/5):
>
> 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 oper…

---

<div class="post-metadata">

**Author:** ![lequeuxa](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/lequeuxa/32/128_2.png) [@lequeuxa](https://community.appfarm.io/u/lequeuxa)\
**Post date:** [April 20, 2023, 2:09pm UTC](https://community.appfarm.io/t/timeout-function-took-too-long-to-execute/421/3 "2023-04-20T14:09:15Z")

</div>

Hi,

Ok thanks, created in runtime instead of directly in DB, eventhough in service and it solved the issues.

Did not know that and will have an eye on it next time.
