Liquibase Community Forum
2010-12-02 15:07:08 UTC
A new topic, 'Liquibase performance', has been made on a board you are watching.
You can see it at
http://liquibase.org/forum/index.php?topic=811.new#new
The text of the topic is shown below:
Hi,
I'm using liquibase (build from trunk 2 months ago) to do data backup in a web application (jboss-web server with spring and richfaces).
When the backup is proceeded I call LockService.getInstance(database).waitForLock();
and after the backup is finished I call Code:
} finally {
try {
LockService.getInstance(database).releaseLock();
} catch (LockException e) {
}
if (liquibase != null) {
liquibase.forceReleaseLocks();
}
On every request I check if there is backup operation currently running with
Code:
LockService lockService = LockService.getInstance(createDatabase(connection));
DatabaseChangeLogLock[] listLocks = lockService.listLocks();
if (null != listLocks && listLocks.length > 0) {
return true;
}
if the result is true no database commits will be executed and the user will be redirected to another page.
I have some performance issues and I tracked down (yourkit) that this check takes 51% from the CPU time of the request. After detailed investigation I see that createDatabase() takes 16% and listLocks() takes 36% from the total request CPU time. After going down in the call list
createDatabase() -> ... -> liquibase.servicelocator.ResolverUtil.listClassResources(JarInputStream, String) -> java.util.jar.JarInputStream.getNextJarEntry() takes 16%
and listLocks() -> com.mysql.jdbc.Statement.executeQuery(String) takes 19%
listLocks() -> java.util.jar.JarInputStream.getNextJarEntry() takes another 17%
So from these 51% - 19% (967 ms) are used to open the connection and check if there are locks and 16% + 17% ~ 32% are used for liquibase.servicelocator.ResolverUtil.listClassResources(JarInputStream, String) -> java.util.jar.JarInputStream.getNextJarEntry()
Is there any chance to minimize these 32%?
Unsubscribe to new topics from this board by clicking here: http://liquibase.org/forum/index.php?action=notifyboard;board=1.0
Regards,
The Liquibase Community Forum Team.
You can see it at
http://liquibase.org/forum/index.php?topic=811.new#new
The text of the topic is shown below:
Hi,
I'm using liquibase (build from trunk 2 months ago) to do data backup in a web application (jboss-web server with spring and richfaces).
When the backup is proceeded I call LockService.getInstance(database).waitForLock();
and after the backup is finished I call Code:
} finally {
try {
LockService.getInstance(database).releaseLock();
} catch (LockException e) {
}
if (liquibase != null) {
liquibase.forceReleaseLocks();
}
On every request I check if there is backup operation currently running with
Code:
LockService lockService = LockService.getInstance(createDatabase(connection));
DatabaseChangeLogLock[] listLocks = lockService.listLocks();
if (null != listLocks && listLocks.length > 0) {
return true;
}
if the result is true no database commits will be executed and the user will be redirected to another page.
I have some performance issues and I tracked down (yourkit) that this check takes 51% from the CPU time of the request. After detailed investigation I see that createDatabase() takes 16% and listLocks() takes 36% from the total request CPU time. After going down in the call list
createDatabase() -> ... -> liquibase.servicelocator.ResolverUtil.listClassResources(JarInputStream, String) -> java.util.jar.JarInputStream.getNextJarEntry() takes 16%
and listLocks() -> com.mysql.jdbc.Statement.executeQuery(String) takes 19%
listLocks() -> java.util.jar.JarInputStream.getNextJarEntry() takes another 17%
So from these 51% - 19% (967 ms) are used to open the connection and check if there are locks and 16% + 17% ~ 32% are used for liquibase.servicelocator.ResolverUtil.listClassResources(JarInputStream, String) -> java.util.jar.JarInputStream.getNextJarEntry()
Is there any chance to minimize these 32%?
Unsubscribe to new topics from this board by clicking here: http://liquibase.org/forum/index.php?action=notifyboard;board=1.0
Regards,
The Liquibase Community Forum Team.