is a built using the somewhat newly introduced , harnessing uvloop and based on Flask. However, it had an issue preventing it from utilizing multiple processes correctly. The previous code tried to spawn new servers naively, without explicitly inheriting the socket connection: Sanic Python3 framework coroutines processes = []for _ in range(workers):process = Process(target=serve, kwargs=server_settings)process.start()... This resulted in only one process actually handling the request. With the help of Guido Van Rossum and the creator of uvloop, Yury Selivanov (relevant link ) I was able to implement a solution by creating a socket in the parent process and passing it to the children processes: here sock = socket()sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)sock.bind((server_settings['host'], server_settings['port']))set_inheritable(sock.fileno(), True)server_settings['sock'] = sockserver_settings['host'] = Noneserver_settings['port'] = Noneprocesses = []for _ in range(workers):process = Process(target=serve, kwargs=server_settings)process.daemon = Trueprocess.start()processes.append(process) I verified locally that the changes had an impact on throughput (I was able to achieve double the number of requests per second using 4 processes), and that multiple processes where actually responding to the request (by responding with the process id). Finally, I provisioned a 20 core Digital Ocean droplet and benchmarked the server using using 20 worker processes: wrk -t250 -c500 [http://localhost:8000](http://localhost:8000) from sanic.response import textfrom sanic import Sanic app = Sanic() @app.route('/')async def hello(request):return text("OK") if __name__ == '__main__':app.run(workers=20) and was able to achieve 186k requests/second on a maximum run. This would continue to scale with the number of CPUs. The change hasn’t been merged yet (EDIT: the change was merged, so you can do this from the master branch now), though it likely will be soon. In the meantime, you should be able to demonstrate it yourself by cloning the sanic repository, using the branch, and saving the above file to : worker hello.py git clone cd sanicgit checkout workerspip3 install -r requirements.txtpython3 hello.py https://github.com/channelcat/sanic Of course, you’ll need a 20 core DO droplet too. I only ran mine for 6 minutes and they cost less than $1 per hour. So if you’re interested in replicating, let me know how it goes! I was going to do it with 36 cores on AWS, but apparently my ~2 year old account is still “pending” for some reason. Anyway, thanks for reading! Also, thanks to Yury and the BDFL! is how hackers start their afternoons. We’re a part of the family. We are now and happy to opportunities. Hacker Noon @AMI accepting submissions discuss advertising &sponsorship To learn more, , , or simply, read our about page like/message us on Facebook tweet/DM @HackerNoon. If you enjoyed this story, we recommend reading our and . Until next time, don’t take the realities of the world for granted! latest tech stories trending tech stories