8 Replies Latest reply on May 31, 2012 11:56 AM by dex chen

    cache loader with H2 DB: the DB file keeps growing

    dex chen Novice

      I have a cache using H2DB file based. the db file keeps growing unbounded. The size of db file is not related to size of cache data. It looks like the db file keeps growing whenerver the cache entries updates. Anyone sees this?

       

      I know this might be H2DB issue. Anyone has expreience to fix this?

        • 1. Re: cache loader with H2 DB: the DB file keeps growing
          Sanne Grinovero Master

          Hi dex,

          no I haven't heard of this before. To understand if it's a H2 problem, could you try your same configuration using a different database?

          • 2. Re: cache loader with H2 DB: the DB file keeps growing
            dex chen Novice

            I want to use filesystem base cache store. The available JDBC based options: H2 DB and JDBM. The JDBM has problems with the transaction manager (I posted earlier), and it is not recommended for production use.

            There are not many options.

             

            Are there any good recommended alternatives to H2 DB?

             

             

            I said the it could be H2 issue because that I googled around and see a few entries on H2 DB forum about database file size grows.

            • 3. Re: cache loader with H2 DB: the DB file keeps growing
              Galder Zamarreño Master

              You could use a proper DB such as postgresql, mysql...etc, instead of a filesystem cache store.

               

              If you wanna stick to filesystem, you could you Berkeley DB, for which we have a cache store impl, but you need to look at licensing.

              • 4. Re: cache loader with H2 DB: the DB file keeps growing
                dex chen Novice

                Galder:

                 

                I'll try some othe DBs. I have a question in my mind for long time about how Infinispan cacheloader handles DB instance creation.

                 

                If I use MySQL, do I need to create the DB instance outside Infinispan. Right now, with H2 DB, Infinispan will create the DB instance if not exists.

                 

                In addition, is it possible to add extra colums to the cache table? and how to do it through the configuration?

                 

                It will be really appreciated if you have some examples on this.

                 

                I'm a little desparate and suprised by the H2 DB file size growth at this pont of my project.

                 

                thanks.

                • 5. Re: cache loader with H2 DB: the DB file keeps growing
                  Sanne Grinovero Master

                  dex chen wrote:

                   

                  I'll try some othe DBs. I have a question in my mind for long time about how Infinispan cacheloader handles DB instance creation.

                   

                  If I use MySQL, do I need to create the DB instance outside Infinispan. Right now, with H2 DB, Infinispan will create the DB instance if not exists.

                   

                  You will have to create the instance, the user and permissions. The tables can be generated automatically, provided the user you configure Infinispan to use has permissions to create them.

                   

                   

                  In addition, is it possible to add extra colums to the cache table? and how to do it through the configuration?

                   

                  Not via the configuration of Infinispan; you can add more columns if you like, but Infinispan will ignore them and you'll have to create them by connecting otherwise to the database.

                   

                  BTW if all you need is filesystem, did you consider the FileCacheStore ?

                  • 6. Re: cache loader with H2 DB: the DB file keeps growing
                    dex chen Novice

                    I need a small footpirnt DB engine like H2 and Derby. The FileCaheStore is not recommend for production and it does not perform well as the DB in reading. I may try Berkely Derby. Thanks.

                    • 7. Re: cache loader with H2 DB: the DB file keeps growing
                      Sanne Grinovero Master

                      The FileCaheStore is not recommend for production

                      That was the case initially, but is considered pretty solid nowadays. We should have removed all such warnings, did you still find such a warning on recent documentation? Please point me to it so I can remove them.

                       

                      [...] and it does not perform well as the DB in reading. [...]

                      True, it's quite slow but we plan working on that soon, so if it's fast enough for your current needs I'd use it, and maybe collaborate with us on upcoming performance patches: you could provide suggestions or code, or just try out next betas and help us measure improvements.

                      • 8. Re: cache loader with H2 DB: the DB file keeps growing
                        dex chen Novice

                        Sanne: Good to know FileCacheStore is improved.  I'll let you know if I come across those warnings.

                         

                        Just give a quick update on the db file size growing issue.

                         

                        I tried Berkley DB. The size of DB files does not seem to have the same behaviour as H2 DB.