[SOLVED - rate limited] Getting disconnected from chat the moment I send anything

This is happening off and on and I thought it was my bot code. I connect, I read all the startup messages, I will join a channel, then the moment I try to write anything else the socket closes at the server.

I thought this was my code, so I downloaded HexChat on my server and I am experiencing the exact same behavior.

Here is the HexChat chat log (channel is adamstel, bot account is trialssherpabot):

* Now talking on #adamstel
<trialssherpabot> hello
* Disconnected (Remote host closed socket)
* Now talking on #adamstel
* jtv gives channel operator status to nightbot
* jtv gives channel operator status to adamstel
<adamstel> test
<trialssherpabot> hello
* Disconnected (Remote host closed socket)

Any clues? This happened two weeks ago, but stopped after a little while. And now it’s happening this week pretty significantly. I thought maybe it was due to rate limiting, so I’ve recently added performance counters to the bot and it’s averaging less than 1 per second (~.08 or less), so I can’t imagine I’m going over the limits. Though since I don’t know what the behavior for rate limiting is, I don’t know if that’s what’s happening to me or not.

Any ideas?

After more reading, this has to be rate limiting. I must have had a spike and didn’t notice and went over the global message count.

Which leaves me with a question: Nightbot has to be sending more than 100 messages per 30 seconds (the limit for bots that are mods) right? Is it really limiting itself to that or is it treated differently?

The rate limits are separate for each connection. Big bots generally go by the 20 per 30 limit since they can’t trust the broadcasters to keep the bot modded.

Are you positive about the separate limits per connection? Not doubting you, just making sure I have the info I need to fix what I need.

I’m currently ramping up my shared connections code, so I have at most 5 people sharing a single IRC connection. Do those 5 need to rate limit to 30/20 or do all ~80 people (~16 separate IRC connections) need to rate limit to 30/20?

Also thank you for the reply :slight_smile:

Yes[quote=“adamstel, post:5, topic:7182”]
Do those 5 need to rate limit to 30/20 or do all ~80 people (~16 separate IRC connections) need to rate limit to 30/20?
[/quote]

Each individual connection should be kept under 30/20.

Thanks @george and @3ventic much appreciated. I have it globally rate limiting, but I’ll change it to per connection on my next maintenance.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.