Liquid UI - WS Reference Library

3.6 Dispatcher.js


When you wish to run multiple instances of Web Server within a single CPU, it is necessary to use the Dispatcher. The Dispatcher is a stand-alone process that is included in the Web Server package and which loads when a user runs the RunWithDispatcher.bat file. Dispatcher.exe runs two instances of Web Server per CPU with one gigabyte of memory per instance. Each instance can support up to twenty users on a single CPU as defined in the sizing requirements.

In a Dispatcher environment, it is recommended that a user first distributes the load to the message server Dispatcher. The message server Dispatcher will then distribute the load among the sub-servers, choosing the fastest such sub-server first.

To use Dispatcher, it is first necessary to modify the Dispatcher configuration file. This file is named Dispatcher.js and is located in the following directory.

C:\Program Files\Synactive Inc\GuiXTFuzion

An example of a typical Dispatcher.js file is shown below.

Note: Please note that this file is provided for reference purposes only, as you will not need to edit it under most circumstances. The parameters are defined as follows.
const SHOW_TRAFFIC

This parameter defines whether or not the network traffic will be shown in the log files. The default setting is '0' as shown below, which means that no traffic will be displayed. To show traffic, change the parameter from '0' to '1'.

const SHOW_TRAFFIC = 0;
Note: This setting is typically disabled in release versions of Web Server.
const USING_SSL

This parameter specifies if you are or are not using SSL on the Web Server. By default, it is set to '0' as shown in the example below. To use SSL, change the parameter from '0' to '1'.

const USING_SSL = 0;
const LISTEN_PORT

This parameter specifies the listen port for the dispatcher. By default, it is set to '80'. To change the listen port, please select another port number.

Note: If you plan to use the dispatcher with a message server, we recommend changing the child listen port to something other than '80', so as to distinguish the child from the main dispatcher. In addition, since we are using the dispatcher as the only connecting point to the Web Server, we don't want to expose the child machine by using port 80, which is a generic port for the HTTP protocol. We don't want to conflict with other applications on the child machine either.
const LISTEN_PORT = 80;
const MAX_CLIENT

This parameter specifies the maximum number of clients that can connect simultaneously to the Web Server. By default, the number is set to 100. To change this parameter, you need only change the number. However, we recommend checking the sizing requirements before making any changes to this parameter.

const MAX_CLIENT = 100;
const CHECK_CYCLE

This parameter specifies that every ten seconds the debug window will display a status report on the load of each instance of the Web Server. The value is in milliseconds and by default it is set to the value '10000' as shown below. To change the parameter, you need only change the value.

const CHECK_CYCLE = 10000;
const MESSAGE_SERVER

This parameter is only used if you are connecting to a message server. An example is shown below.

const MESSAGE_SERVER = <HostName:AdminPort>;
Note: The HostName value is the name of the message server, and the AdminPort value is equal to the LISTEN_PORT value + 1. In other words, if the LISTEN_PORT is port 80, the AdminPort will be port 81. If the message server is the same server as that where the dispatcher is running, you should enter an empty string as in the following example.
const MESSAGE_SERVER = "";
const SERVER_NAME

This parameter contains the name of the executable file. By default, it is set to 'GuiXT4WebApp.exe' and we do not recommend changing it.

const SERVER_NAME = "GuiXT4WebApp.exe";
const SCRIPT_NAME

This parameter specifies the name of the script file that is called when the Web Server executable starts. By default, it is set to the value 'WebServer.js' and we do not recommend changing it.

const SCRIPT_NAME = "WebServer.js";
const SERVER_BASE_PORT

This parameter specifies the base communication port of the initial instance of the Web Server. By default it is set to the value '4000', but it can be set to any port that is not a commonly used one. If you are running multiple instances of the Web Server, then you must increment this port by one for each new instance. For example, if you are running four instances, you would set the ports to '4000', '40001', '40002', and '4003'. However, we do not recommend changing this value unless so instructed by a Synactive support representative.

const SERVER_BASE_PORT = 4000;
const SERVER_NUM

This parameter specifies how many child servers will be in place, as well as the range of the listen ports. Each child server is actually a separate process on the server where the Dispatcher runs and will require its own unique listen port. By default, this value is set to '2' as in the example below, so for each new child server, you must increment the value of the SERVER_NUM parameter. For example, if you desire six processes, you will set the SERVER_NUM parameter to '6'.

const SERVER_NUM = 2;
const SERVER_TIMEOUT

This parameter specifies the time before all instances of the Web Server will be shut down in the event that the dispatcher shuts down. This parameter also takes effect if one of the instances hangs - this parameter will force that particular instance to shut down when the timeout limit has been reached. This value is in seconds and the default is thirty as shown in the example below.

const SERVER_TIMEOUT   = 30;
const SERVER_THRESHOLD

This parameter specifies the minimum number of connections to each instance of Web Server that will exceed the threshold, triggering the Dispatcher to allocate new connections to other sub-servers. The value is in seconds and by default is set to twenty as shown in the following example.

const SERVER_THRESHOLD = 20;
SSL_PARAPHRASE

This parameter is only applicable if you are connecting via SSL. It specifies the security passphrase when you are using SSL. The default is 'Alana888', as shown in the example below. You must enter your own passphrase when you activate the SSL functionality built into the Web Server.

const SSL_PARAPHRASE  = "Alana888";
const SSL_KEYFILE

This parameter is only applicable if you are using the SSL functionality of the Web Server. It defines the keyfile used. By default, the value is 'server.key' as in the following example. If you change the name of the keyfile, you must also change this parameter in order for SSL to work as expected.

const SSL_KEYFILE     = "server.key";
const SSL_CERTIFICATE

This parameter is only applicable if you are using SSL. It defines the certificate that will be used for authentication. By default, the value is 'server.crt' as in the following example. If you are using a different certificate, you must change this parameter in order for the SSL functionality to work as expected.

const SSL_CERTIFICATE = "server.crt";