#Synchronous function execution timed out. Use asynchronous execution instead, or ensure the executio

1 messages · Page 1 of 1 (latest)

tough grove
#

Hi Appweite team !

I created an appwrite function in which I do API request to an AI server.
When request take long such as more than 30 secondes, the function execution fail and return below error, regardless of what timeout is set at function's setting page.
Synchronous function execution timed out. Use asynchronous execution instead, or ensure the execution duration doesn't exceed 30 seconds.\nError Code: 408

I call the function execution from another appwrite function using Node SDK.

I get this error when I call function execution with async => false.
I also get the error when I call the function execution using REST API (axios call to the functions's domain)

When I call the function execution with async => true, the execution hang at step "waiting" for up to 10mins or 15mins till I cancel the call then the execution pass to "processing" then "completed".

Appwrite version: 1.5.7
Appwrite node version: 12.0.1 (tried with 13.0.0 but getting import error)
SDK: Node 16 (tested with 18 and 20 also withe same result)

short grail
#

Oh wait, on self-hosted, all async executions are queued and processed serially

tough grove
tough grove
tough grove
short grail
short grail
tough grove
#

Okay I see

#

So please, to make it very clear again, if my functions are settled for cron execution every hour, and say I have 30 functions, they will be queued all ?
So, let's say each function take 2mins to finish execution, then all the 30 functions will take 2mins x 30 (60mins) to be processed all, as they are all queued ? Is it ?

ruby fable
#

You can increase how many can processed at the same time

#

In regards to async execution

#

Add this _APP_WORKERS_NUMto the appwrite-worker-functions container env

#

Add _APP_WORKERS_NUMto your env file including the amount of workers like _APP_WORKERS_NUM=4. In this case 4 worker will process your async execution at the same time