简体   繁体   中英

Django S3 [Errno 104] Connection reset by peer

I'm trying to upload files from my django app to Amazon S3 service. It works well with small files (under 300ko) but with other files (300ko +) I have a "[Errno 104] Connection reset by peer" error. I tried with django 1.4 and 1.3, python2.7 and 2.6 but without success. It's really weird. four days now i'm looking for a solution. thnx in advance.

EDIT Found out what was the problem. I'm using guincorn as my django server which close the request after 30sec by default. So I had to increase the timout to get it work and make async request. web: python manage.py run_gunicorn -b 0.0.0.0:$PORT -w 3 --timeout 900 -k gevent

I use s3cmd to publish content from my Django app to amazon-s3

subprocess.call(["s3cmd", "put", "-P", "-r", "-c", s3conf_path, "--exclude=.xml", src,  fileserver_path + '/data/'])

and i am able to publish content that are more 150 mb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM