FastAPI runs api-calls in serial instead of parallel fashion

As per FastAPI’s documentation: When you declare a path operation function with normal def instead of async def, it is run in an external threadpool that is then awaited, instead of being called directly (as it would block the server). Thus, def (sync) routes run in a separate thread from a threadpool, or, in other … Read more

How to launch 100 workers in multiprocessing?

The literally first example on the page you link to works. So I’m just going to copy and paste it here and change two values. from multiprocessing import Pool def f(x): return x*x if __name__ == ‘__main__’: with Pool(100) as p: print(p.map(f, range(100))) EDIT: you just said that you’re using Google colab. I think google … Read more