I am using Spring in my project and instantiating dataSource as below.
Below is my properties file.
Please suggest :-
a)Any changes in the properties marked in Bold(initialSize,maxActive,maxidle,minIdle). My application will be concurrently used by around 100 users and total users are around 3000.
b)I am using Tomcat Server to deploy my application.Should I be using JNDI for connections instead of directly specify connection properties? Is above way of using connections good for a production System?
I would increase maxIdle. Setting it to 30 means that you might be cycling through connections too quickly. Normally to set maxIdle, in an enterprise, you talk to your DBAs about how many idle connections they will be able to support from your application. In an enterprise setting where the database is expected to support multiple applications, the DBAs should have an idea of how much load they expect from each app, and how important each app is. This should give them a rough guideline around how many idle connections they should assign to each app
I would also increase maxActive. If you say 100 users concurrently, does it mean 100 concurrent users at the absolute peak? Have you measured this somehow or is this is a guesstimate? If it's a guesstimate, then add a buffer if you haven't already.
Of course, these are numbers that you are starting with. You should have a plan to monitor the usage so you can adjust these numbers as you go.
Most databases can handle 10s of 1000s of idle connections. Normally, I wouldn't worry about such a low number. However, talk to the person who knows most about your database.