
I'm trying to create faction which fetch data from database and return value according to that now I was thinking that if 20 user execute function at the same time then 20th person will get the response after the all 19th execution completed !?

Yes. If the server is powerful you won't notice a thing

And since Appwrite cloud will spin up more containers to handle the load you really do not have to worry about that

then i wonder, how could be this happened:
i tried, execute using domain and this function contains 2s of sleep and i send request using postman to execute function so it was: 2.53s 3.75s 4.52s 8.30s 11.65s

i should get response in 2.53s in all

Because it runs in sync it needs to wait for the previous execution to finish before the next execution can run

If you run a function in sync you want to avoid such long function running times

thne what can i do?

Is that a theoretical question or are you currently being bottlenecked by that?

Are you assuming that your function are going to take 2s to execute?

<@760015106947022880> But are you self-hosting?

Not really but my project around 25 user it might make delayed in response my assumption

Cloud

That is not because of that but rather that your users are located in india

The servers are still located in germany

I do not think that 25 can max out the function cpus

the function's excution is average 500ms suppose 5 ppl are using the app at the moment then the last one will get response after 2.5s which is not really good i guess

hope you are getting my point

and this execution durations has big variation sometimes, 70ms/200/300 someties even 1s

What does your function do? What db operations does it use

Okay, Let me test once again

Execute using http? You mean the function domain?

That's odd it's within 5s on self host...maybe on cloud it was cold start for all the executions

Yes.

i tested it, it is working perfect now !
Recommended threads
- Unable to create push providers - FCM or...
Currently unable to create a push provider for FCM or APNS.... https://github.com/appwrite/console/issues/2045 When uploading a file... FCM = Valid file retu...
- Stuck in "deleting"
my parent element have relationship that doesnt exist and its stuck in "deleting", i cant delete it gives me error: Collection with the requested ID could not b...
- Help with 409 Error on Relationship Setu...
I ran into a 409 document_already_exists issue. with AppWrite so I tried to debug. Here's what I've set up: Collection A has 3 attributes and a two-way 1-to-m...
