Opened 15 years ago

Closed 15 years ago

#1261 closed task (fixed)

Global cache for static data

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 2.11
Component: core Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

Implement a global, file-based, cache that can be used to store pre-processed static data. This can, for example, be used in cases were loading data from the database takes a long time but the result is guaranteed to never change. This result could then be stored as a file in the static cache which should be a lot quicker to access than to re-query the database for the same data the next time we need it. I have two concrete examples:

  • Overview and correction factor plots. The never change. We should be able to save a lot by storing the images in the static cache. See #1262.
  • List of position numbers used by experiment explorer. See #903. This is one of the major remaning performance hogs in experiment explorer. The list is currently cached in the user session. With a file-based cache we can cache it longer.

I think we should keep the cache as simple as possible. It should be managed automatically. The contents of the cache should not be visible to users and consumed disk space should not be counted against user's quota. We need a way to remove items from the cache. For example, if an experiment is deleted from BASE, there is no point in keeping the cached data related to that experiment. However, I don't think we should try to hook this into the transactional callback events inside BASE. It will be too complicated. Instead I think a simple time-based approach is better. For example, once a day we run a check that deletes everything that hasn't been used for the last two weeks. The timeout should be configurable. Maybe we should also have a configuration option that completely disabled the static cache.

Change History (5)

comment:1 by Nicklas Nordborg, 15 years ago

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:2 by Nicklas Nordborg, 15 years ago

(In [4824]) References #1261: Global cache for static data

A prototype implementation of the cache. It should work ok, as long as multiple users doesn't write to the same cache entry at the same time. There is no configuration options or code fore cleaning the cache.

comment:3 by Nicklas Nordborg, 15 years ago

(In [4827]) References #1261: Global cache for static data

The cache is now thread-safe. Configuration options in base.config are supported. Old files are cleaned up. Unless something shows up this should now be fully functional.

comment:4 by Nicklas Nordborg, 15 years ago

Description: modified (diff)

comment:5 by Nicklas Nordborg, 15 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.