Pre configuring Liberty server according to the number of threads your application is about to execute could help your application for a successful clean run without getting involved in thread related Issue. Few inputs which should be kept as best practice before running your Web-application are.
1) maxThreads and coreThreads:-
As compared to TWAS , where coreThreads should be less than maxThreads, in Liberty user is free to configure any value of above parameters. The minimum value out of these two values will be used when server is getting started. The default value of above parameter is 60, which should be increased to higher value if the number of threads a web application is executing is more than this value. Below tag is used for configuring coreThreads and maxThreads in server.xml and can be placed anywhere within parent tag which is <server> </server>
<executor name="LargeThreadPool" id="default" coreThreads="60" maxThreads="70"
keepAlive="60s" stealPolicy="STRICT" rejectedWorkPolicy="CALLER_RUNS" />
We have the following in our server.xml,
which indicates that jndi_JMS_BASE_QCF is the connection factory which is using the connection manager ConMgr1. We need to appropriately configure the
connectionManager attributes for our usage, one of which is maxPoolSize.
<connectionManager id="ConMgr1" maxPoolSize=”60” />
3) The thread value configured in above point 1 and 2 should be equal/greater than the number of threads your web application is running.
Note :- As a best practice always keep your Threads configuration in server.xml to be greater than the number of threads your application wants to execute.