Load Balancing And Sessions

  1. ‹ Older
  2. 5 years ago

    Steve U

    22 Aug 2014 Pre-Release Testers, Xojo Pro Seattle, WA

    Is there more information about load balancing and Xojo?

    We could sure use a comprehensive blog post, PDF or webinar to cover the growth path for a Xojo-drive web app.

    I think it's standing in the way of people adopting Xojo whole heartedly for web app development.

    No matter how much demoing & prototyping you do, the remaining question is always "but how does it scale? what do we do to manage growth? what's going to break first?"

  3. Norman P

    22 Aug 2014 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...

    @Steve U We could sure use a comprehensive blog post, PDF or webinar to cover the growth path for a Xojo-drive web app.

    You mean Xojo hosted ?

    I think the right guys to comment on scaling etc are Greg & Travis
    Travis did that session at XDC
    You should have been there (maybe next year ?)

  4. Michel B

    22 Aug 2014 Pre-Release Testers RubberViews.com

    There was a very interesting discussion a while ago
    https://forum.xojo.com/10913-load-balancing-web-standalone

    Where using different instances and a dispatcher app was discussed. Seemed both elegant and easy.

    There was also a discussion https://forum.xojo.com/12264-have-people-tested-the-xojo-web-s-performance
    where a member reported having tested an app up to 500 concurrent users.

  5. Steve U

    22 Aug 2014 Pre-Release Testers, Xojo Pro Seattle, WA

    @Norman P You mean Xojo hosted ?

    No, self-hosted.

    @Norman P I think the right guys to comment on scaling etc are Greg & Travis
    Travis did that session at XDC
    You should have been there (maybe next year ?)

    Yeah, woulda if I coulda... hoping for next year. In the (rather long) meantime, searching for what I can find

  6. John J

    26 Aug 2014 Pre-Release Testers, Xojo Pro Cleveland, Ohio
    Edited 5 years ago

    @Steve U Is there more information about load balancing and Xojo?
    We could sure use a comprehensive blog post, PDF or webinar to cover the growth path for a Xojo-drive web app.

    I wrote this post a while back on load balancing and server configuration. It has some links to xojo forum posts as well. I did experiments with both nginx and haproxy and in the end I found that haproxy was the better choice for me. The blog post only covers nginx. I never updated it with the haproxy config information because I didn't feel there was much interest. I now think it is easier to handle the routing using cookie injection with haproxy.

    Check out the post and feel free to comment or contact me.
    I can also write an update post about haproxy if you have interest. It is pretty straightforward to set up and works extremely well.

  7. John J

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

    @Brock N Any other "gotchas" or things to be worried about?

    Brock - I have only encountered two issues in load balancing (this is regarding stand-alone apps):

    1) maintaining session
    This is the most obvious. You need to use some method to keep requests from the client routing to the same instance of the app in the load balancing pool. Using nginx I found the easiest way as IP hashing. But if you have a client behind NAT (like a network of users in the same office) they all can look like they are coming from the same IP - which defeats the load balancing. So I switched to haproxy which allows very easy cookie injection. I found it best to create a separate cookie just for routing with the load balancer and inject it into the header. It works perfectly and seamlessly.

    2) keeping connections open
    The load balancer may not keep connections open between specific instances of the app and the end user at the same time-out values as the app itself. This can also cause the session to terminate (You get the "application went offline" message). You have to play around with the values to keep things working.

    With the two above issues addressed I have not run into any other issues so far. My web apps are written clients in-house use, so the NAT/IP address issue was a deal-breaker for me with nginx. That got me to try haproxy. But once I tried it, I was hooked.

    Hope this helps.
    John

  8. Brock N

    26 Aug 2014 Pre-Release Testers, Xojo Pro

    Thank you very much @John J !
    Haproxy definitely seems the way to go. I'll start doing some research into what all need to do to set it up and how I need to configure my web session cookies. If you have any time to write a blog post for Haproxy or provide any other tips/details on configuration and set-up I'm sure there's more people than just me that would appreciate it ^_^

  9. Dirk C

    26 Aug 2014 Pre-Release Testers, Xojo Pro Belgium, Zedelgem

    @Brock N If you have any time to write a blog post for Haproxy or provide any other tips/details on configuration and set-up I'm sure there's more people than just me that would appreciate it

    I second that

  10. Albin K

    27 Aug 2014 Europe (Sweden)

    @Brock N If you have any time to write a blog post for Haproxy or provide any other tips/details on configuration and set-up I'm sure there's more people than just me that would appreciate it

    +1

  11. John J

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

    @Brock N If you have any time to write a blog post for Haproxy or provide any other tips/details on configuration and set-up I'm sure there's more people than just me that would appreciate it

    OK - I have written an updated post with my Haproxy configuration. Take a look and let me know if you have any questions. I can always add to it or make another post if necessary.

    Please let me know what you think http://john-joyce.com/xojo-and-load-balancing-with-haproxy/

    Thanks!
    John

  12. John J

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

    Here is a super simple little app so you can see the Load Balancing in action (to some degree).

    http://loadtest.john-joyce.com

    This app just generates images and loads them every second on a timer. It shows you how many sessions are connected to that app-instance, where they are coming from, and more importantly the load on all of the different instances (there are 6). If you quit your browser and restart you should see that you are directed to a new server, or alternately if you open two different browsers you can also see it (like safari & chrome) Look for App.Port to see which instance you are connected to on the back-end.

    Who wants to help me test it out? Check it out and let me know your thoughts.

  13. Albin K

    28 Aug 2014 Europe (Sweden)

    John, it seems the server isn't responding :)

  14. Albin K

    28 Aug 2014 Europe (Sweden)

    Works now. Cool :)

  15. John J

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

    @Albin K John, it seems the server isn't responding :)

    Sorry - firewall was still blocking, try again now please - thanks!

  16. Brock N

    28 Aug 2014 Pre-Release Testers, Xojo Pro

    I have a wildcard SSL certificate and my front end needs to be setup dynamically. Do you know how this would work?
    Essentially we board several new customers a week. They each get their own URL:
    https://TheirCompanyName.OurCompanyPortal.com

    ==============
    Secondly, I'm curious if I can set up the SSL certificate on Haproxy and then have Haproxy pass the requests unsecured to the Xojo apps within my VPN. Would this work?

  17. John J

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

    @Brock N I have a wildcard SSL certificate and my front end needs to be setup dynamically. Do you know how this would work?

    In your app you can check the Session Headers http://docs.xojo.com/index.php/WebSession.Header for the host parameter and then write your logic to handle it however you want. You end up with one app that responds to all hosts directed at it in whatever way you decide.

    @Brock N Secondly, I'm curious if I can set up the SSL certificate on Haproxy and then have Haproxy pass the requests unsecured to the Xojo apps within my VPN. Would this work?

    Yes. You can set up ssl termination on Haproxy pretty simply by adding something like the following to your front-end config
    bind *:443 ssl crt /path/to/cert.pem. The requests between Haproxy and the backend Xojo apps are NOT encrypted but the connections to the user ARE encrypted.

  18. Brock N

    29 Aug 2014 Pre-Release Testers, Xojo Pro

    For my specific case I found this:
    http://support.rightscale.com/ServerTemplates/v12.11_LTS/Supplemental/3_Tier_Deployment_Setup_(HAProxy-IIS-SQL )

    Its instruction for using HAProxy on windows servers using IIS and connecting to stand-alone instances existing in the VPN.
    I just need to spend a day taking the time to tackle this and make sure it is set up right.

  19. John J

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

    @Brock N For my specific case I found this:
    http://support.rightscale.com/ServerTemplates/v12.11_LTS/Supplemental/3_Tier_Deployment_Setup_(HAProxy-IIS-SQL )

    Its instruction for using HAProxy on windows servers using IIS and connecting to stand-alone instances existing in the VPN.
    I just need to spend a day taking the time to tackle this and make sure it is set up right.

    Yeah it looks like a great resource for IIS users - thanks!

  20. 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

  21. 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

    Replied to the other copy of this question in the other thread. If you have more questions either start a new thread or keep it all in one thread or the other. Thx.

    https://forum.xojo.com/10913-load-balancing-web-standalone

or Sign Up to reply!