Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweak cache params #1801

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions go/common/gethencoding/geth_encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ type gethEncodingServiceImpl struct {
func NewGethEncodingService(storage storage.Storage, logger gethlog.Logger) EncodingService {
// todo (tudor) figure out the best values
ristrettoCache, err := ristretto.NewCache(&ristretto.Config{
NumCounters: 1000, // number of keys to track frequency of.
MaxCost: 1 << 28, // maximum cost of cache (256MB).
BufferItems: 64, // number of keys per Get buffer. Todo - what is this
NumCounters: 5000, // number of keys to track frequency of.
MaxCost: 500, // todo - this represents how many items.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the default "cost" for an item is 1

BufferItems: 64, // number of keys per Get buffer. Todo - what is this
})
if err != nil {
panic(err)
Expand Down
6 changes: 3 additions & 3 deletions go/enclave/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ func NewStorage(backingDB enclavedb.EnclaveDB, chainConfig *params.ChainConfig,

// todo (tudor) figure out the config
ristrettoCache, err := ristretto.NewCache(&ristretto.Config{
NumCounters: 10_000, // number of keys to track frequency of.
MaxCost: 1 << 30, // maximum cost of cache (1GB).
BufferItems: 64, // number of keys per Get buffer.
NumCounters: 20_000, // 10*MaxCost
MaxCost: 2000, // - how many items to cache
BufferItems: 64, // number of keys per Get buffer.
})
if err != nil {
logger.Crit("Could not initialise ristretto cache", log.ErrKey, err)
Expand Down
Loading