Skip to content

Commit

Permalink
Merge pull request #3593 from garlick/content_cache_size
Browse files Browse the repository at this point in the history
use LRU to purge content-cache
  • Loading branch information
mergify[bot] committed Apr 14, 2021
2 parents 0fa713c + b829818 commit e2034e2
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 191 deletions.
12 changes: 1 addition & 11 deletions doc/man1/flux-content.rst
Expand Up @@ -79,11 +79,6 @@ CACHE EXPIRATION
The parameters affecting local cache expiration may be tuned with
flux-setattr(1):

**content.purge-target-entries**
The cache is purged to bring the number of cache entries less than
or equal to this value
(default 1048576).

**content.purge-target-size**
The cache is purged to bring the sum of the size of cached blobs less
than or equal to this value
Expand All @@ -93,12 +88,7 @@ flux-setattr(1):
Only entries that have not been accessed in **old-entry** seconds
are eligible for purge (default 10).

**content.purge-large-entry**
Only entries with blob size greater than or equal to **large-entry** are
purged to reach the size target (default 256).

Expiration becomes active on every heartbeat, when the cache exceeds one
or both of the targets configured above. Dirty or invalid entries are
Expiration becomes active on every heartbeat. Dirty or invalid entries are
not eligible for purge.


Expand Down
8 changes: 0 additions & 8 deletions doc/man7/flux-broker-attributes.rst
Expand Up @@ -149,18 +149,10 @@ content.flush-batch-limit
content.hash
The selected hash algorithm, default sha1.

content.purge-large-entry
When the cache size footprint needs to be reduced, first consider
purging entries of this size or greater.

content.purge-old-entry
When the cache size footprint needs to be reduced, only consider
purging entries that are older than this number of seconds.

content.purge-target-entries
If possible, the cache size purged periodically so that the total
number of entries stays at or below this value.

content.purge-target-size
If possible, the cache size purged periodically so that the total
size of the cache stays at or below this value.
Expand Down
6 changes: 1 addition & 5 deletions src/broker/broker.c
Expand Up @@ -404,14 +404,10 @@ int main (int argc, char *argv[])

/* Create content cache.
*/
if (!(ctx.cache = content_cache_create (ctx.h))) {
if (!(ctx.cache = content_cache_create (ctx.h, ctx.attrs))) {
log_err ("content_cache_create");
goto cleanup;
}
if (content_cache_register_attrs (ctx.cache, ctx.attrs) < 0) {
log_err ("content cache attributes");
goto cleanup;
}

if (ctx.verbose) {
const char *parent = overlay_get_parent_uri (ctx.overlay);
Expand Down

0 comments on commit e2034e2

Please sign in to comment.