Yes, 1 instance per vCPU on the standalone apps on Xojo Cloud.
If you are using a ServerSocket, you’d need to make sure to have a way (via a file, sqlite db, etc) to know which port(s) had already been open. That’s correct, only one instance should be listening on a given port.
Yes. The first one will succeed and the second will fail. That said, I urge you to evaluate your need and consider using an http api through HandleURL if you can. Adding a second ServerSocket instance to your app (the built-in one being the first) can severely degrade the performance of the web app overall. The ServwrSocket does everything on the main thread, which means that while it is accepting and negotiating connections with its clients, it is blocking the web app from dealing with its own. Also, you don’t get any of the protections from bad actors that you otherwise do with the Apache Load Balancer running in front of your app.
It’s also important to remember that unless you’ve built your app to handle this, if the instance that is listening crashes, the other one doesn’t just start listening in its stead. The crashed app will restart on its own relatively quickly and if the port is available, it will start listening again.