Performance issue with file system connector
neil.zou May 23, 2012 5:28 AMHi all,
I'm using modeshape 2.8.1.Final, and I'm trying to upload 5000 xml files to a empty file system repository. The processing time for each file increases from 0.4 seconds to 4.5 seconds.
Below is my configuration:
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns:mode="http://www.modeshape.org/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
<mode:sources jcr:primaryType="nt:unstructured">
<mode:source jcr:name="pocFS" mode:classname="org.modeshape.connector.filesystem.FileSystemSource"
mode:workspaceRootPath="/dev/poc/workspaces"
mode:defaultWorkspaceName="poc"
mode:creatingWorkspacesAllowed="false"
mode:updatesAllowed="true">
<mode:cachePolicy jcr:name="nodeCachePolicy"
mode:classname="org.modeshape.graph.connector.base.cache.InMemoryNodeCache$PathCachePolicy"
mode:timeToLive="300" />
</mode:source>
</mode:sources>
<mode:mimeTypeDetectors>
<mode:mimeTypeDetector jcr:name="Detector">
<mode:description>Standard extension-based MIME type detector</mode:description>
<mode:classname>org.modeshape.graph.mimetype.ExtensionBasedMimeTypeDetector</mode:classname>
</mode:mimeTypeDetector>
</mode:mimeTypeDetectors>
<mode:repositories>
<mode:repository jcr:name="pocFileRepo">
<mode:source>pocFS</mode:source>
<mode:options jcr:primaryType="mode:options">
<jaasLoginConfigName jcr:primaryType="mode:option" mode:value="modeshape-jcr"/>
<queryIndexDirectory jcr:primaryType="mode:option" mode:value="/dev/poc/workspaceindex" />
</mode:options>
<mode:nodeTypes jcr:primaryType="mode:nodeTypes"/>
<namespaces jcr:primaryType="mode:namespaces" />
</mode:repository>
</mode:repositories>
</configuration>
Files in workspace | time taken for each file |
0 | 0.4 |
1000 | 1.1 |
2000 | 1.9 |
4100 | 3.6 |
4800 | 4.4 |
I found the bottleneck is in below two methods, each taken around 2 seconds.
PathTransaction.getChildren(..)
RequestProcessor.process( ReadBranchRequest request)
Could anyone give me a hint to improve performance in this case?
Thanks