Twitter disconnects streaming connection frequently,


We have been using twitter user and search streaming.We use REST API v1.1 long-live connection with twitter server for search and user streaming. Initially we were receiving data without any problem, but recently we are experiencing frequent disconnection from twitter. Say for example if we have 500 user streaming connection with twitter, almost 400 connections are closed with no reason. I can give an approximate time difference - 12 hrs. Twitter maintains the connection like 12 to 13 hrs and suddenly disconnects. We are not re-connecting. Should we attempt to reconnect? Is it a problem with twitter? Please let us know the best practices.



You should have a single open connection to the streaming API at representing your application/company/product/customers. You should use no more than a handful of user streams as they are not meant for server-side use.

It sounds like you’re using the streaming API incorrectly and probably need to rethink your entire approach.