[go: up one dir, main page]

Skip to content

Make zip data offset and read-link cache parameters configurable

Follow-up from gitlab#351578 (closed), I don't see a reason to work on this one, until gitlab#351578 (closed) is resolved.

We have 2 specific caches related to zip archives content:

	zipVFS.dataOffsetCache = lru.New(
		"data-offset",
		lru.WithMaxSize(defaultDataOffsetItems),
		lru.WithExpirationInterval(defaultDataOffsetExpirationInterval),
		lru.WithCachedEntriesMetric(metrics.ZipCachedEntries),
		lru.WithCachedRequestsMetric(metrics.ZipCacheRequests),
	)
	zipVFS.readlinkCache = lru.New(
		"readlink",
		lru.WithMaxSize(defaultReadlinkItems),
		lru.WithExpirationInterval(defaultReadlinkExpirationInterval),
		lru.WithCachedEntriesMetric(metrics.ZipCachedEntries),
		lru.WithCachedRequestsMetric(metrics.ZipCacheRequests),
	)

Both these caches are configured with default MaxSize and ExpirationInterval, and hit rates on these caches are quite low:

image

If gitlab#351578 (closed) doesn't fix the hit rates, we want to make these caches configurable:

  1. Finish !693 (diffs) ( I quickly created draft, but it probably needs some polishing)
  2. MR to omnibus to make these options configurable, similar to omnibus-gitlab!5832 (merged)
  3. MR to charts similar to gitlab-org/charts/gitlab!2338 (merged)
  4. MR to docs describing the options, similar to gitlab!77969 (diffs)
Edited by Vladimir Shushlin