aboutsummaryrefslogtreecommitdiff
path: root/plugin/pkg/cache (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-04-05plugin/dnssec: use entire RRset as key input (#4537)Gravatar Miek Gieben 2-1/+49
* plugin/dnssec: use entire RRset as key input This uses the entire rrset as input for the hash key; this is to detect differences in the RRset and generate the correct signature. As this would then lead to unbounded growth, we periodically (every 8h) prune the cache of old entries. In theory we could rely on the random eviction, but it seems nicer to do this in a maintannce loop so that we remove the unused ones. This required adding a Walk function to the plugin/pkg/cache. Signed-off-by: Miek Gieben <miek@miek.nl> * Update plugin/dnssec/cache.go Co-authored-by: Chris O'Haver <cohaver@infoblox.com> Co-authored-by: Chris O'Haver <cohaver@infoblox.com>
2021-03-21Add cache eviction metrics to the cache plugin (#4411)Gravatar Frank Riley 1-3/+8
Signed-off-by: Frank Riley <fhriley@gmail.com>
2019-07-19pkg/cache: fix race in Add() and Evict() (#3013)Gravatar Charlie Vieth 3-23/+116
* pkg/cache: fix race in Add() and Evict() This fixes a race in Add() when the shard is at max capacity and the key being added is already stored. Previously, the shard would evict a random value - when all it needed to do was replace an existing value. There was a race in how Evict() picked which key to remove, which would cause concurrent calls to Evict() to remove the same key. Additionally, this commit removes a lot of the lock contention and a race around Add() and Evict() by changing them to immediately hold the write lock. Previously, they would check conditions with the read lock held and not re-check those conditions once the write lock was acquired (this is a race). * pkg/cache: code review comments * pkg/cache: simplify Add() logic
2018-08-31Move cache Keys to 64bit for a better dispersion and lower collision ↵Gravatar Francois Tur 1-15/+17
frequency (#2077) * - change Key for cache to 64bits. * - change Key for cache to 64bits.
2018-08-29lower cache min limit (#2065)Gravatar Chris O'Haver 1-2/+2
2017-10-23plugin/pkg/cache: smarter locking (#1164)Gravatar Miek Gieben 2-4/+17
Make the locking slightly smarter in Evict and add benchmark function. Seems a bit faster (there was some variance while performing these benchmarks) Master: BenchmarkCache-2 1000000 2317 ns/op 0 B/op 0 allocs/op BenchmarkCache-2 1000000 2032 ns/op 0 B/op 0 allocs/op This branch: BenchmarkCache-2 1000000 1806 ns/op 0 B/op 0 allocs/op BenchmarkCache-2 1000000 1809 ns/op 0 B/op 0 allocs/op
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 3-0/+220
* Rename middleware to plugin first pass; mostly used 'sed', few spots where I manually changed text. This still builds a coredns binary. * fmt error * Rename AddMiddleware to AddPlugin * Readd AddMiddleware to remain backwards compat