Jan 2nd, 2013, 12:14 AM
SpringBeanTransactionManager#doCommit is slow
During performance tests with 200 concurrent requests, it is observed that doCommit() method takes longer time(21000ms) to commit simple Insert statements. Am I missing any configurations?
Also it is observed through profilers that actual queries in the transactions are not taking much time(<150 ms) but the method (doCommit) itself is consuming 95% of the total time.
This issue is not there with smaller numbers(till 100 concurrent requests).
some details about the app- hibernate 4.1,Spring 3.1, MySQL 5.2.
any help/pointers is appreciated.
Jan 2nd, 2013, 02:20 AM
Check your connection pool settings and your transactional settings (also you might need to check/configure somethings in MySQL). If you have a connection pool size which is to small it might take sometime before a connection is available to actually get access to the database. Make sure that your MySQL connection settings are in sync with your datasource.
Also if you have a database with a lot of indexes the database might be a problem (indexes are updated on each commit).
So the fact that doCommit looks slow it might be that the problems lies elsewhere.
Jan 3rd, 2013, 01:38 AM
yes as rightly said the problem might be some where and not really doCommit
Originally Posted by Marten Deinum
There is lucen index configured at every commit, I guess this will not be a problem as it is called post insertion.
we are also profiling for locks & waits @ MySQL to find more on this.
Jan 3rd, 2013, 09:07 AM
Between the thought process was doCommit() must be taking time as it has to wait for locks to release by other threads. Through SHOW INNODB STATUS tried to find locks and waits on MySQL, however there are none captured.Even slow queries(with 1 sec threshold) were not captured. So is there any other perspective which I am missing?
appreciate the help
Jan 3rd, 2013, 09:16 AM
As mentioned check your connection pool, check your MySQL settings... If there is no free connection nothing will happen (or at least you will experience long waits). Also the index creation/update could be a factor here.
What method is taking so long as there is no SpringBeanTransactionManager?!
Next you are also using Hibernate if you have caching enabled that might be an element or releasing the hibernate session depending on how many objects you have in memory. It might even be that there is a garbage collection happening which basically pauses your whole JVM.