I have a python runtime function that is making API calls to 3-4 external services, and the slowest of them can take about 15 seconds to respond.
This function can be called through the frontend quite often (I can have hundreds of simultaneous calls)
To simulate, I added a simple time.sleep(15) to a test function, and called this function execution x num of times in parallel.
Looks like the function cannot handle more than 4 (amount of cores in my instance) requests. i.e. at a time only 4 requests can be executed, which means the cores are tied up when this call is made, which is expected.
However, apparently I can't use await asyncio.sleep because python worker definition is not async.
This is quite different from node runtime. I added a sleep function there, and due to the nature of node event loop, it allowed me to execute 100 functions at once.
Looking for suggestions on how to improve this number in python runtime.
Recommended threads
- Hosting Issues with Static IP not domain...
I have a machine with Static Public IP. I want to host Appwrite Site on it but I tried it but it doesn't allow IP addresses in Domain names. What should I do h...
- encrypt and decrypt buckets
I have a bucket where I switched from encryption to not encrypting files. I later realized that files already uploaded earlier stay encrypted. Now I have a buck...
- Unable to Create Storage After Upgrading...
We upgraded our Appwrite instance from version 1.8.0 to 1.9.0 and successfully ran the migration process. However, after the upgrade, we are no longer able to c...