I run a large file upload (2.8 GB) in Python, the code I use looks something like this:
files = {'md5': ('', md5hash), 'modified': ('', now), 'created': ('', now), 'file': (os.path.basename(url), fileobject, 'application/octet-stream')} m = requests_toolbelt.MultipartEncoder(fields=files) headers['content-type'] = m.content_type r = s.post(url, data=m, params=params, headers=headers)
When I run this code, everything else on my network just stops working. Websites stop working, etc. I am assuming Python is saturating my router TCP buffer packet or something like that. This behavior will be well known to everyone who tried to run the BitTorrent client without specifying restrictions on their download speed.
Is there any way to slow down the download speed so that my users do not destroy their network?
python python-requests
Alex
source share