I want to convert my docx to pdf using onedrive, so i uploaded my docx in onedrive and download it on same function. I am using python django webserver.
def myfunctionname(token,filecontent):
headers = {"Content-Type": "text/plain"}
txt = fileContent
graph_client = OAuth2Session(token=token)
drive_url = "mywholeurl"
upload = graph_client.put(drive_url, data=txt, headers=headers)
download = graph_client.get(drive_url + '?format=pdf')
return download.url
It took me 5 seconds to upload and download for one request but when i do 20 requests at same time to complete all requests it took around 40 seconds, for 50 concurrent requests it took me around 80 seconds.
I was expecting to get all results in same 5 seconds for any number of requests. Can you explain where i am doing wrong?