You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I import this outstanding lib into my app to use its /store/ristretto/v4, and there will be about 80000 QPS concurrency in our production, so should I use cache.NewMetric to enable metric?
Because I find each Get() will generator a observe operation, on the other hand the codec channel buffer length which is 10000 maybe also cause goroutines suspend, is that right? I finaly plan to lower metric sampling rate through code below, I wonder there is better way to reach it or not?
thank you
ristrettoStoreShelfTidy=ristretto_store.NewRistretto(ristrettoCache)
promMetrics:=metrics.NewPrometheus("shelf_tidy_cache", metrics.WithNamespace("local"))
ristrettoStoreShelfTidyWithMetric=cache.NewMetric[any](
promMetrics,
cache.New[any](ristrettoStoreShelfTidy),
)
// ***** some lines skippedifrand.Intn(100) <1 { // only one out of a hundred it will use metric instance to lower sampling rateristrettoStoreShelfTidyWithMetric.Get(ctx, key)
} else {
ristrettoStoreShelfTidy.Get(ctx, key)
}
The text was updated successfully, but these errors were encountered:
I import this outstanding lib into my app to use its /store/ristretto/v4, and there will be about 80000 QPS concurrency in our production, so should I use cache.NewMetric to enable metric?
Because I find each Get() will generator a observe operation, on the other hand the codec channel buffer length which is 10000 maybe also cause goroutines suspend, is that right? I finaly plan to lower metric sampling rate through code below, I wonder there is better way to reach it or not?
thank you
The text was updated successfully, but these errors were encountered: