Load Balancing in a 3DOrchestrate Cluster

A 3DOrchestrate cluster is a group of interconnected 3DOrchestrate Distribution Servers that act as a single entity to transparently run simulation process jobs. A 3DOrchestrate cluster performs load balancing to achieve better scalability under heavy processing loads and high availability for failover.

This page discusses:

The fundamental feature of a load balancer is the ability to distribute incoming requests over a number of backend servers in the cluster according to a scheduling algorithm.

In a 3DOrchestrate cluster, any 3DOrchestrate station can transparently receive and execute any activity from any of the 3DOrchestrate servers.

For an overview of load balancing in the 3DEXPERIENCE platform, see Before Starting the Installation.

The figure below shows the key network components of a 3DOrchestrate cluster.



Reverse proxy server The reverse proxy server is identified by a specific network socket (hostname and port). There must be only one reverse proxy server instance. The reverse proxy server is the 3DOrchestrate cluster front end for external HTTPS traffic generated by 3DOrchestrate private stations and simulation client apps.
Load balancer The load balancer is identified by a specific network socket (hostname and port). There must be only one load balancer instance. The load balancer is the 3DOrchestrate cluster front end for internal HTTP traffic within the 3DOrchestrate perimeter.
JMS brokers

The cluster includes a network of ActiveMQ JMS brokers. Each broker is identified by a set of specific information (index, tag, hostname, multiple ports, etc.).

3DOrchestrate server cluster

The 3DOrchestrate server cluster consists of multiple TomEE 3DOrchestrate applications that share memory. Each 3DOrchestrate server is identified by a set of specific information (index, tag, hostname, multiple ports, etc.).

Database instance (not shown above) The database instance for the 3DOrchestrate Distribution Server application is identified by JDBC connection parameters. There must be only one instance of this database.
Network shared folder A folder/directory on a shared network disk that is used by all 3DOrchestrate servers to share data files required for standard operations.

There are two ways to set up the 3DOrchestrate servers in a high availability cluster:

Vertical clustering
Running multiple 3DOrchestrate servers and ActiveMQ brokers on a single machine.
Horizontal clustering (recommended)
At least two 3DOrchestrate servers and two ActiveMQ brokers are hosted on separate machines. This is the recommended configuration for maximum fault tolerance and performance.

Apache ActiveMQ is an open-source message broker together with a full Java Message Service (JMS) client. ActiveMQ 5.10.1 is included with the 3DOrchestrate installation and is the only supported ActiveMQ version.

HAProxy server is the recommended load balancer to use with 3DOrchestrate. HAProxy is a popular open-source TCP/HTTP load balancer and proxying solution that is included with most mainstream Linux distributions. See http://www.haproxy.org/.

For details about configuring the reverse proxy server, see Reverse Proxy Configuration for 3DOrchestrate.

Steps for Configuring a Cluster

To configure your 3DOrchestrate system in a load-balancing cluster, you can use the 3DOrchestrate deployment utility to do the following:

  1. Set up the shared network drive for use by the cluster servers. See Shared Network Disk Space below.

  2. Configure the database connection. See Configuring the JDBC Database Connection.

  3. Register all information describing the network components of the cluster. See Registering the Reverse Proxy, Load Balancer, and ActiveMQ Brokers.

  4. Prepare and deploy the server applications. See Registering, Deploying, and Configuring the 3DOrchestrate Servers.

  5. Start and stop each instance of the ActiveMQ message broker and 3DOrchestrate server. See Starting and Stopping the ActiveMQ Brokers and 3DOrchestrate Servers.

Important: Ensure that every 3DOrchestrate server in your cluster has the same ID. This ID is set in the smaexe.eed.id property in the <server_install_dir>/config/SMAExeServer-xxxx.properties file.

Shared Network Disk Space

With horizontal clustering, you run the multiple 3DOrchestrate servers on different server machines. In this configuration, you must allocate a network shared folder/directory for use by all the 3DOrchestrate servers. You specify the path to this shared folder for each 3DOrchestrate server when you register them (in Registering, Deploying, and Configuring the 3DOrchestrate Servers).

The 3DOrchestrate servers use this disk space to share data files required for standard operations. The directory/folder you specify must comply with the following guidelines:

  • Already exists when you use the command smaexe-deploy ... share=<network-share-path> EnlistEED to register each server.
  • Is accessible from every Windows and Linux computer that is hosting a 3DOrchestrate server.
  • Has appropriate read/write permissions for all user accounts that might potentially execute a 3DOrchestrate server.
  • Has enough disk space for normal 3DOrchestrate operations. It is impossible to recommend a standard amount of disk space because this depends on your specific business needs. However, do not underestimate the storage needed. Be sure to set up some sort of disk monitor or probe to ensure that this directory does not run out of space.

    You should provision 1 GB storage to start with, and then monitor the file activity for a reasonable amount of time before resizing.

Plan this disk space allocation ahead of time, before you begin configuring your cluster.

Cluster Operation

From the point of view of simulation client apps and end users, the 3DOrchestrate server cluster has only one endpoint URL in the 3DEXPERIENCE platform system:

https://<hostname>:<port>/SMAExeServer-REST

Additional Configuration

In load balanced COS (Compute Orchestration Service) deployments, remote job execution for Results Analytics and Parametric Design Study app relies on WebSocket connections to provide job status and result updates. If the load balancer has a low idle timeout, Apache might cause these WebSocket connections to close during periods of inactivity, causing the client to loose connection and the job might appear to timeout or stop updating.

To prevent this unexpected WebSocket disconnection, configure the Apache load balancer with a suffentiently large ProxyTimeout value so that WebSocket connections remain open for the duration of the job. For example, set the ProxyTimeout = 600 in the Apache configuration for the virtual host.

Below is an example of a snippet form an Apache server config file, here the ProxyTimeout value is set to 3600 seconds. The corresponding settings might be different for other load balancing configurations.

Listen 446
<VirtualHost *:446>
ServerName stationname.dsone.3ds.com
ServerAlias stationname.dsone.3ds.com
ErrorLog D:/Apache24/logs/3DOrchestrateError.log
TransferLog D:/Apache24/logs/3DOrchestrateaccess.log
ProxyTimeout 3600
LogLevel warn
SSLEngine on
SSLProxyEngine On
SSLCertificateFile conf/ssl/stationname.cer
SSLCertificateKeyFile conf/ssl/stationname.key
Include D:/installers/COS-LSF-config/cos2.conf
</VirtualHost>

Below is an example of a timeout configuration in HAProxy used in cloud deployment.

###
### Template Hapee LB Defaults (v2)
###  
### Version:  2022-10-13
###

defaults
     #TAG_TO_INSERT_OPTIONS#
     #INITIALISATION_DONE#
     #ADD_DEFAULTS_OPTIONS_DETAILS#
     mode http
     log global
     log-tag lb-proxy
     option dontlognull
     option redispatch
     option contstats
     retries 3
     backlog 10000
     timeout client 25s
     timeout connect 5s
     timeout server 25s
     timeout tunnel 3600s
     timeout http-keep-alive 1s
     timeout http-request 15s
     timeout queue 30s
     timeout tarpit 60s