Load balancing
Posted: Fri Aug 07, 2009 12:15 pm
by johnmunro >> Thu, 14 Nov 2002 11:35:44 GMT
I've had this conversation with various Jade employees several times in the past, but I'm afraid I'm still rather in the dark, so I thought I'd have another go. I've searched the newsgroups but can't find a similar discussion.
We will limit this discussion to thin client connections, because the performance and requirements of the thick client have made us rule it out.
The problem is this: every Jade client needs to have the IP and port number of the application server it needs to connect to hard coded into its shortcut. It doesn't take much thought to see the problem - arranged in this way, it is likely that one application server will be overworked while another one sits idle. The bigger the client installation, the bigger the problem will be.
I am frankly surprised that Jade does not have a solution to this problem - I would have expected some sort of load balancing to be built into the basic Jade system. The one solution I know about was done by having all the clients connect to a name which is then resolved using DNS, and the DNS server returns a different IP address each time the DNS is resolved, so clients would connect to the app servers in round-robin order. There are a couple problems with this, first of all that it is round-robin and not intelligently assigning the least busy app server, and also it doesn't work if you have more than one app server on the same computer using different ports.
I wrote a solution, but ran into Jade problems and the project stalled there. First of all, clients do not run jade.exe, they run a VB app. The VB app connects to the database server through TCP (so all clients need to know the database server IP and the load balancing port number). There is a server application running on the database server which listens for these connections and replies to them with the IP and port of the least busy application server. The VB app then runs jade.exe connecting to the app server as normal. All of this works perfectly, except that the server application cannot get the port number from the application servers. Port isn't a property of Node (the app server), it's a property of Process (an application running on the app server). So if there is nothing running on the app server, we cannot get the port number at all, so cannot direct any clients to connect to it... Jade Support said that this could not be easily changed because it was a structural thing. This is not a huge problem at the moment though, because we have a server application which runs on each app server, so there is always at least one Process we can query for the port. The more serious problem is that Process.appServerPort always returns 0 when called from a server application running on the database server.
In communication with Jade Support, they suggested reading the app server IPs and ports from an ini file or retrieving them from the command line used to start each app server. The problem I had with this are that it always seemed to return the command line of the database server, not a particular application server. This may just be me getting confused about where the code is running, but I just couldn't ever get it to work. I think what I need to happen is for code running on the database server to cause some code to run on the application server which returns the port number back to the app running on the database server... Any help would be more than welcome.
Silvermoon Software's Jade Connection Manager product seems to do everything we want to be able to do (although I have no idea how they do it), but I'm afraid it'd be difficult/impossible to convince my superiors to add another external dependency/cost to our product.
John Munro
---
Synergist Limited - Home of FileVision
The Bioscience Innovation Centre
Cowley Road, Cambridge, UK
CB4 0DS
Telephone: +44 (0) 1223 478200
Fax: +44 (0) 1223 477969
Email: john.munro@filevision.com
Web: http://www.filevision.com
The contents of this communication are confidential and are only intended to be read by the addressee. We apologize if you receive this communication in error and ask that you contact Synergist Limited immediately to arrange for its return. The use of any information contained in this communication by an unauthorized person is strictly prohibited. Synergist Limited cannot accept responsibility for the accuracy or completeness of this communication as it is being transmitted over a public network. If you suspect this message may have been intercepted or amended, please inform Synergist Limited.
I've had this conversation with various Jade employees several times in the past, but I'm afraid I'm still rather in the dark, so I thought I'd have another go. I've searched the newsgroups but can't find a similar discussion.
We will limit this discussion to thin client connections, because the performance and requirements of the thick client have made us rule it out.
The problem is this: every Jade client needs to have the IP and port number of the application server it needs to connect to hard coded into its shortcut. It doesn't take much thought to see the problem - arranged in this way, it is likely that one application server will be overworked while another one sits idle. The bigger the client installation, the bigger the problem will be.
I am frankly surprised that Jade does not have a solution to this problem - I would have expected some sort of load balancing to be built into the basic Jade system. The one solution I know about was done by having all the clients connect to a name which is then resolved using DNS, and the DNS server returns a different IP address each time the DNS is resolved, so clients would connect to the app servers in round-robin order. There are a couple problems with this, first of all that it is round-robin and not intelligently assigning the least busy app server, and also it doesn't work if you have more than one app server on the same computer using different ports.
I wrote a solution, but ran into Jade problems and the project stalled there. First of all, clients do not run jade.exe, they run a VB app. The VB app connects to the database server through TCP (so all clients need to know the database server IP and the load balancing port number). There is a server application running on the database server which listens for these connections and replies to them with the IP and port of the least busy application server. The VB app then runs jade.exe connecting to the app server as normal. All of this works perfectly, except that the server application cannot get the port number from the application servers. Port isn't a property of Node (the app server), it's a property of Process (an application running on the app server). So if there is nothing running on the app server, we cannot get the port number at all, so cannot direct any clients to connect to it... Jade Support said that this could not be easily changed because it was a structural thing. This is not a huge problem at the moment though, because we have a server application which runs on each app server, so there is always at least one Process we can query for the port. The more serious problem is that Process.appServerPort always returns 0 when called from a server application running on the database server.
In communication with Jade Support, they suggested reading the app server IPs and ports from an ini file or retrieving them from the command line used to start each app server. The problem I had with this are that it always seemed to return the command line of the database server, not a particular application server. This may just be me getting confused about where the code is running, but I just couldn't ever get it to work. I think what I need to happen is for code running on the database server to cause some code to run on the application server which returns the port number back to the app running on the database server... Any help would be more than welcome.
Silvermoon Software's Jade Connection Manager product seems to do everything we want to be able to do (although I have no idea how they do it), but I'm afraid it'd be difficult/impossible to convince my superiors to add another external dependency/cost to our product.
John Munro
---
Synergist Limited - Home of FileVision
The Bioscience Innovation Centre
Cowley Road, Cambridge, UK
CB4 0DS
Telephone: +44 (0) 1223 478200
Fax: +44 (0) 1223 477969
Email: john.munro@filevision.com
Web: http://www.filevision.com
The contents of this communication are confidential and are only intended to be read by the addressee. We apologize if you receive this communication in error and ask that you contact Synergist Limited immediately to arrange for its return. The use of any information contained in this communication by an unauthorized person is strictly prohibited. Synergist Limited cannot accept responsibility for the accuracy or completeness of this communication as it is being transmitted over a public network. If you suspect this message may have been intercepted or amended, please inform Synergist Limited.