Use it to configure more than one ERP service for load balancing via software.


Scope
ERP 10 and 11

To accomplish this, enter the servers available on the network to make the connection(s). Moreover, for each available server, you need to create a new section in the configuration file (appserver.ini) of the TOTVS | Application Server, then enter the connection type (TCP), port, server name and/or IP and the maximum number of connections allowed for the server at issue.

Structure

See below the keys related to section [ServerNetwork]:

Example

[ServerNetwork]
Servers=SERVER1,SERVER2 

[SERVER1]
TYPE=TCPIP
Server=Servidor1
Port=1024
Connections=60

[SERVER2]
TYPE=TCPIP
Server=Servidor2
Port=3024
Connections=40

Load Balancing Considerations

When we configure an ERP service for load balancing, we name it Master or Balance. The other servers comprising the list of servers for balancing, specified in key SERVERS, we call Slaves.

Important

We recommend you should not point the ERP service, created for load balancing, to itself as a Slave for running programs and/or processing.

When we configure a service for load balancing, we must configure the ERP "Slave" services with the same environments configured in the balancing service, in which each environment of same name shares the same rootpath. To make this possible, we must share the root folder of the environment in the server where the files are found, and all rootpath configurations that access these files must point to the network path of this sharing, including the services in the very machine where the files are found. The Slave services must access the sharing in the server created for the rootpath with "FULL" rights on the folder, subfolders and their content. Additionally, you must use an RDD to control the local files with client-server architecture, such as an ADS Server (for Windows platforms) or c-tree Server (for Windows and/or Linux). For Unix/Linux platforms, additional stages exist, such as the configuration of a LockServer service and the network sharing to access the files, which you must do via NFS, with the Slave servers that access the rootpath via NFS mapping this path with the same path of the machine in which the files are physically located.

Additional Information


  • Number of connections
    The maximum number of connections allowed (CONNECTIONS), entered for each server of the list, is not originally a limiting factor of the number of connections, but actually a base number for distribution. Thus, we suggest that, once you configure the maximum number of estimated user connections the equipment withstands, to better distribute the environment load.
    For example, in the aforementioned configuration, 60% of connections are directed to Slave 1 and 40% to Slave 2. However, this configuration does not limit the environment to 100 connections.
    From release 7.00.111010P onwards, you can enable a new configuration called BALANCELIMIT to make the specified number of connections a limiting factor for balancing. For further information, check the Release Note
  • Number of ERP services recommended per Server
    At first, a computer dedicated to bearing ERP services configured as "Slaves" can have more than one ERP dedicated service in the same equipment. We recommend you do this, for as long as the equipment has enough memory to support the projected load, AND, the server at issue has more than one processor or processing core, AND the number of ERP services configured in the computer does not surpass the number of processing cores of the machine. The use of more than one service, even if in a single machine, improves scalability and processing robustness, more productively using the processing capacity of the computer.
  • SSL Connection - Secure Sockets Layer
    The SSL connection between TOTVS | SmartClient and TOTVS | Application Server was not supported in the earlier platform (in builds equal to or below 7.00.080307A). In this platform, you can set a secure configuration (SSL) for the Slave and Master/Balance servers. For further information regarding SSL configurations in the ERP, refer to the documentation of section [SSLConfigure].
  • Initially, you must enable the secure connection (SSL) in the Slave service of the ERP. So that, each Slave service has a TCP connection port and a SSL secure connection port. However, when you configure the sections of the Slave servers specified in section [ServerNetwork], key SERVERS, you must enter the secure connection port of each Slave through key SecurePort.Notice, in the example below, the configuration of two Slave services in different machines, in which each of the services has port TCP 5054 open and secure connection port (SSL) 6024.
    In this example, we configure TOTVS | SmartClient to connect to the TCP port of service Master/Balance, which distributes this connection to one of the Slaves configured in the specified SSL port. Even if you did not explicitly configure the TOTVS | SmartClient for secure connections, when the TOTVS | Application Server redirects the connection to a Slave with SSL, the TOTVS | Application Server ensures that the connection is safe. Thus, there is no need for you to configure the SSL in the Master/Balance server as well.

    [ServerNetwork]
    Servers=SERVER1,SERVER2
    
    [SERVER1]
    TYPE=TCPIP
    Server=Servidor1
    Port=5024
    SecurePort=6024 
    Connections=60
    
    [SERVER2]
    TYPE=TCPIP
    Server=Servidor2
    Port=5024
    SecurePort=6024
    Connections=60

    However, if the TOTVS | SmartClient is configured to directly make secure SSL connections only, then you must enable SSL in the Master/Balance server and the connection configured in TOTVS | SmartClient must point to the SSL port of the Master server, not to the TCP port.

  • TCP / SSL Connections and Ports
    For load balancing, when you configure the servers, you must specify the TCP port of the Slave in key Port, and the secure connection port in key SecurePort. The Master/Balance server will establish a TCP connection with each of the Slaves, for distribution control and monitoring.
    Content limit of key "SERVERS": The configuration file (totvsappserver.ini) has a limit of characters per key of 254 bytes. When you configure the key Servers, of section [ServerNetwork], with the names of Slave service configuration sections, and the quantity of characters used surpasses 254 bytes, the system takes only the first 254 bytes into account. Thus, not all specified sections are regarded. In builds previous to 7.00.081215P, you must use shorter names to identify each slave service involved in balancing, to specify the list of services in just one line, without exceeding the 254 bytes limit per line. For builds equal to or above 7.00.081215P, you can create additional keys in sequence (servers1, servers2, servers...n ) to continue the list of services.  For further details, refer to the Release Notes


  • No labels