Hello,

I'm porting SQL/JDBC web application to JPA and i made some performance
tests with PostgreSQL 8.3.3 and MySql 5.0.51a Community edition, with
both - SQL/JDBC and OpenJPA implementations of the application.

                Apache ab       Apache Jmeter
PostgreSQL 8.3   -15%                   -12%
MySql 5.0.51a    -64%                   -27%

On both tests on PostgreSQL the performance loss is about 15% compared
to pure SQL/JDBC implementation.

On MySql the performance loss is very big especially on test with Apache
ab utility.

In the tests, OpenJPA 1.2.0 is configured with data cache enabled, query
data cache disabled and query compilation cache - enabled. OpenJPA
operates in extended context with Apache DBCP and statement pooling.

Is this performance loss on MySql normal ? Does OpenJPA require some
special configuration for MySql ?

It is my persistence.xml file.

<property name="openjpa.ConnectionProperties"
                         value="DriverClassName=com.mysql.jdbc.Driver,
                         Url=jdbc:mysql://localhost/mydb,
                         Username=root,
                         Password=123,
                         maxActive=25,
                         maxWait=25,
                         minIdle=3,
                         maxIdle=25,
                         whenExhaustedAction=block,
                         testOnBorrow=false,
                         testWhileIdle=true,
                         timeBetweenEvictionRunsMillis=3600000,
                         numTestsPerEvictionRun=3,
                         minEvictableIdleTime=1800000,
                         testQuery=select 1,
                         poolPreparedStatements=true"/>
                  <property name="openjpa.ConnectionDriverName"
                         value="org.apache.commons.dbcp.BasicDataSource"/>

<property name="openjpa.QueryCompilationCache" value="true"/>
<property name="openjpa.QueryCache" value="false"/>
<property name="openjpa.RemoteCommitProvider" value="sjvm"/>
<property name="openjpa.DataCache" value="true(CacheSize=2000,
SoftReferenceSize=0)"/>
<property name="openjpa.FetchBatchSize" value="100"/>
<property name="openjpa.ConnectionRetainMode" value="on-demand"/>
<property name="openjpa.FlushBeforeQueries" value="true"/>
<property name="openjpa.jdbc.DBDictionary"
value="org.apache.openjpa.jdbc.sql.MySQLDictionary(SupportsSubselect=true)"/>

Best regards
Georgi

Reply via email to