Back

how to use _APP_FUNCTIONS_CONTAINERS environmental variable ?

  • 0
  • Functions
steve jobs
17 May, 2023, 09:33

if i change _APP_FUNCTIONS_CONTAINERS to 50 , what does that mean?? will be able to run 50 instance of a cloud function simultaneously ??? what's the maximum i can increase it to ? is it only dependent only on the server specifications?

TL;DR
The _APP_FUNCTIONS_CONTAINERS environmental variable determines the number of containers that Appwrite can keep for functions. For example, if you have 10 functions and set the value to 10, Appwrite will not create more than 10 containers. When a new function triggers and there are already 10 containers, Appwrite will shut down one of the existing containers. It is limited by the server resources available. Currently, it seems that this environmental variable is not being used in Appwrite. Changing the value of _APP_FUNCTIONS_CONTAINERS may not have any effect. If you have more questions or need further clarification, it is recommended
safwan
17 May, 2023, 09:55

I'm not a 100% sure what the env variable is responsible for even after reading the docs. So i'd suggest you wait for a dev to reply πŸ˜„

Binyamin
17 May, 2023, 11:46

As of now it doesn't seem like this variable is being used.

Anyway the purpose of this variable is to determinate how much containers Appwrite is allowed to keep for functions. For example if you have 10 functions, then no matter how many execution each function will have, Appwrite won't create more then 10 containers, as each function gets one.

But if let's say you had 20 function and the value set to 10 then when the 11th function will trigger Appwrite will shutdown one of the other containers,

Also, it's limit only by our imagination and server resources.

But, from what I see it's not being used so it's all just theory

steve jobs
17 May, 2023, 16:19

is there a way to create 2 or more containers for each function?

steve jobs
17 May, 2023, 16:20

πŸ˜…

steve jobs
17 May, 2023, 16:20

i mean , to make it scalable.

Binyamin
17 May, 2023, 16:20

Got you

Binyamin
17 May, 2023, 16:21

Not out of the box

Binyamin
17 May, 2023, 16:21

You'll need to create Docker swarm and scale the Appwrite executor You can see few details about it here https://discord.com/channels/564160730845151244/1092607057535963206/1092607057535963206

Binyamin
17 May, 2023, 17:17

At the time Christy Jacob has created a guide on how to scale Appwrite using docker swarm https://dev.to/appwrite/30daysofappwrite-docker-swarm-integration-2io9 It's a bit outdate but can give an overview

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