Load balancing involves using the Dispatcher to distribute the load of many users and machines among multiple instances of Web Server so as to reduce the strain on the network and speed up the work. The way this works is that the Dispatcher will load once you run it. This is a stand-alone process and loads when you run the 'RunWithDispatcher.bat' that is included in the Web Server package. This process will then distribute the load among any sub-servers that you have configured and designated. Please note that Web Server must be installed on each sub-server as well as on the main message server. The Dispatcher will always send the load to the message server first, and then will distribute it to the sub-servers. The Dispatcher will always send the load to the fastest sub-server first.
Error recovery is handled via the SynWatchDog application. This application will re-launch the message server dispatcher and any other Web Server instances in the vent of any failures, enabling you to reconnect to your session. If a Web Server instance fails, SynWatchDog can also re-launch that particular instance. Should the machine itself fail, you should ensure that none of the programs from the previous session are still running, Once that is done, you can re-boot the machine and re-launch the Web Server and Dispatcher.
To implement a load-balancing environment using Web Server, please do the following.
Edit any necessary parameters in the Dispatcher.js file. The parameters that usually require editing for a load-balancing scenario are the following.
- Listen_Port: This will need to be set to a unique port for each instance of Web Server. In other words, if the default port for the first instance of Web Server is set at 80, then we recommend incrementing each subsequent sub-server by a factor of one (1). For example, the first port might be 81, the second 82, and so forth.
MAX_CLIENT: You will need to designate the maximum number of clients who can concurrently connect to a single instance of Web Server. An example is shown below.
MAX_CLIENT = 100;
MESSAGE_SERVER: This will be set to the actual name of the message server. if all the activity is occurring on a single server, then the message server name should be set as blank as in the following example" ".
MESSAGE_SERVER = " ";
SERVER_BASE_PORT: This is the port umber for the first instance of Web Server. If there are two instances of Web Server starting at port 4000, then you must have two unique base ports and the port numbers would be 4000 and 4001. In this example, see the following parameter.
SERVER_BASE_PORT = 4000;
SERVER_NUM: This value must equal the number of the servers involved. If there are two servers, then there must be two unique server numbers, as shown in the following example.
SERVER_NUM = 2;
SERVER_THRESHOLD: This value specifies the minimum number of users that will trigger the load distribution. Once this number ios reached, the Dispatcher will then distribute any further connections to the sub-servers.
Change the MESSAGE_SERVER parameter in the sub-server Dispatcher.js files as follows.
MESSAGE_SERVER = <your_Message_Server>