implement and use striped LRU cache to lower mutex contention (#15764)
* Implement Striped LRU cache * ci * fix Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
96d76760f0
Коммит
349b83f23a
@@ -102,7 +102,11 @@ func setupTestHelper(dbStore store.Store, searchEngine *searchengine.Broker, ent
|
||||
if includeCache {
|
||||
// Adds the cache layer to the test store
|
||||
options = append(options, app.StoreOverride(func(s *app.Server) store.Store {
|
||||
return localcachelayer.NewLocalCacheLayer(dbStore, s.Metrics, s.Cluster, s.CacheProvider)
|
||||
lcl, err2 := localcachelayer.NewLocalCacheLayer(dbStore, s.Metrics, s.Cluster, s.CacheProvider)
|
||||
if err2 != nil {
|
||||
panic(err2)
|
||||
}
|
||||
return lcl
|
||||
}))
|
||||
} else {
|
||||
options = append(options, app.StoreOverride(dbStore))
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
const OPEN_GRAPH_METADATA_CACHE_SIZE = 10000
|
||||
|
||||
var openGraphDataCache = cache.NewLRU(&cache.LRUOptions{
|
||||
var openGraphDataCache = cache.NewLRU(cache.LRUOptions{
|
||||
Size: OPEN_GRAPH_METADATA_CACHE_SIZE,
|
||||
})
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ const (
|
||||
MAX_SERVER_BUSY_SECONDS = 86400
|
||||
)
|
||||
|
||||
var redirectLocationDataCache = cache.NewLRU(&cache.LRUOptions{
|
||||
var redirectLocationDataCache = cache.NewLRU(cache.LRUOptions{
|
||||
Size: REDIRECT_LOCATION_CACHE_SIZE,
|
||||
})
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user