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
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...
- Can't login or deploy functions in Appwr...
Hello, since i updatet to the appwrite cli 6.1.0 i can't login or deploy functions with the cli. When i call the command: "appwrite get account --verbose" i ge...
- Create admin user?
I'm not really sure how this is supposed to work, I installed Appwrite through docker-compose and set it up. When I launched the app and went into it, I created...