Load Balancing Web Standalone

[quote=125320:@John Joyce]
Load Balancing Xojo with Haproxy[/quote]
Great instructions. Easy to follow!
You could add how to get SSL going. I did get SSL Termination to work myself by following the instructions found here.
I had to upgrade HAproxy to 1.5.x to have SSL capability as the version in Ubuntu 12.04 didn’t have that.
https://www.digitalocean.com/community/tutorials/how-to-implement-ssl-termination-with-haproxy-on-ubuntu-14-04

Thanks @Albin Kiland !

I have not had to implement SSL termination yet but thanks for the link. I am also thinking about putting together some info on improving security at the HAproxy layer for things like DOS, slowloris attack, vulnerability scanning, request rate limiting, etc… since several of those things can be implemented right in HAproxy, before the app. Interest?

Also - there are additional options with 1.5 that were not available in 1.4 when I wrote the original posts.

[quote=167090:@John Joyce]Thanks @Albin Kiland !

I have not had to implement SSL termination yet but thanks for the link. I am also thinking about putting together some info on improving security at the HAproxy layer for things like DOS, slowloris attack, vulnerability scanning, request rate limiting, etc… since several of those things can be implemented right in HAproxy, before the app. Interest?

Also - there are additional options with 1.5 that were not available in 1.4 when I wrote the original posts.[/quote]
Very much interested. I did add some options to enable slowloris protection and that works great but more security tutorials from you sounds great. You’re quite good at that :wink:

I’ve notised one thing(among others) that’s really good when using HAproxy. It’s obvious maybe but I didn’t notice it until now :wink:

If I connect to a Stand alone app that isn’t behind HAproxy and I connect my phone to use tethering, I get disconnected from the app with an error message as the connection is lost when I connect the phone. Not a surprise.
But when the app is behind HAproxy the connection is maintained by the proxy and the connection isn’t lost to the app and I can just continue where I left off! Sweet!

[quote=168932:@Albin Kiland]If I connect to a Stand alone app that isn’t behind HAproxy and I connect my phone to use tethering, I get disconnected from the app with an error message as the connection is lost when I connect the phone. Not a surprise.
But when the app is behind HAproxy the connection is maintained by the proxy and the connection isn’t lost to the app and I can just continue where I left off! Sweet![/quote]

amazing! :slight_smile: Thank you Albin.

yes, even for nginx, it would be an extraordinary contribution to the community! :slight_smile:

Hi! Just to thank @John Joyce for the Load Balancing with HAProxy post. It is just what I was looking for in order to correctly implement load balancing. Thanks!

Thanks @Diego de Haller !

Let me know if you run into any issues - I will be glad to help where I can.

Hi for my deployment if I use “MyApp --port=???”… for creating my 5 instances with different port like 10001,10002,1003,1004,1005…
Do you think this 5 web app work like independent webapp for load balancing… thanks

We were discussing this in a previous discussion which you might find useful:

52685-more-xojo-web-app-stand-alone-on-the-same-computer

[quote=435522:@ClmentPerron]Hi for my deployment if I use “MyApp --port=???”… for creating my 5 instances with different port like 10001,10002,1003,1004,1005…
Do you think this 5 web app work like independent webapp for load balancing… thanks[/quote]
Yes - you need multiple instances of your app to maximize server resource utilization (and increase reliability) but those instances need to sit behind some sort of load balancer which routes the traffic amongst the instances, while keeping sessions locked to their specific instance to maintain state in the app.

Here is my basic article on this but also if you search load balancing on this forum you will find several discussions
http://john-joyce.com/xojo-and-load-balancing-with-haproxy/

HAProxy is a good solution but there are others.

You could also use the open source version of NGINX. There are some sample config files here on the forum. NGINX runs on Windows if you need that option.