Rank 3: Container
Ooh ok good to know thank you. What do you think about doing it through graphql endpoint would it be the same problem?
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 3: Container
Ooh ok good to know thank you. What do you think about doing it through graphql endpoint would it be the same problem?
Admin
yes, same problem
Admin
if your function isn't being run very often, it could be killed due to inactivity and so the next time it gets executed again, it has to do a cold start which takes a little longer. warm starts (runtime container already exists) should be quick, though
Rank 3: Container
Sorry for my late reply’s Steven, but what do you mean by „runtime container already exists“
Admin
If the runtime container doesn't need to be started up again, it will execute faster
Rank 3: Container
Ok and how to ensure that
Rank 3: Container
Can it be done by setting the restart policy of functions container or maybe also setting a container orchestration platform
Admin
One thing you could do is set the inactivity threshold env variable to something higher
Rank 3: Container
Would it be enough to set it higher?
Rank 3: Container
Right now all the containers are running in my nas so could it also be somehow connected to the performance of my nas i mean if i put my Appwrite instance in a more performant server would it then make some differences?
Admin
Maybe...hard for me to say. I would check the resources used by the containers to try and gauge that
Rank 3: Container
Ok so calling the function to do these tasks is the only and safest way?
Admin
Not necessarily... Just don't put the API key client side
Rank 3: Container
Ok so what if when i put it in .env file
Admin
As long as it doesn't end up client side
Rank 3: Container
Ok i inderstand
Rank 3: Container
Is it possible to run the appwrite instance in kubernetes? I know their is a possibility to run it in Docker Swarm bit can it be also run in kubernetes maybe running it in docker swarm or kubernetes will be fast enough
Moderator
Not possible, also doesn't seems to be needed using kubernetes
Moderator
Seems it's slow due to your hosting specs (usually home NAS don't come with powerful CPU and too many ram) but not sure
Moderator
If you're running simultaneously functions from the same client, it will be needed ending/completing a function trigger before triggering another. If you want to run 2 simultaneously sent from the same client you should enable async. Note that if triggered from 2 different clients, they will run simultaneously by default
Moderator
@Faisal7 approximately what are the specs of the NAS you're using? (Cores, threads, GHz, RAM)
Rank 3: Container
Yes i also taught so that due to my slow nas. The functions could also run a bit slower. It would be good if i bye some server for test and see the difference.
Rank 3: Container
I dont know but in my case it is like that. So with every user registration i call a function and for resetting a password another function. I dont know it could be simultinius and also not, depending on the user registration if many users somehow make a simultinius registration then yes, otherwise not. And the functions will be called from the same client everytime.
Rank 3: Container
I have this NAS https://www.synology.com/de-de/products/DS220+ and puted another 8 GB Ram by my self
Rank 3: Container
and the usage looks like this on my NAS