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

GetOrchestrator slowness when PM Sender data is not cached #2849

Merged
merged 6 commits into from
Nov 6, 2023
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
4 changes: 2 additions & 2 deletions cmd/livepeer/starter/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ var (
txCostMultiplier = 100

// The interval at which to clean up cached max float values for PM senders and balances per stream
cleanupInterval = 1 * time.Minute
cleanupInterval = 10 * time.Minute
// The time to live for cached max float values for PM senders (else they will be cleaned up) in seconds
smTTL = 60 // 1 minute
smTTL = 172800 // 2 days
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pm/sendermonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"time"

ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
"github.com/golang/glog"
Expand Down Expand Up @@ -272,7 +273,6 @@ func (sm *LocalSenderMonitor) cache(addr ethcommon.Address) {
queue.Start()
done := make(chan struct{})
go sm.startTicketQueueConsumerLoop(queue, done)

sm.senders[addr] = &remoteSender{
pendingAmount: big.NewInt(0),
queue: queue,
Expand Down Expand Up @@ -347,6 +347,7 @@ func (sm *LocalSenderMonitor) cleanup() {
v.subScope.Close() // close the maxfloat subscriptions
delete(sm.senders, k)
sm.smgr.Clear(k)
glog.V(6).Infof("sender cleared from cache addr: %v last access: %v ttl: %vs", hexutil.Encode(k.Bytes()), v.lastAccess, sm.cfg.TTL)
}
}
}
Expand Down
Loading