When we create a report, it will trigger the cloud function. Now, when we try to spam the button like we will click to many times. It will trigger the cloud function many times. Now some cloud function cannot be done until the other function's execution is done.
The result of this, some cloud function will 'Executed Timeout' Because there are 50 execution are pending that is why the other will be 'Executed Timeout'. I need your help to scale up our cloud function:
_APP_FUNCTIONS_TIMEOUT=900 _APP_FUNCTIONS_BUILD_TIMEOUT=900 _APP_FUNCTIONS_CONTAINERS=10 _APP_FUNCTIONS_CPUS=0 _APP_FUNCTIONS_MEMORY=0 _APP_FUNCTIONS_MEMORY_SWAP=0 _APP_FUNCTIONS_RUNTIMES=node-21.0,node-18.0,bun-1.0 _APP_EXECUTOR_SECRET=your-secret-key _APP_EXECUTOR_HOST=http://exc1/v1 _APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes _APP_FUNCTIONS_ENVS=node-21.0,node-18.0,bun-1.0 _APP_FUNCTIONS_INACTIVE_THRESHOLD=60
These are the environments is there a variable need to be update? IN the image attached that is the resources we subscribe
Cloud functions triggered by events are run in async. There can only be one async execution run by default. Add this line - _APP_WORKERS_NUM=12 to appwrite-worker-functions in docker-compose.yml. I used the value 12 only as an example, you can set any other value. That value will specify how many async execution can be run at the same time
Also, DO is hella expensive lmao
Also, you can create replicas of the appwrite-worker-functions container
what is Do?
Digital Ocean
what can you suggest? that has SIngapore server
Yeah APAC region tend to be a lot more expensive
Hetzner
You can use hetzner. They just launched a singapore location a few weeks back
okat thank you guys.
appwrite-worker-functions: image: appwrite/appwrite:1.5.10 entrypoint: worker-functions <<: *x-logging container_name: appwrite-worker-functions restart: unless-stopped networks: - appwrite depends_on: - redis - mariadb - openruntimes-executor environment: - _APP_ENV - _APP_WORKER_PER_CORE - _APP_OPENSSL_KEY_V1 - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER - _APP_REDIS_PASS - _APP_DB_HOST - _APP_DB_PORT - _APP_DB_SCHEMA - _APP_DB_USER - _APP_DB_PASS - _APP_FUNCTIONS_TIMEOUT - _APP_FUNCTIONS_BUILD_TIMEOUT - _APP_FUNCTIONS_CPUS - _APP_FUNCTIONS_MEMORY - _APP_EXECUTOR_SECRET - _APP_EXECUTOR_HOST - _APP_USAGE_STATS - _APP_DOCKER_HUB_USERNAME - _APP_DOCKER_HUB_PASSWORD - _APP_LOGGING_CONFIG - _APP_LOGGING_PROVIDER
Found this on docker-compose
basically
I will put this - _APP_WORKERS_NUM=12 under of _App_loging
am I right?
Yes
then command the docker-compose build?
or I need to down?
docker compose up -d
alright thank you
how can I scale the MariaDb?
in regards with storage and messaging worker is it okay to set a numbers of worker?
First, just add more resources to the machine when needed (vertical scaling) Then separate the MariaDB from the appwrite container and instance into another machine (decentralisation). After that, if you still need going further, you will need to scale the DB horizontally with a Galera cluster or MariaDB Maxcale
I recommend this guide made by Binyamin (now core member): https://book.appread.io/
I see I will read that thank you for your guidance sir
Recommended threads
- SyntaxError: The requested module 'node-...
I am trying to use appwrite functions and in the function i am creating rows but i got this error when i executed the funtion. As i checked docs there TablesDB...
- Getting error when trying to add domain ...
we use self hosted appwrite on my company and every single time ever I tried to add a domain it shows this error on the top rigth: "Cannot read properties of un...
- Using OTP Email to verify user for passw...
Has anyone ever implemented this? If you did what was your aproach? Did you write an appwrite function?