Rank 2: Process
I have a function that can handle 30 synchronous requests simultaneously. However, I’ve noticed that the worker function processes these requests sequentially, similar to a single thread handling multiple tasks by serving them partially. This method increases the total execution time and leads to uneven completion times for some calls. On the other hand, if I duplicate the same function across multiple deployments and distribute the calls among them, it could significantly reduce the execution time. In other words, creating multiple threads to handle the calls. However, this would involve duplicating the same function across multiple deployments. Is this second option the better choice?
Is there anything I can do to make the worker function execute as multi-threaded?
I attempted to double the _APP_WORKER_PER_CORE, but it didn’t result in any improvement. Any advice would be appreciated.