myBatis vs iBatis Performance - Why myBatis is slower?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

myBatis vs iBatis Performance - Why myBatis is slower?

mgumma
We have ported all our code from iBatis to myBatis. Also, upgraded all
myBatis dependency libraries.
Upgraded:
* commons-dbcp2-2.7.0.jar
* commons-pool2-2.8.0.jar
*postgresql-42.2.10.jar
upgrade from ibatis-2.3.4.726 to:
*mybatis-3.5.4.jar and  mybatis-spring-1.3.3.jar
Note: Using Spring 3.2.x

We are seeing the following performance degradation during our load testing.
Application server - Linux/Apache tomcat web server,
Database server - Linux/PostgreSQL

*With iBatis load testing: Application server CPU utilization at 45% and DB
Server CPU utilization at 85%.  
Throughput - 2440 request per minute

*With myBatis load testing: Application server CPU utilization at 70% and DB
Server CPU utilization  at 45%.  
Throughput - 1697 request per minute,  almost 30% performance reduction
compare to iBatis.  

The DB Server CPU utilization goes lower and throughput also goes lower, but
app server CPU utilization goes slightly higher during my load testing.  
1. Any ideas?Why the behavior is totally changed? I am unable to find the
reason.  
2. Adding another application server into the mix will help to get better
throughput? I mean close to iBatis. I am planning to verify this within week
or two.

Thanks,
-Malli



--
Sent from: http://mybatis-user.963551.n3.nabble.com/

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/1590540203422-0.post%40n3.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: myBatis vs iBatis Performance - Why myBatis is slower?

Iwao AVE!
Hello Malli,

We may need the details about the statement that becomes slower compared to iBATIS.
Could you post the configuration, Java code and mapper files?

Regards,
Iwao

On Wed, May 27, 2020 at 9:43 AM mgumma <[hidden email]> wrote:
We have ported all our code from iBatis to myBatis. Also, upgraded all
myBatis dependency libraries.
Upgraded:
* commons-dbcp2-2.7.0.jar
* commons-pool2-2.8.0.jar
*postgresql-42.2.10.jar
upgrade from ibatis-2.3.4.726 to:
*mybatis-3.5.4.jar and  mybatis-spring-1.3.3.jar
Note: Using Spring 3.2.x

We are seeing the following performance degradation during our load testing.
Application server - Linux/Apache tomcat web server,
Database server - Linux/PostgreSQL

*With iBatis load testing: Application server CPU utilization at 45% and DB
Server CPU utilization at 85%. 
Throughput - 2440 request per minute

*With myBatis load testing: Application server CPU utilization at 70% and DB
Server CPU utilization  at 45%. 
Throughput - 1697 request per minute,  almost 30% performance reduction
compare to iBatis. 

The DB Server CPU utilization goes lower and throughput also goes lower, but
app server CPU utilization goes slightly higher during my load testing. 
1. Any ideas?Why the behavior is totally changed? I am unable to find the
reason. 
2. Adding another application server into the mix will help to get better
throughput? I mean close to iBatis. I am planning to verify this within week
or two.

Thanks,
-Malli



--
Sent from: http://mybatis-user.963551.n3.nabble.com/

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/1590540203422-0.post%40n3.nabble.com.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/CA%2Buep2QjDvYb9CObkOxRfbqL6Zzm1y__5ivKZkJqg3JgZZU5_w%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: myBatis vs iBatis Performance - Why myBatis is slower?

mgumma
Iwao,

Thanks for the reploy. I think we found the root cause. It seems the dbcp2
upgrades is causing the performance degradation and not the myBatis.
* commons-dbcp2-2.7.0.jar

Here is the background, the  BasicDataSource has a property testOnBorrow
that validates a connection when connection borrowed from the pool.  The
default is true for the property for dbcp and dbcp2.  However, the
validation uses a validation query (validateionQuery property) like "select
1" or whatever you set.   The difference is that with dbcp, the validation
query is null by default so the validation is not performed with iBatis.
But, with dbcp2 upgrade, the connection is validated and empty transaction
is committed  to the DB and causes performance degradation.




--
Sent from: http://mybatis-user.963551.n3.nabble.com/

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/1593457459295-0.post%40n3.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: myBatis vs iBatis Performance - Why myBatis is slower?

Iwao AVE!
Hello,

Thank you very much for sharing your findings!
I'll remember that DBCP2's testOnBorrow could affect performance.

Regards,
Iwao

On Tue, Jun 30, 2020 at 4:04 AM mgumma <[hidden email]> wrote:
Iwao,

Thanks for the reploy. I think we found the root cause. It seems the dbcp2
upgrades is causing the performance degradation and not the myBatis.
* commons-dbcp2-2.7.0.jar

Here is the background, the  BasicDataSource has a property testOnBorrow
that validates a connection when connection borrowed from the pool.  The
default is true for the property for dbcp and dbcp2.  However, the
validation uses a validation query (validateionQuery property) like "select
1" or whatever you set.   The difference is that with dbcp, the validation
query is null by default so the validation is not performed with iBatis.
But, with dbcp2 upgrade, the connection is validated and empty transaction
is committed  to the DB and causes performance degradation.




--
Sent from: http://mybatis-user.963551.n3.nabble.com/

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/1593457459295-0.post%40n3.nabble.com.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/CA%2Buep2Sxo0jVOYgmqaGr26aU4L67_j6ApTe_obnEKhE6T_JeKA%40mail.gmail.com.