To use multiple instances of Web Server on a single CPU, the Dispatcher is required. The Dispatcher is a stand-alone process that initiates when a user runs the RunWithDispatcher.bat file. Dispatcher.exe executes two instances of Web Server for each CPU, each with one gigabyte of memory. As defined in the sizing requirements, each instance can support up to twenty users on a single CPU.
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.
- const SHOW_TRAFFIC
-
This parameter determines whether the log files will display network traffic information. By default, this parameter is set to '0', which means that no traffic is logged. To enable traffic logging, change the parameter value 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: While using the dispatcher with a message server, consider changing the child listen port to a value distinct from '80' to distinguish the child process from the primary dispatcher. This prevents exposing the child machine, as port 80 is commonly used for the HTTP protocol. Additionally, changing the port helps avoid potential conflicts with other applications running on the child machine.const LISTEN_PORT = 80;
- const MAX_CLIENT
-
This parameter determines the maximum number of clients that can simultaneously connect to the Web Server. By default, the number is set to 100. You can modify this parameter, but ensure to check sizing requirements before making any modifications.
const MAX_CLIENT = 100;
- const CHECK_CYCLE
-
This parameter specifies the debug window will display a status report on the load of each instance of the Web Server every ten seconds. The default value is '10000' milliseconds. Change the value to modify the parameter.
const CHECK_CYCLE = 10000;
- const MESSAGE_SERVER
-
This parameter is used if you are connecting to a message server. An example is shown below.
const MESSAGE_SERVER = <HostName:AdminPort>;
Note: The HostName parameter represents the name of the message server. The AdminPort value is determined by adding 1 to the LISTEN_PORT value. For instance, if the LISTEN_PORT is set to port 80, the AdminPort will be port 81. In cases where the message server and the dispatcher are running on the same server, an empty string should be entered, as shown 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 4000 but can be changed to any unused port. If you run multiple instances of the Web Server, increment the port number by one for each additional instance. For example, if you have four instances, use ports 4000, 4001, 4002, and 4003. However, changing this value is not recommended unless specifically 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 listening ports. Each child server is 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 if 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 the 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 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 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";