Recommendations for reaching 1 million of simultaneous connections

So I’m starting a project that will connect about 1 million devices, with the possibility to increase it even more. Each device will have its own topic and each device should receive about one message per day.

In order to have so many connections, I know that I have to adjust parameters such as max_connections and OS limits for open files.

For machines, I’m considering something like multiple t3.2xlarge (8 CPU, 32 GB) in a cluster.

  • How many connections each machine would be able to handle?
  • Should I choose bigger machines?

I appreciate any input.

Edit:

  • Each device has one connection and should keep connected, unless some kind of failure occurs
  • If a massive failure occurs, it is possible that all devices try to connect “at the same time”, but I think a randomized exponential backoff for the devices + load balancer limits should solve it
3 Likes

I’m no expert, but I think few things will make the question even more clearly stated…

  1. 1 million devices - Is it 1 connection per device
  2. What is the frequency of connections?
  3. What is the lifespan of these connections?
  4. Are they concurrent connection(s) or are they spread over some time period?

Sorry, I missed the “simultaneous” in the title…

3 Likes

Indeed, these are good points, I will edit my question, thanks!

2 Likes

Let me give a quick generic comment:
You should not choose bigger machines but rather test medium ones (like the t3.2xlarge you mention) while making it possible or even easy to go for bigger ones if needed later.

I’d go with the 8vCPU/32GB and test them for 250k connections each. Be aware of possible rate/config limits of your cloud provider, by the way.

You’ll have to configure VerneMQ specifics, BEAM settings, and OS settings. The VerneMQ documentation should give you the basics for that.

For a use case like this, you also want to secure VerneMQ commercial support so we can help you more efficiently! :slight_smile: Contact me for details at any time.

3 Likes