Sometimes connection drops (every day)


#1

Hi,
Sometimes our connection breaks or dropped by twitter - it happend 2-3 times every day - do you know why it happens and what can we do prevent it?

Thanks,
Pete


#2

It happens for various reasons. Usually, at least for me, it happens around the 24 hour mark of the initial connection. Sometimes it happens more often. On my windows machines I run a batch file that delays 15 seconds after the connection drops, then attempts to reconnect. If it fails x number of times then it’ll email me to tell me investigate further. On Linux you can do a cron job. There’s no way (that I know) to prevent it. You need to prepare for it. That’s just good planning.


#3

Absolutely, I’d agree that being prepared and responding correctly to a disruption is the way forward here.

A connection could drop for a number of reasons - network disruption, data center change / failover / load balancing, code deployment on our side, etc.

Note that the public streaming API does not have any fallback option, but the commercial Gnip offerings do offer the option of redundant connections and also backfill for missed data.