Load Balancing Web Standalone

  1. ‹ Older
  2. 5 years ago

    Andreas L

    10 Apr 2014 Pre-Release Testers, Xojo Pro Europe (Frankfurt, Germany)

    Antonis,
    the problem with balancing the load via DNS is the Time To Live for each DNS response. In most cases this is not a problem, because Internet Host TTL is usually 24 hours. But, if you have a user that logs in around noon (for example) and then stays online until noon the next day, the user's network interface (IP stack) will issue a new DNS request and then you may (or may not) end up at a different application server. Very hard to replicate this phenonemon until you really understand DNS mechanisms.
    One workaround is of course to limit session time to 23 hours or so. You should check back with your hosting provider as they maintain the authoritative records and steer the TTL for your devices.

    Re load balancing by way of a parameter at application startup cannot work, because the load balancing has to occur before the initial HTTP request arrives at the system. There must be one single point of first contact (HTTP session handshake) and that is either a load balancer or redirection is done by providing different IP Addresses to different users (this is the DNS load balancing mechanism).

    And re the copyrighted materials... of course anyone would like it if xojo shared it but on the other hand, what incentive would someone have to pay for the XDC event??? I guess that the XDC fees contribute to Xojo's revenue and they rely on it.

  3. Andreas L

    10 Apr 2014 Pre-Release Testers, Xojo Pro Europe (Frankfurt, Germany)

    BTW, here's a description how you can check your hosted server's TTL (copy from Rackspace site)
    Checking When a Cached Record Will Expire

    DNS uses caching, this reduces the load on authoritative name servers but means that sometimes records can be out of date. If the authoritative and non-authoritative answers differ, this means you will have a cached response from the resolver name server you are using. The length of time a record is cached depends on its time-to-live (TTL) value. This is a number specified in seconds. To see how long a record will be cached for requires the debug switch.

    C:\Users\Administrator>nslookup -type=A -debug rackspace.co.uk

    ------------

    Got answer:
    HEADER:
    opcode = QUERY, id = 1, rcode = NOERROR
    header flags: response, want recursion, recursion avail.
    questions = 1, answers = 1, authority records = 2, additional = 2
    QUESTIONS:
    80.151.138.83.in-addr.arpa , type = PTR, class = IN
    ANSWERS:
    -> 80.151.138.83.in-addr.arpa
    name = cachens1.lon.rackspace.com
    ttl = 2466 (41 mins 6 secs)

    bla bla bla bla....

    The first "Got answer" section of this example is used to get the hostname of the server you are requesting the A record from, in this case cachens1.lon.rackspace.com.
    [...]

    So from this you can see that the name server being used by the client computer will keep reusing the same A record for rackspace.co.uk for the next 4 minutes and 39 seconds. If you were to run the same command on the authoritative name server you would see what the current maximum TTL for the record is.

    See the ful article at http://www.rackspace.com/knowledge_center/article/nslookup-checking-dns-records-on-windows#3_CheckingCache

  4. Norman P

    10 Apr 2014 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...
    Edited 5 years ago

    @Guy R I think this is really unfair from Xojo Inc. to not allow customers who cant go to XDC to even buy recorded XDC sessions (like with SIGGRAPH DVDs for instance).

    If they existed we'd make them available - probably for a fee. But they don't
    We have never recorded session videos at the conference
    To do that you'll have to convince geoff about as its not my decision

    But you do have to understand that we DON'T want to record things and provide them in a manner that would prove to be a disincentive for people to come to the conference. We do want people to come to the conference and not use "well I can get the videos cheaper" as the reason to not come.

    I'm sure that we can probably get Travis to post a blog or something about this
    But load balancing standalone servers and scaling is EXACTLY what his presentation was about
    I just know he's VERY busy at the moment

    @AntonisVakondios We hope, Travis or Greg to give us again some time and to inform us about the load balancing....... maybe there is again a mysterious parameter on application startup and you can redirect the traffic to other servers.

    I know that it had no magic parameters for the standalone app at startup and had more to do with how the app is designed so that multiple instances of the standalone could be run behind a load balancing or round robin dns server

  5. Phillip Z

    10 Apr 2014 Pre-Release Testers, Xojo Pro Florence, SC

    More people would probably come if they knew the sessions were available. Right now everyone just gets a bad taste in their mouth about it which does not encourage ticket sales.

  6. For the best quick glance at load balancing standalone apps (with Nginx) you can read this post/thread that I contributed to:

    https://forum.xojo.com/4149-load-balancing-with-nginx/p1#p28982

    While the conference sessions are not available directly, we'll certainly consider a blog post on setting this up as well given the interest demonstrated here.

  7. Wayne G

    10 Apr 2014 Pre-Release Testers, Xojo Pro New Zealand axisdirect.nz

    Back in the early days of RS WE I built a Server app that load balanced WE Over multiple servers/sites. This was all based on using Windows service apps and reporting back to the controller the memory usage (WE leaked a bit back then). If the memory usage was > x then that instance was quiesed and restarted by a service manager on no sessions connected. If anyone is interested in building an Open Source project based on this PM me.

  8. Nathan W

    11 Apr 2014 Pre-Release Testers, Xojo Pro Europe (UK, Jersey)

    Thanks everyone for the comments and links etc, I would love to see a blog post by Travis when he gets the time.

    Andreas a blue print would be really useful to help me try and get my head around what is needed to build the correct infrastructure to cope with load balancing a Xojo web standalone.

  9. John J

    28 Aug 2014 Pre-Release Testers, Xojo Pro Cleveland, Ohio

    Hey guys - I know this is an old thread but I am looking to get some feedback on a couple of posts I wrote about load balancing standalone apps. I have been using this method with client's apps for a while with no issues. Anyhow, if anyone else tries this, I would love to hear about your experience. Also - just take a read and tell me what you think. I am trying to put together as much info as possible. If you think something needs expanded on, edited, deleted, please tell me.

    Your input is appreciated, thanks in advance for your time.

    Load Balancing Xojo with Haproxy

    Load Balancing Xojo with Nginx

  10. 4 years ago

    Albin K

    12 Feb 2015 Europe (Sweden)

    @John J Load Balancing Xojo with Haproxy

    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

  11. John J

    12 Feb 2015 Pre-Release Testers, Xojo Pro Cleveland, Ohio

    Thanks @Albin K !

    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.

  12. Albin K

    12 Feb 2015 Europe (Sweden)

    @John J Thanks @Albin K !

    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.

    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 ;)

  13. Albin K

    18 Feb 2015 Europe (Sweden)

    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 ;)

    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!

  14. olivier v

    19 Feb 2015 Pre-Release Testers, Xojo Pro Europe (France)

    @Albin K 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!

    amazing! :-) Thank you Albin.

  15. olivier v

    22 Feb 2015 Pre-Release Testers, Xojo Pro Europe (France)

    @John J 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?

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

  16. 3 years ago

    Diego d

    26 Nov 2015 Pre-Release Testers, Xojo Pro CH

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

  17. John J

    30 Nov 2015 Pre-Release Testers, Xojo Pro Cleveland, Ohio

    Thanks @Diego dHaller !

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

  18. 2 weeks ago

    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

  19. Jim B

    May 8 Pre-Release Testers, Xojo Pro Uckfield, England

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

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

  20. John J

    May 8 Pre-Release Testers, Xojo Pro Cleveland, Ohio

    @ClémentPerron 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

    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/

  21. last week

    Mark S

    May 16 Pre-Release Testers, Xojo Pro, XDC Speakers

    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.

or Sign Up to reply!