OPENDAP/hyrax

Hyrax Data Directory Not Updating Without Restarting Tomcat

Closed this issue · 2 comments

Hi, is it normal that the live data in Hyrax's data directory does not update until Tomcat is restarted?

That's a very old issue. I was wondering the same thing. While I was looking for a solution, I noticed Hyrax updated its cached on its own.

In the latest version of Hyrax, the data is updated automatically. But it's not instantaneous. Hyrax may show its cached version for several minutes before updating. I'm not sure what is the frequency of the update. I think it's 30 minutes or 1 hour.

The cache to which you are referring is called a NodeCache and is essentially an "inventory cache" for the server's holdings. It is controlled by this element in the olfs.xml file:

<NodeCache maxEntries="20000" refreshInterval="600"/>

And by default is set to ten minutes (600 seconds). The inline documentation from the associated section of the olfs.xml file offers the following additional explanation:

<!--
Controls the state of the in-memory cache for BES catalog/node
responses. refreshInterval in seconds. The maxEntries attribute
defines the maximum number of entries in the cache. If the serviced
collection is large then making this larger will definitely improve
response times for catalogs etc. The refreshInterval attribute controls
how long any particular item remains in the cache. If the underlying
system has a lot of change (model result output etc) then making this
number smaller will increase the rate at which the change becomes
"available" through the Hyrax service, at the expense of more cache
churn and slower responses. If the underlying system is fairly stable
(undergoes little change) then refreshInterval can be larger which will
mean less cache churn and faster responses.
-->
<NodeCache maxEntries="20000" refreshInterval="600"/>

As you have noted, if you are in a rush you can force a cache refresh by restarting the Tomcat server, or you can just wait for the refreshInterval to pass.

I am going to mark this issue as closed because since it was opened we changed the implementation of the cache to a more robust LRU implementation.