users@glassfish.java.net

DataSource faster than ConnectionPoolDataSource?

From: <glassfish_at_javadesktop.org>
Date: Mon, 03 May 2010 03:54:42 PDT

Hi,
I have observed interesting behaviour on glassfish 3.0.1 and postgresql 8.4 jdbc 4 driver (jdk 1.6). I've build simple benchmark using jmeter (2 threads because my machine has 2 cores) which invokes one HTTPRequest to new functionality of servlet login (custom authentication using post arguments). My machine is core2duo 8400 3Ghz, 6GB ram, Win7 home 64 bit.

Using two configurations:
1. pool is using javax.sql.DataSource implementation which is org.postgresql.ds.PGSimpleDataSource, rest of parameters left default. After warmup (about 50.000 request) there is 242 req/sec and seems that is maximum value.

2. pool is using javax.sql.ConnectionPoolDataSource implementation which is org.postgresql.ds.PGConnectionPoolDataSource, rest of parameters default:
after warmup (about 50.000 invocations) there is 190 req/sec.

This is very interesting situation, since I have found on the network suggestions that using ConnectionPoolDataSource has better results which is not true in my case. I can imagine that using javax.sql.ConnectionPoolDataSource is more appropiate in non server applications where there is no built in pooling implementations. And using javax.sql.DataSource can give better results if the server vendor gives his own pooling implementations. Can someone from the glassfish team confirm that conclusion?
[Message sent by forum member 'jszczepankiewicz']

http://forums.java.net/jive/thread.jspa?messageID=400151