0

I have deployed a web-application in glassfish application server. I have created a connection pool in glassfish and use DataSource for getting a connection from it.

In my connection pool I have settings:
initial pool size: 25
max pool size: 500
pool resize quantity: 2

Currently clients are using my application and in the glassfish Resource Monitor I see the following details:

NumConnUsed:118
NumConnDestroyed: 3664
NumConnReleased: 391
NumConnFree: 1
NumConnCreated: 3784
NumConnAcquired: 509

If anyone could please explain me the above statistics with mathematics.

And my question is - when we close a connection using .close() in java, the connection is sent back to the pool. So what is difference between NumConnReleased and NumConnDestroyed ?

Thanks

mukund
  • 2,866
  • 5
  • 31
  • 41

1 Answers1

2

From glassfish documentation

numconndestroyed --> Number of physical connections that were destroyed since the last reset. numconnreleased --> Number of logical connections released to the pool.

Physical Connection --> the actual database connection.

Logical Connection --> the pooled connection maintained by the Connection Pool manager

Last reset --> when the connection pool was flushed/reset, this normally would happen when you redeploy your app.

So you can see the difference is, one represents physical connections while the other represets logical connections. The other difference is, one show the count since last reset while the other shows the overall count.

gresdiplitude
  • 1,665
  • 1
  • 15
  • 27
  • NumConnUsed + NumConnDestroyed = NumConnCreated (The whole is in Physical Connection) & NumConnUsed(logical) + NumConnReleased(Physical) = NumConnAcquired(Physical),but what is core difference between them...apart from logical & physical aspect. – big zero Aug 23 '12 at 07:20
  • Thanks gresdipllitude, but then why so many physical connections are made without taking connections from pool ? – mukund Aug 23 '12 at 07:41
  • @Mukund Your app is getting redeployed several times, numconndestroyed is only tracking connection count since last deploy, numconnreleased on the other hand is tracking connections since the first time your app was deployed. Essentially, the first time when you deploy your app to the container, numconndestroyed should always be equal to numconnreleased. – gresdiplitude Aug 23 '12 at 07:46
  • hmmm.. I guess you just told the reverse because if NumConnDestroyed -->last deploy and NumConnReleased -->first deploy, then how could in my application NumConnDestroyed > NumConnReleased ? Isn't it ? – mukund Aug 23 '12 at 08:21