Question

I looked around and apparently Infinispan has a limit on the amount of keys you can store when persisting data to the FileStore. I get the "too many open files" exception.

I love the idea of torquebox and was anxious to slim down the stack and just use Infinispan instead of Redis. I have an app that needs to cache allot of data. The queries are computationally expensive and need to be re-computed daily (phone and other productivity metrics by agent in a call center).

I don't run a cluster though I understand the cache would persist if I had at least one app running. I would rather like to persist the cache. Has anybody run into this issue and have a work around?

Was it helpful?

Solution

Yes, Infinispan's FileCacheStore used to have an issue with opening too many files. The new SingleFileStore in 5.3.x solves that problem, but it looks like Torquebox still uses Infinispan 5.1.x (https://github.com/torquebox/torquebox/blob/master/pom.xml#L277).

OTHER TIPS

I am also using infinispan cache in a live application.

Basically we are storing database queries and its result in cache for tables which are not up-datable and smaller in data size.

There are two approaches to design it:

  • Use queries as key and its data as value

    It leads to too many entries in cache when so many different queries are placed into it.

  • Use xyz as key and Map as value (Map contains the queries as key and its data as value)

    It leads to single entry in cache whenever data is needed from this cache (I call it query cache) retrieve Map first by using key xyz then find the query in Map itself.

We are using second approach.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top