5 Replies Latest reply on Jan 22, 2016 2:28 AM by hchiorean

    Modeshape : CPU spikes every 30 seconds for 10 seconds without any software interaction

    spidex

      Hello

       

      I am currently maintaining a software product that uses Modeshape 3.8 and Infinispan (5.2.7) for file storage and retrieval. I don't have much knowledge of Modeshape but have been reading the documentation to understand how it works.

       

      We currently have an issue where we have 2 instances of our product which both use separate Modeshape repositories where the CPU on the machine that hosts them is spiking to 100% usage every 30 seconds for 10 seconds or so. The size of the library is around 400MB.


      I have looked at one of these instances on my machine in a development environment and been able to reproduce a similar problem where the CPU spikes to about 20% usage ever 30 seconds for 10 seconds or so.

       

      I have turned on full debug in log4j.xml for Modeshape but there doesn't seem to be any hint as to what is causing this or what it's doing. This process seems to be happening asynchronously without any user interaction to the product.

       

      I have done some Java Profiling using VisualVM (see attachments) and found the process causing the CPU spike is called "datasabreReporisotry-FileCacheStore-0", On further inspection I think code being run is ogr.infinispan.loaders.file.FileCacheStore.loadBucket.

       

      My question is what is happening during this process and is there any way we can prevent it?


      I thought I may have been able to stop the asynchronous processing by removing the call to async() from the settings or disabling it but this doesn't seem to work. Does this relate more to when files are saved or retrieved?

       

      ModeShape in Java applications - ModeShape 3 - Project Documentation Editor

       

      <!--

                     We could use "write-behind", which actually writes to the file system asynchronously,

                     which can improve performance as seen by the JCR client.

                     Plus changes are coalesced, meaning that if multiple changes are enqueued for the

                     same node, only the last one is written. (This is good much of the time, but not

                     always.)

                   <async enabled="true" flushLockTimeout="15000" threadPoolSize="5"/>

                   -->

       

      Our current settings for Infinispan are detailed below.

       

      // Create the Infinispan configuration via a Local Environment ...

                      ConfigurationBuilder builder = new ConfigurationBuilder();

                      Configuration cacheConfig = builder.transaction()

                              .transactionManagerLookup(getInfinispanTransactionmanager)

                              .transactionMode(TransactionMode.TRANSACTIONAL)

                              .autoCommit(true)

                              .lockingMode(LockingMode.PESSIMISTIC)

                              .loaders()

                              .passivation(false)

                              .shared(false)

                              .preload(false)

                              .addFileCacheStore()

                              .async()

                              .threadPoolSize(10)

                              .enabled(true)

                              .fetchPersistentState(false)

                              .purgeOnStartup(false)

                              .addProperty("location", bundle.getString("datasabre.repo") + "/Library/content")

                              .build();

       

      If you need anymore information please let me know

       

      Regards

       

      John