jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-3137) Slow repository startup
Date Fri, 04 Nov 2011 09:27:00 GMT

    [ https://issues.apache.org/jira/browse/JCR-3137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13143862#comment-13143862
] 

Thomas Mueller commented on JCR-3137:
-------------------------------------

I made a simple test and got 4.3 seconds (cold, meaning classes are not loaded yet) to create
a repository. I ran a few tests and I found H2 is about 3 times faster for my test case. I
ran each test 3 times and took the best numbers (all numbers are milliseconds; lower is faster).

Test case and results also available at http://h2database.com/p.html#cd90256a98e4ec14d9ca9d3f1c601a65

org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager
(default derby.system.durability)
4365 ms: test #0 delete
642 ms: test #1 reuse
1740 ms: test #2 delete
272 ms: test #3 reuse
1462 ms: test #4 delete
411 ms: test #5 reuse
1650 ms: test #6 delete
268 ms: test #7 reuse
1329 ms: test #8 delete
313 ms: test #9 reuse
12684 total

org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager
System.setProperty("derby.system.durability", "test");
3872 ms: test #0 delete
627 ms: test #1 reuse
1179 ms: test #2 delete
315 ms: test #3 reuse
834 ms: test #4 delete
402 ms: test #5 reuse
950 ms: test #6 delete
249 ms: test #7 reuse
791 ms: test #8 delete
274 ms: test #9 reuse
9730 total

org.apache.jackrabbit.core.persistence.pool.H2PersistenceManager
jdbc:h2:${rep.home}/version/db;create=true
2096 ms: test #0 delete
415 ms: test #1 reuse
417 ms: test #2 delete
341 ms: test #3 reuse
407 ms: test #4 delete
339 ms: test #5 reuse
462 ms: test #6 delete
368 ms: test #7 reuse
403 ms: test #8 delete
338 ms: test #9 reuse
5634 total

org.apache.jackrabbit.core.persistence.pool.H2PersistenceManager
jdbc:h2:${rep.home}/version/db;create=true;log=0;file_lock=fs
(log=0 means disable the transaction log - similar to derby.system.durability;
file_lock=fs means use a file lock instead of a .lock.db file)
1908 ms: test #0 delete
249 ms: test #1 reuse
214 ms: test #2 delete
171 ms: test #3 reuse
172 ms: test #4 delete
165 ms: test #5 reuse
224 ms: test #6 delete
147 ms: test #7 reuse
220 ms: test #8 delete
121 ms: test #9 reuse
3637 total

Test case:

import java.io.File;
import javax.jcr.Node;
import javax.jcr.Repository;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import org.apache.commons.io.FileUtils;
import org.apache.jackrabbit.core.TransientRepository;

public class Test {

    public static void main(String... args) throws Exception {
        System.setProperty("derby.system.durability", "test");
        long start = System.currentTimeMillis();
        for (int i = 0; i < 10; i++) {
            boolean delete = i % 2 == 0;
            if (delete) {
                FileUtils.deleteDirectory(new File("repository"));
            }
            long time = System.currentTimeMillis();
            Repository repository = new TransientRepository();
            Session session = repository.login(
                    new SimpleCredentials(
                            "admin", "admin".toCharArray()));
            try {
                if (session.getRootNode().hasNode("test")) {
                    session.getRootNode().getNode("test").remove();
                }
                Node test = session.getRootNode().addNode("test");
                session.save();
                test.addNode("x");
                session.save();
            } finally {
                session.logout();
            }
            System.out.println((System.currentTimeMillis() - time) +
                    " ms: test #" + i + " " + (delete ? "delete" : "reuse"));
        }
        System.out.println((System.currentTimeMillis() - start) + " total");
    }

}



                
> Slow repository startup
> -----------------------
>
>                 Key: JCR-3137
>                 URL: https://issues.apache.org/jira/browse/JCR-3137
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.3.2
>            Reporter: Jukka Zitting
>
> On my reasonably fast computer I'm seeing over 30 seconds to start up a new repository
from scratch. The startup is much faster if the repository already exists, so this has something
to do with the initial setup. Ideally a new empty repository should come up in no more than
a few seconds.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message