That's actually a very good question
If the function is run through the worker it seems that is going to work in FIFO style I'm still looking into it
Let's see if we get any official answer
yes, you are correct. At the moment, each worker handles events serially. we're planning on releasing a proxy layer in front that can make it easier to scale
actually...you can already scale by adding additional workers...it's just that the executor might be limitied...
So for now if let's someone is execution function from the client SDKs then it will also execute only serial mode?
So that mean in order to create more dynamic open-runtime instances we need to add more executor workers? That make sense
only queued executions execute serially. synchronous executions execute concurrently (createExecution(async = false)
)
But I didn't see any option to scale up for direct function execution
I've tried and never was able to pass the 10 concurrently functions call at given time
After that the functions runtime crash for a minute before it can run again, look like some bottle neck. The function it self is a very simple. Takes usually > 300ms to execute.
Tested on a 4GB RAM & 2 vCPU server with no limit on function container creation
Is that mean that the only option is scale the Appwrite main container?
Hey @Steven Can't say I follow the whole conversation. Can you explain queues and synchronous executions and what, if anything, can i do to minimize the impact of this serial execution
Also any details you can share as to when this limitation might get looked into ?
A workaround I can imagine is to deploy the same function multiple times and have a master function distribute work and assign it to idle function
That's sound a bit a trouble And if you're using Docker Swarm to deploy Appwrite as service stack then you can scale the number of the appwrite-worker-functions and then as I understood more container will be create with the same function and will disturbed across all the Docker Swarm machines
how many cores? i think the executor can only handle a handful of concurrent requests per core.
2
functions are either executed asynchronously or synchronously. If createExecution()
is called with async
= false
, then the execution is synchronous (see https://appwrite.io/docs/client/functions?sdk=web-default#functionsCreateExecution). any other method is asynchronous, including cron and events
So scaling the appwrite:
container will results more function being create?
And
Is there a way to run them 5-10 at time and the rest will be queued like PHP-FPM? I've just tested one of my published laravel SaaS and on server that cost 5 bucks it was able to handle 250 requests in 5 seconds
I mean that's make sense but it means that the second the app is getting a bit bigger then it will required immediate scaling
how exactly are you executing the functions?
In this case I've just run test of project I have This is the code
const functionRes = await functions.createExecution('[ID]', slug.toString());
I've benchmarked it in the simple way available,
- I've disabled the rate limits protector
- opened 50 tabs of the same window Then...
I've also tried within loop etc,
If I await between the function meaning creating "queue" then all the function will execute in < 300ms each But the second I run them together, then after 5 I lose the function for at least 1 minute
I will open new support topic for it
lose the function for a minute? because the function takes time to execute?
Yes after few execution (5-10) each function takes much longer to execute.
Hi - @Berserker , do you need any more help here?
@joeyouss i think I'm done thanks for the support :appwritepeepo:
Recommended threads
- Error When load the website
Hi, I am getting this error whenever I reload my website please help me, I am using react Error: ** GET https://cloud.appwrite.io/v1/account 401 (Unauthoriz...
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...