This is interesting to me because we (at 2lemetry) are doing something similar. However, we’re using MQTT which has persistent TCP connections, so we didn’t have the problem of accepting connections quickly - only holding them open and processing data. We implemented our MQTT broker in Scala, and to achieve near-linear scalability for large subscribers (that subscribe to all data) we use Kafka. The entire system is linearly scalable, so far we’ve only gone up to 1 million subscribers sending a net total of 50k msgs/s. We’ll have to write a blog about it sometime.
Keeping the connections persistent is key. I believe that an open file handle only has 4 KB of memory overhead; as long as your devices call home on a regular basis (smaller than the timeout interval), the problem solves itself.
Curious about solving the same problem with Elixir and zeromq. Anybody have any experiences doing that?