I have a web server written using FASTAPI. I get large data on an endpoint, break into smaller chunks and use multiprocessing to process it parallelly. It is CPU intensive. I am using the multiprocessing.Pool class to create and run the processes after receiving a request, which adds a delay to the response time.
I'd like to create the processes when the server starts, and use them when the API is called, so as to avoid the overhead of creating the processes after receiving a request. I am new to multiprocessing and would appreciate the help.