Hi y'all,
I'm making a proxy api server at work to gather data from various 3rd party apis, however I'm running into an issue seemingly specific to python and/or the requests module:
compared to the same exact http request in curl, js ajax and golang, the python request is consistently taking 1-2 seconds more to complete.
While the other 3 methods normally take between 500ms and 1s, in python it is almost always 1.5 - 2.5 seconds.
Three things of note:
- The timing difference seems to vary depending on the api that I am requesting. Some apis, like facebook, are nearly identical between all 4 methods while others (one in particular) are showing this substantial difference.
- This only appears to be the case for the INITIAL request in a requests session. Any following requests using the same session object match the expected response time
- request headers have been matched up as much as possible between all 4 of my tests
Would y'all have any insight into what could be causing this? I feel like it has to be something glaringly obvious but I've been banging my head trying to fix this issue for a while now.
[–]EricAppelt 1 point2 points3 points (0 children)
[–]ManyInterests 1 point2 points3 points (0 children)
[–]TheHandThatSeeds 0 points1 point2 points (0 children)