Twitter Streams spontaneously close after 10-15 minutes


We have Twitter app through which users can register to retrieve data from Twitter. We use token from each registered user to create a separate Twitter stream. Problem is that those streams close spontaneously after 10-15 minutes and we have to reconnect them each time this happens. We have dozens of streams opened at the same time. Is the number of streams the issue why they are closing after such a short time? What is the right way to open multiple parallel streams?


If i remember reading correctly earlier.
You can only have 15 streams opened per application. If its not exactly 15, there is a limit.

I’m also having problems with the stream api though, I’m curious how you initialise these streams?

I have everything setup, my only issue is… where am I supposed to actually start them for each twitter user on my app…


Which streaming endpoint are you accessing? Is this user streams?

The public streaming API is not designed for a large number of concurrent connections.


@ItsMrSammeh, we have thread per stream.

@andypiper, endpoint, it’s about user streams.


That’s not userstreams, that’s the regular filter endpoint. Userstreams is via the GET user endpoint.

You’re limited to a couple of connections per IP address for the public streaming API, so additional connections will disconnect established ones. That’s one of the restrictions for the streaming API (along with limits on the numbers of query terms etc).

For large scale streaming use we offer the commercial Gnip APIs which support far higher levels of fidelity and scalability.