I am writing a web service based on Klein framework
https://klein.readthedocs.io/en/latest/index.html
At this stage I am stress testing my service, it can handles about 70 requests per second on amazon t2.medium instance. But when I use top to check the server, it only use 100% of CPU. I think amazon t2.medium instance should have 2 cpu, so I wonder is there a way to change in my web service code to use all of the possible cpus and hopefully handle more requests.
I've read python documentations and found the multiprocessing
module but I am not sure will that be the right solution to it. Right now the main function of my web service is
APP = Klein()
if __name__ == "__main__":
APP.run("0.0.0.0", SERVER_PORT)
Is there a straight forward fix to make this service being able to use multiple cpu to process the incoming requests? Thank you for reading the question.