added more tuning knobs, particularly in cache sizes

This commit is contained in:
2026-02-20 15:44:06 -07:00
parent d8eeeb7140
commit 8a1c770079
10 changed files with 86 additions and 34 deletions
+5 -4
View File
@@ -19,6 +19,7 @@ import (
"sync"
"time"
"git.erbosoft.com/amy/amsterdam/config"
"git.erbosoft.com/amy/amsterdam/util"
lru "github.com/hashicorp/golang-lru"
"github.com/jmoiron/sqlx"
@@ -115,14 +116,14 @@ var conferencePropCache *lru.Cache = nil
// getConferencePropMutex is a mutex on AmGetConferenceProperty.
var getConferencePropMutex sync.Mutex
// init initializes the conference cache.
func init() {
// setupConferenceCache initializes the conference cache.
func setupConferenceCache() {
var err error
conferenceCache, err = lru.New2Q(100)
conferenceCache, err = lru.New2Q(config.GlobalConfig.Tuning.Caches.Conferences)
if err != nil {
panic(err)
}
conferencePropCache, err = lru.New(100)
conferencePropCache, err = lru.New(config.GlobalConfig.Tuning.Caches.ConferenceProps)
if err != nil {
panic(err)
}