question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Performance] RedisRemoteEvictionExtension evicts just added key from all running instances

See original GitHub issue

What does the bug do?

Even though the key was just added to cache the eviction is called on all currently running instances. Which makes startup performance really bad when a lot of new keys are added to cache. So when calling GetOrSetAsync even though key is not present in any layer of cache it still get’s evicted from memory layer from all other instances which makes a lot of overhead when adding new keys ( especially startup).

How can it be reproduced?

You can reproduce the bug by running this code…

var redisCacheLayer = new RedisCacheLayer(redisConnection);
            var memoryCacheLayer = new MemoryCacheLayer();
            var cacheStack = new CacheStack(new ICacheLayer[]
            {
                memoryCacheLayer,
                redisCacheLayer

            }, new ICacheExtension[]
            {
                new RedisRemoteEvictionExtension(redisConnection, new ICacheLayer[] {memoryCacheLayer})
            });

cacheStack.GetOrSetAsync(); //even though it's first call for specific key it calls evict on all other instances. 

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jerackistacommented, Aug 12, 2021

I confirm that issue is fixed in version 0.11.0. Thank you.

1reaction
Turnerjcommented, Aug 11, 2021

Version 0.11.0 of Cache Tower is now released with the fix from #178 included - that should solve your problem. If you’re still encountering issues, let me know!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cache Tower
Distributed evictions, helping to keep caches across multiple application instances the same. All-async API, ready for high performance workloads.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found