Back

Multiple Function Workers

  • 0
  • Functions
ZachHandley
14 Nov, 2023, 17:32

Hey so I’m trying to figure out how to have more than one worker per function, so I can run say 5 or 6 simultaneously, rather than one at a time. The reason I need to do this is I’m using AuthNet’s SDK and their API calls sometimes can take a second (literally) and my thought is if 200 users sign in that’s 50-200 seconds, depending on speed, is there anyway to speed it up or allocate more workers or can we add that as an env variable?

TL;DR
Developers are trying to run multiple worker functions but are facing timeout errors. The issue may be caused by insufficient resources allocated to worker functions. Increase resources or scale the workers to resolve the problem.
ZachHandley
14 Nov, 2023, 17:33

I’d run their node SDK but it wasn’t working, so I’ve resorted to Python

D5
14 Nov, 2023, 17:34

I think there was a workers per core env var, maybe that's related? 🤔

ZachHandley
14 Nov, 2023, 18:11

Yeah I don’t think that’s what it is, I asked Steven about that

Drake
14 Nov, 2023, 19:33

you could try duplicating the appwrite-worker-functions service

ZachHandley
14 Nov, 2023, 19:37

So you guys have never tried it?

Drake
14 Nov, 2023, 19:40

some community members have

ZachHandley
14 Nov, 2023, 19:41

and I presume that's how they did it?

Fampv
30 May, 2024, 09:57

I'm trying to achieve the same thing, and have successfully duplicated the appwrite-worker-functions container 1 time so I have 2 of them. However when I start 5 of these, some function executions complete successfully but some fail because of this error (which is logged by the openruntime-executor container:

TypeScript
[Error] Type: Exception
[Error] Message: Internal curl errors has occurred within the executor! Error Number: 110. Error Msg: Operation timed out
[Error] File: /usr/local/app/http.php
[Error] Line: 1072

I have set _APP_FUNCTIONS_CPUS to the default of 0 and _APP_WORKER_PER_CORE to the default of 6.

Any idea what would cause this issue? Or am I missing something here?

Fampv
30 May, 2024, 10:00

Screenshot of the function execution UI:

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more