Skip to content
Back

Functions concurrent execution

  • 0
  • Self Hosted
  • Functions
Alex
31 Oct, 2024, 04:38

Please Help Appwriters

My project is in a scenariot where we need to automatically create two functions for each user we have. The purpose of these functions is to provide autonomous services for our users. Let's call the two functions A et B.

The A function can take up to 3 minutes to complete execution. The B function can take up to 1 minute to complete execution.

Both functions are triggered by CRON. For function A, it's every 5 minutes, and for function B, it's every 4 hours.

The problem is that I've noticed that not all the A functions manage to run, or sometimes the only run one after the another, starting with the first ones we've created. Only the very first functions we created manage to run every 5mins. The others have to wait indefinitely.

Assuming we have 1,000 users, it's clear that customers will almost never get their service.

We're plannig to have 600,000 users. That's 600,000 x 2 appwrite functions == 1.200.000 functions that need to execute every 5 mins.

I'd like to know how we can set up parallel execution of the functions.

We are self-hosting and have the ability to grow server specs at will.

Thank a lot

TL;DR
Developers need help setting up parallel execution for two functions (A and B) triggered by CRON on their app. Function A takes 3 minutes and function B takes 1 minute to complete. Currently, only the initially created functions run every 5 minutes, causing delays for the rest. With plans to scale to 600,000 users, the concurrency issue needs to be resolved. They have the ability to upgrade server specs.
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