Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
491 views
in Technique[技术] by (71.8m points)

python - Why do I constantly see "Resetting dropped connection" when uploading data to my database?

I'm uploading hundreds of millions of items to my database via a REST API from a cloud server on Heroku to a database in AWS EC2. I'm using Python and I am constantly seeing the following INFO log message in the logs.

[requests.packages.urllib3.connectionpool] [INFO] Resetting dropped connection: <hostname>

This "resetting of the dropped connection" seems to take many seconds (sometimes 30+ sec) before my code continues to execute again.

  • Firstly what exactly is happening here and why?
  • Secondly is there a way to stop the connection from dropping so that I am able to upload data faster?

Thanks for your help. Andrew.

question from:https://stackoverflow.com/questions/28867840/why-do-i-constantly-see-resetting-dropped-connection-when-uploading-data-to-my

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Requests uses Keep-Alive by default. Resetting dropped connection, from my understanding, means a connection that should be alive was dropped somehow. Possible reasons are:

  1. Server doesn't support Keep-Alive.
  2. There's no data transfer in established connections for a while, so server drops connections.

See https://stackoverflow.com/a/25239947/2142577 for more details.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...