Connection pools
As mentioned previously, REST Services uses connection pools to satisfy incoming requests. Connection pools can improve request performance by performing common operations such as initialize, logon, and open folder once during application startup. REST Services has several parameters available for tuning the connection pool, shown in the following list. The default values offer a good starting point from which further fine-tuning can be made. Be aware that increasing these values might improve performance on the Application Server, but have unintended poor performance on the Content Manager OnDemand server. Before you move your REST Services application into production, you should perform a variety of performance testing to ensure that your environment can accommodate the expected load.
The default values for the connection pool parameters are:
minIdlePerPool = 3 - Initial number of connections per pool
maxIdlePerPool = 10 - Maximum number of idle connections per pool
maxTotalPerPool = 10 - Maximum total connections per pool
maxTotal = 40 - Maximum connections (all pools)
maxWaitMillis = 5000 - Maximum wait time for a connection in milliseconds
These parameters are used to calculate other aspects of the connection pools. For example, 40 maximum connections (maxTotal) and 10 maximum connections per pool (maxTotalPerPool) would indicate that only four pools can be created for a REST Services deployment on a given Application Server. Similarly, exceeding the maxTotal connections during runtime can have undesirable consequences. The application will attempt to create room by removing the oldest 15% of the existing connections.
The properties can be modified by using the poolConfig.properties file. After the cmod-rest.war has been deployed to the Application Server, it can be found at the following locations:
WebSphere Liberty
<liberty install dir>/wlp/usr/servers/defaultServer/apps/expanded/cmod-rest.war/WEB-INF/classes
WebSphere Application Server
<websphere install dir>/AppServer/profiles/AppSrv01/installedApps/<cell>/cmod-rest_war.ear/cmod-rest.war/WEB-INF/classes
Once the modifications have been made, you need to restart the Application Server.
Be aware that making changes to the pool configuration can produce undesired results and should only be made if you have done the appropriate testing and fully understand the impact of the proposed changes. For example, simply increasing the number of connections might not be the correct solution. The proper solution might be to deploy REST Services to multiple Application Servers with a load balancer that evenly distributes requests.