I run a small socket.io node.js app that always has a small number of concurrent users. For the most part, it can run 100% of the time on a single process (whether it be on my Linode or Heroku[1]).
I'm hoping to publicize it a bit for a few days, during which I'll expect a decent amount of traffic. This means concurrent websocket/xhr-polling connections. However, the two socket.io connections do not have to communicate with each other.
The app was running on my Linode for quite some time, but I've recently transfered it over to a single free heroku dyno. Even running with xhr-polling (heroku doesn't support websockets natively) it is very fast.
I'm curious how I can utilize my Linode to essentially run and load balance the app. But if it starts to slow down, push users over to the heroku dyno running (or vice versa). This should be possible with something like node-http-proxy, but I had a tough time getting it running properly. Hopefully, I could fine tune it at which it could hit a point, or I could flick a switch and it would begin balancing users over to the second site.
Basically, I'm just looking to be pointed in the right direction. Code would be nice, but not necessary. The solution doesn't even have to be in node.
Thank you!
[1] I've tried out nodejitsu as well for quite some time, and just didn't find it ready for production usage.
Edit: Should I just use a simple roundrobin, as explained here? What if I want to favor one over the other?