Introduction
Out of the box, CAST Console will open and maintain connections to the configured CAST Storage Services/PostgreSQL instances from the various services as follows:
Node service(s) for result storage | Node service(s) to aip_node schema | Registry service to aip_config schema | |
---|---|---|---|
Console ≥ 2.x | |||
Console 1.x |
The services are set to open the following number of connections by default:
minimum idle | maximum pool size | |
---|---|---|
Console ≥ 2.6.2 | 5 | 10 |
Console 2.0 - 2.6.1 | - | - |
Console 1.x | 10 | 10 |
Where the following explains the two values:
minimum idle | This property controls the minimum number of idle connections that the service attempts to maintain in the pool. If the number of idle connections dip below this value and total connections in the pool are less than maximumPoolSize , the service will make a best effort to add additional connections quickly and efficiently. |
---|---|
maximum pool size | This property controls the maximum size that the pool of connections is allowed to reach, including both idle and in-use connections. In other words, this value will determine the maximum number of actual connections to a CAST Storage Service / PostgreSQL instance. |
If you would like to customize these values, please see below.
Customizing the default values
Console 2.x
For Console 2.x, prior to release 2.6.2, no default values were set and therefore it is not possible to change the settings. In Console ≥ 2.6.2, default values were introduced for all scenarios which can also be customized if required.
Customizing connections from the Node Service(s) for result storage
This customization involves updating values in the aip_config schema which contains settings for the various Nodes managed by Console. Using pgAdmin, connect to the CAST Storage Service/PostgreSQL instance on which the aip_config schema has been installed. Locate the properties table and then locate the following entries:
Click to enlarge
The Value column contains the default values for minimum idle and maximum pool size - change them as required. For example you can run the following query to set the minimum idle to 10 and the maximum pool size to 20:
update aip_config.properties set value='10' where application = 'application' and prop_key = 'database.server.minimumIdle'; update aip_config.properties set value='20' where application = 'application' and prop_key = 'database.server.maximumPoolSize';
After making the change, restart all Node services to ensure the changes are taken into account.
Customizing connections from the Node service(s) to the aip_node schema
This customization is performed on a per-Node basis, therefore repeat the process for each Node you wish to customize.
Locate and edit the following properties file:
Enterprise mode: %PROGRAMDATA%\CAST\AIP-Node\application-default.yml
Copy the following into the file under the existing spring: datasource:
entries where X is the required value for each property:
hikari: minimum-idle: X maximum-pool-size: X
For example to set the minimum idle to 10 and the maximum pool size to 20:
spring: ... datasource: ... hikari: minimum-idle: 10 maximum-pool-size: 20
Save the file and then restart the relevant Node service(s) to ensure the changes are taken into account.
The default values are present in the application.yml
file located alongside the application-default.yml
file, however, you should always edit the
for customization purposes since it overrides the content of application-default.yml
application.yml
and the file is never overwritten during an upgrade.
Customizing connections from the Registry service to the aip_config schema
Locate and edit the following properties file:
Enterprise mode Microsoft Windows global installer: %PROGRAMDATA%\CAST\CAST-Imaging-Console\AIP-Service-Registry\application-jdbc.yml Enterprise mode Microsoft Windows separate JAR files: %PROGRAMDATA%\CAST\AIP-Console\AIP-Service-Registry\application-jdbc.yml
Copy the following into the file under the existing spring: datasource:
entries where X is the required value for each property:
hikari: minimum-idle: X maximum-pool-size: X
For example to set the minimum idle to 10 and the maximum pool size to 20:
spring: ... datasource: ... hikari: minimum-idle: 10 maximum-pool-size: 20
Save the file and then restart the Registry service to ensure the changes are taken into account.
The default values are present in the application.yml
file located alongside the application-jdbc.yml
file, however, you should always edit the
for customization purposes since it overrides the content of application-jdbc.yml
application.yml
and the file is never overwritten during an upgrade.
Console 1.x
For Console 1.x, the only connections that can be configured are from the Node(s) to the CAST Storage Service/PostgreSQL instance for result storage.
Step 1 - Edit the configuration file
A configuration file (aip-node-app.properties
) must be edited to make these changes. This file is available on EACH Node, therefore if you have more than one Node, you will need to make this change on all Nodes.
To do so, first locate this file:
<installation_folder>\AipNode\data\aip-node-app.properties
Edit the file with a text editor and locate the following lines:
# Minimum number of idle connections that are maintained in the connection pool. Recommended: same as maximumPoolSize database.server.minimumIdle=10 # Maximum size that the connection pool is allowed to reach, including both idle and in-use connections database.server.maximumPoolSize=10
Make your changes as necessary. CAST recommends keeping both options to the same value where possible for Console 1.x, therefore if you decrease database.server.maximumPoolSize
, you should also decrease database.server.minimumIdle
to match. Save the file when the changes are complete.
Step 2 - Apply configuration changes
Restart the Node(s) to ensure all changes are taken into account:
- If the Nodes are installed as Windows Services, restart the services
- If the Nodes are running only using the batch files, close the CMD windows to stop the processes, then restart then using the following file:
<installation_folder>\AipNode\tools\runAipNode.bat