8 Replies Latest reply on Nov 3, 2011 5:02 PM by pcraveiro

    Loading large amount of entries in cache

    pcraveiro

      Hi,

       

          I have a scenario where there is a database with something about 200000K entries to  put in the cache. This cache also have to be indexed to allow queries and for that I'm using the <indexing/> configuration.

       

          This cache (DIST_ASYNC) is also configured with FileCacheStore to maintain the cache state if something like a crash happens.

       

          To load the entries on the cache I'm using the Async API with batchs of 500 entries per put (I also tried to use a single node in the cluster node to gain more performance).

       

          It's working, but I want to know if there is a more fast way to do this since I want to test the queries against the indexed cache with 200000K entries and it's taking too long to get all this entries loaded.

       

          Any idea ?

       

      Thanks,

      Pedro Igor

        • 1. Re: Loading large amount of entries in cache
          nikolay1981

          Use a cache loader to restore cache state from a disk between tests.

          • 2. Re: Loading large amount of entries in cache
            pcraveiro

            Thanks for your reply Nikolay ....

             

            I'm already using a cache loader (FS) to store and restore the state. The problem I'm facing is because of the store and the index creation/update (i think)

             

            Just for information, from friday until now only 2.500.000 entries were loaded on the cache. I'm trying different JVM configurations to see if something gets better. I really would like to know if there is some ISPN case with the load described before. Must of the examples and test cases works only with 10K or 100K ...

             

            Thanks in advance.

            • 3. Re: Loading large amount of entries in cache
              sannegrinovero

              Hi Pedro,

              insertion/update performance when indexing is enabled is very sensitive to proper tuning. There are many advanced propierties you can experiment with to improve performance, and all are mentioned in the reference documentation of Hibernate Search.

               

              I'd suggest to start with exclusive_index_use, this should be set to true (it is by default in Infinispan 5.1 but I don't know which vesion you're running).

              Also make sure to dedicate some memory for the index writing queue, set something around 128MB ram_buffer_size as a good starting point for further tuning.

              • 4. Re: Loading large amount of entries in cache
                pcraveiro

                Sanne,

                 

                Thanks for your reply. I'm using ISPN 5.0.0.FINAL.

                I tried your suggestions but seems that ISPN is ignoring them, maybe something I'm doing wrong. Here is a snippet from my configuration file:

                 

                <indexing enabled="true" indexLocalOnly="false">

                    <properties>

                        <property name="hibernate.search.default.exclusive_index_use" value="true" />

                        <property name="hibernate.search.default.indexwriter.batch.ram_buffer_size" value="128MB" />

                        <property name="hibernate.search.default.indexBase" value="/var/index/${ispn.cluster.nodeName}/ISPNLuceneLocal" />

                        <property name="hibernate.search.default.directory_provider" value="filesystem" />

                    </properties>

                </indexing>

                 

                As you can see I also configured the hibernate.search.default.indexBase, but ISPN is creating the index in a different location ...

                 

                There are some other way to configure the Hibernate Search  ?

                 

                Thanks.

                • 5. Re: Loading large amount of entries in cache
                  sannegrinovero

                  Hi Pedro,

                  you're being affected by ISPN-1320 ; I'm sorry for that issue to be still unsolved, there is a patch coming which rewrites all che configuration parsing so I'm not supposed to change that code; should be fixed by next week.

                   

                  Could you run your experiments by configuring the default cache instead of using a named cache?

                  • 6. Re: Loading large amount of entries in cache
                    pcraveiro

                    Thanks again Sanne !

                     

                    I tried your sugestion and ISPN now recognize the properties defined in the configuration file.

                     

                    Now I'm trying to find the optimal configuration using the Hibernate Search properties.

                     

                    Cheers,

                    Pedro Igor

                    • 7. Re: Loading large amount of entries in cache
                      sannegrinovero

                      nice. please post back your findings (when you have) as they might be useful to others.

                      • 8. Re: Loading large amount of entries in cache
                        pcraveiro

                        Ok. I will post the results as soon as I finish.