-
1. Re: node.remove() performance problem over cifs binary storage
hchiorean Sep 24, 2015 5:24 AM (in response to ludopaquet)1 of 1 people found this helpfulAs per the JCR spec, when you remove a node all its children have to be removed as well. This means that if you call node.remove on a node which has lots of children, all those children will be loaded into memory as well (recursively) which could take time. The reason they are loaded into memory is that JCR requires all sorts of validations (e.g. updating strong references). Moreover, if the binary data is not shared with other nodes (i.e. the files are unique in the repository), they will removed from the binary store as well, which means removing them via the network (CIFS).
Technically, removing from the binary store means moving them into the "trash" area of the store, so essentially this is a "move" operation from the FS perspective.
If loading all the children recursively in memory and then moving them to trash via CIFS is not the issue, you should profile and investigate where the problem is coming from.
-
2. Re: node.remove() performance problem over cifs binary storage
ludopaquet Sep 24, 2015 11:51 AM (in response to hchiorean)Many Thanks Horia, VisualVM says that the culprit is findFile from getTrashFile
-
3. Re: node.remove() performance problem over cifs binary storage
ludopaquet Sep 24, 2015 12:13 PM (in response to ludopaquet)Maybe can I mount trash folder locally ? I see that this folder has ridicule size even after a remove node
-
4. Re: node.remove() performance problem over cifs binary storage
hchiorean Sep 25, 2015 1:23 AM (in response to ludopaquet)That method is really simple: https://github.com/ModeShape/modeshape/blob/master/modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/FileSystemBinaryStore.java#L288
At most, it will create 3 directories representing the structure which will hold the SHA1 of a binary file, all using the standard java.io.File API. So I guess the performance problem comes from java.io.File having to do this over the network.
I suspect that googling the performance of java.io over CIFS will lead to more people reporting the same performance issues.
-
5. Re: node.remove() performance problem over cifs binary storage
ludopaquet Sep 25, 2015 8:53 AM (in response to hchiorean)Mounting trash folder locally seems to do the trick. It's not large enough to require large amount of disk. I guess the problem is to create many small files.
Maybe it could be an option for a future release of filebinaryStore to map the trash folder in another path ?
Many thanks for helping me.
-
6. Re: node.remove() performance problem over cifs binary storage
hchiorean Sep 25, 2015 8:59 AM (in response to ludopaquet)Feel free to log an enhancement request.