Please enable JavaScript to view this site.

InterFormNG2 Manual

For multi-server installations with high availability, we support an active-active setup with multiple active application server instances, supported by a shared relational database. A load balancer should be in front, to distribute HTTPS requests between the instances. As database we recommend MySQL, but PostgreSQL is also expected to work well.

 

Such a setup can be illustrated by the image below:

 

 

NG2LoadBalancer0001

 

 

Such a High Availability setup/load balancer can e.g. be setup if you setup the multiple InterFormNG2 servers to use one common database like indicated above.

 

A suggestion for the database configuration is covered in the section below.

 

 

High Availability - Database Configuration

In a high-availability setup with multiple application servers, data can be shared between the application servers in a relational database. All resources, settings, job logs, user information, printer queue items etc. should be stored in the database, to be available to all application servers.

 

The recommended database is MySQL. Alternatively PostgreSQL also works well.

 

To configure use of a shared database, a number of properties must be set in the configuration file, application-default.properties.

This file is covered here for the IBM i platform and here for Windows.

For new customers running version 3.4.0 og higher of InterFormNG2, we recommend the following configuration (replace database host name, username and password with the correct ones for your system):

 

ng2db.dbdatasource.url = jdbc:mysql://localhost:3306/data_{TENANTID}?useSSL=true&enabledTLSProtocols=TLSv1.2&createDatabaseIfNotExist=true&serverTimezone=UTC

ng2db.dbdatasource.driver = com.mysql.jdbc.Driver

ng2db.dbdatasource.hibernateDialect = org.hibernate.dialect.MySQL5InnoDBDialect

ng2db.dbdatasource.username = username

ng2db.dbdatasource.password = password

 

settings=database

userRepository=database

interform.defaultResources=database:ng2db.dbdatasource

versioning.provider=database

 

ng2.poolProvider=com.interform400.connectionPool.InterFormConnectionPool

ng2.combinePools=true

enable.multiServer=true

ng2.maxIdleTime=60

ng2.maxPoolSize=5

 

Note that this configuration is for a database connection with TLS encryption.

 

Each tenant will have its own database (the tenant name will replace {TENANTID} in the URL). Initially the default home tenant will have the database name “data_home”.

 

If you are often running a lot of concurrent workflows on a single tenant, you may see improved performance by increasing the connection pool size, to allow for more concurrent database connections. This can be done by changing the value of ng2.maxPoolSize to a number higher than 5. Note that the database has a limit on how many connections it allows. Make sure that the connection limit on the database is set to more than:

 

ng2.maxPoolSize * (number_of_tenants + 1) * number_of_application_servers

 

On MySQL the default connection limit is typically 151. To increase it to for instance 1000, you can run this SQL as a user with SUPER privileges:

 

SET GLOBAL max_connections = 1000;

 

Existing customers

For existing customers, that set up a shared database before InterFormNG2  Version 3.4.0 and are running a multi-tenant environment, we recommend switching to the new InterForm connection provider which is available in Version 3.4.0 and newer. The InterForm connection provider only has a single pool for each tenant database, whereas the default connection provider has one pool per application domain. For instance the configuration suggested for previous versions of InterFormNG2 would have resources and settings in the same database, but separate connection pools for each.

Using the InterForm connection provider will reduce the maximum number of connections required.

 

To use the InterForm connection provider, add the following properties in the configuration file, application-default.properties:

(This file is covered here for the IBM i platform and here for Windows.)

 

ng2.poolProvider=com.interform400.connectionPool.InterFormConnectionPool

ng2.maxIdleTime=60

ng2.maxPoolSize=5

 

Again, ng2.maxPoolSize should be adjusted depending on the actual load.

Some cloud services impose a limit on the maximum connection setting on the database. For multi-tenant environments with a high number of low-load tenants, it can therefore be a good idea to reduce this to a number less than 5, to limit the maximum number of connections. The setting ng2.maxIdleTime is the number of seconds that a connection is kept open after its last use. Another way to reduce the number of concurrent connections, it to reduce this value.