I have written a TCP Socket program through which OBD-II devices connect now I want to host my TCP Socket code on Azure VM and this is my first time going with azure so the questions arise:
- Will Azure VM be able to handle 100K devices or more?
- If not which other Azure services should I use for this kind of problem.
Please help me to figure it out.
Thanks
CodePudding user response:
For TCP Listeners, you should use Azure VMs. In the past, it was also possible to work with Worker Roles (Cloud Services) but it is now deprecated. In terms of the workload, we can't tell if a single VM is enough or not, but you should have more than one for high availability reasons.
In your shoes, I would do a Proof Of Concept with two virtual machines, then a load test to check how it behaves. And in case, add more vms.
PS: Try to use Azure Virtual Machine Scale Sets as it will help you in case you need to scale the architectre when / if needed.
CodePudding user response:
According to the VM network throughput documentation on Github, Azure VMs support up to 500,000 inbound and 500,000 outbound flows. That's just from a networking perspective.
The next question is, can your server application handle the load induced by that many connections? That would seem to be a function of the number of concurrent requests, and the processing resources required to handle them.
So, the answer to 1. above is, "definitely maybe". You would need to benchmark in order to answer this question definitively.
If the answer you determine for your load pattern and application is "no", the answer to 2. might be to spin up multiple VMs, which you could do in a Virtual Machine Scale Set, or by manually spinning them up, and then putting an Azure Load Balancer in front of it.