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.
- 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
I’m no expert, but I think few things will make the question even more clearly stated…
- 1 million devices - Is it 1 connection per device
- What is the frequency of connections?
- What is the lifespan of these connections?
- Are they concurrent connection(s) or are they spread over some time period?
Sorry, I missed the “simultaneous” in the title…
Indeed, these are good points, I will edit my question, thanks!
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! Contact me for details at any time.