Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: Cloud functions keep alive #2994

Open
2 tasks done
s3ppo opened this issue Mar 23, 2022 · 6 comments
Open
2 tasks done

🚀 Feature: Cloud functions keep alive #2994

s3ppo opened this issue Mar 23, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@s3ppo
Copy link

s3ppo commented Mar 23, 2022

🔖 Feature description

Hi all,

and first of all i love the new functions and also their speed :)

i run into a small problem with the cold start of sync functions.
if a function wasnt used for a longer time, it shuts the container down and the next start needs up to 5 seconds to bring a result to the app (UI).

so i think it would be very cool to have a option in the settings of a function where i can define a keep alive checkbox. if i check this, the shutwdown of the container does not happen and it would bring me faster responses to my front end.

or maybe a setting where i can define for how long i want the container warmed up.. for not critically performance or background task i can define 1 minute, and for sync functions that brings responses to the front end, i can define 24h.

please let me know if this is possible? :)

🎤 Pitch

pls see description :)

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@s3ppo s3ppo added the feature label Mar 23, 2022
@PineappleIOnic
Copy link
Member

Hey There 👋
Thank you for the pitch, it's a very cool idea!
While we are considering this I would like to note we already have an environment variable that allows you to set the inactive threshold for functions: _APP_FUNCTIONS_INACTIVE_THRESHOLD. It isn't separate for sync and async functions though as internally they both act very similarly.

@s3ppo
Copy link
Author

s3ppo commented May 13, 2022

@PineappleIOnic
thanks for your answer, yes this is true and also use it at this moment this way. but if i set the threshold to 24h theres still the first call of the day pretty slow, so this is a bad user experience in my mind ;)

also i think i dont need it for all my functions, just for special functions that brings data to my front end.. with threshold paramter its active for all my containers.. and i also its not available in the appwrite console, which is also a bad user experience ;)

@gewenyu99
Copy link

@PineappleIOnic thanks for your answer, yes this is true and also use it at this moment this way. but if i set the threshold to 24h theres still the first call of the day pretty slow, so this is a bad user experience in my mind ;)

also i think i dont need it for all my functions, just for special functions that brings data to my front end.. with threshold paramter its active for all my containers.. and i also its not available in the appwrite console, which is also a bad user experience ;)

I think we can consider having this be a console setting, per container. CC: @PineappleIOnic

@Ruboka
Copy link

Ruboka commented Nov 28, 2023

Is setting this per function now possible? Or is the docker environment variable still counting for all project functions?
Also this feature customizing individual functions could be applied to available memory and cpus etc too. _APP_FUNCTIONS_MEMORY ; _APP_FUNCTIONS_CPUS More or less all variables from the env file.

@stnguyen90 stnguyen90 added enhancement New feature or request and removed feature labels Mar 20, 2024
@eldadfux
Copy link
Member

@s3ppo what runtime are you using that takes 5 second to cold start?

@s3ppo
Copy link
Author

s3ppo commented Mar 30, 2024

@s3ppo what runtime are you using that takes 5 second to cold start?

Was in an older release now its about 200ms on a cold start versus 2ms on a warm start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants