Enforcing fair access on V2 MQTT APIs

In response to recent (partial) outages related to the V2 MQTT APIs, we unfortunately had to set stricter limits on the V2 MQTT APIs.

After we made this change, some community members indicated that the stricter limits were a bit too strict for them, so today we tried to revert those limits. Unfortunately that didn’t go as we hoped, so we decided to relax the limits a little, but still have some.

From now on, and until we shut down V2 at the end of the year, all V2 clusters enforce a limit of 10 MQTT connections per application (no exceptions). Next to this, there is now a limit of 50 MQTT connections per IP address (with exceptions for specific integrations).

We hope that these limits will keep the V2 service as stable as possible until we switch it off in December, but we’ll take additional measures if necessary.

Mind blown! I get twitching if I add a third web hook for testing, those limits aren’t limiting unless you just thrown connections at the servers like they weren’t some shared community resource!

Please can you do the same with v3 so people can’t get in the habit of doing that - along with rate limiting the data storage?

I see some sample code on proxying the data in my future.

@descartes 10 MQTT connections per application is a lot, I agree with you on that. But 50 MQTT connections per IP is in some cases easily reached. We, for example, have a rather large installation with a lot of different sensors. Each sensor has its own application. A Telegraf client (TICK stack) is used to connect to all of these applications, one MQTT connection per app. It’s the same server, so we are currently at around 40 apps ( = 40 MQTT connections) for this IP.

(…yes, that’s a lot for a free shared community project to handle. We know that. We are deep into switching to v3 (and non community instances), but this takes some time for us))

You definitely don’t need to worry about a couple of webhook configurations. Webhooks scale much better than MQTT connections.

This is part of Rate Limiting · Issue #1406 · TheThingsNetwork/lorawan-stack · GitHub. We’ll also take a closer look at the configurations on The Things Stack Community Edition, and specifically the storage integration.

If you’re working with 50+ applications, you shouldn’t be using MQTT anymore, but use webhook integrations (tip for when you switch to V3). But as I said, we are willing make exceptions for legitimate use cases that need 50+ MQTT connections to V2 (as long as they behave).

And indeed, as you say, with 50+ applications, you should probably not be on the community clusters anymore, but install The Things Stack Open Source on your own server, get a The Things Stack Enterprise server or a tenant on The Things Stack Cloud.

1 Like

2 posts were split to a new topic: MQTT v2 connection not working