Load Balancing Web Standalone

Has anyone played around with load balancing a standalone web app? So in effect scaling out rather than scaling up. I am thinking that we may end up with 500 - 1000 simultaneous connected users to our standalone web app which is running on a Windows 2012 server but from what I have read Xojo web apps only deal with a few hundred connections. Is load balancing / scaling out the best option? I would be interested to hear from anyone else who has a web app with lots of users.

If you scale out with multiple app instances, and you rely on session to session notifications or communication, you’re going to have to implement that in the back-end. Design accordingly.

Yeah, thats what I thought, too new at Xojo to even think about that yet!!! Maybe this is something you might consider adding to mySession as I can see scaling out being needed for standalone web apps but maybe I am missing the point and I should be looking at the CGI option instead???

Ah you should have seen Travis presentation at XDC which is on exactly this topic

1 Like

Did you guys video it?

No.
And anyone who did is only permitted to use it for personal use - copyright laws being what they are.

Thats why I said “you should have seen Travis presentation at XDC which is on exactly this topic” instead of “oh you should see travis presentation” which would imply you still could (via video etc)

However you might be able to persuade travis to write a blog post about this topic

Norman, I would have loved to have been at XDC but as I live in Jersey (a small island between England and France) it was going to cost me about ÂŁ3000 which the wife said was not happening this year :frowning: Once I know where it is going to be next year I should be able to book early enough to bring the cost down. How do I get in touch with Travis to beg, grovel, smiling nicely at, etc etc :wink:

Don’t get me wrong Nathan - I realize that not everyone can get there for any number of reasons (cost, timing, etc)
But we did not video tape sessions - that’s a beg / grovel / cajole kind of conversation you should have with Geoff as thats his decision

I’m sure you can / could email customer service requesting such a blog post & they’ll see he gets it
I know right now Travis is up to his ears working with greg on xojo cloud so it might not happen ASAP

Norman:

Travis owns the rights or Xojo?

[quote=78516:@Norman Palardy]No.
And anyone who did is only permitted to use it for personal use - copyright laws being what they are.
Thats why I said “you should have seen Travis presentation at XDC which is on exactly this topic” instead of “oh you should see travis presentation” which would imply you still could (via video etc)
However you might be able to persuade travis to write a blog post about this topic[/quote]
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).

This means some knowledge is reserved to a small group of peoples who can go to XDC, the others (certainly a lot more) will stay in ignorance.

Those peoples may then not be in a good mood to share knowledge in return, even if they do. Ultimately this does not entertain a good spirit of knowledge sharing.

Perhaps there are some legal issues I’m not aware of that prevent Xojo Inc. to record and sell those sessions ?

Presentations by Xojo are owned by Xojo whoever records them…

Coming back to the initial question: If you intend to balance the load by DNS round robin than in fact you have to prepare your backend to handle sessions perfectly. However, if you buy a professional load balancer, you can configure it to have the same user session always arriving at the same application server. You can even tell the load balancer to not allow new user sessions, so that you can wait until the last user leaves the application before maintaining the relevant application server.
This is actually the mechanism which is used in large scale environments (100.000+ simultanous users), much because the classic cluster solutions become to expensive.

If you need a high level design blueprint, please let me know.

We hope to see these video…

By the way, for load balancing there are many 3rd party tools that you can use them. Before some months, John Joyce and me had opened the same discussion about the load balancing and SSL. The results was that Web Xojo supports SSL !!! and nobody knew that. At least we found out by discussion. Greg informed us for that !!!

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.

But … using dns , you can redirect the traffic on different servers, Also using NgIn and Haproxy, you can do it the same thing and to redirect the traffic to many web apps. The only disadvantage of this solution, you need to use cookies.

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.

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

[quote=78621:@Guy Rabiller]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).
[/quote]
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

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

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.

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.

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.

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.

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