Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
adjust chan buff sizes; move trace msg to trace logrus level
Browse files Browse the repository at this point in the history
  • Loading branch information
i-norden committed Oct 21, 2020
1 parent 46859e6 commit 6f117f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/eth/streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

const (
PayloadChanBufferSize = 20000 // the max eth sub buffer size
PayloadChanBufferSize = 10000 // half the max eth sub buffer size
)

// StreamClient is an interface for subscribing and streaming from geth
Expand Down
2 changes: 1 addition & 1 deletion pkg/eth/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (sdt *StateDiffTransformer) Transform(workerID int, payload statediff.Paylo
traceMsg += fmt.Sprintf("postgres transaction commit duration: %s\r\n", tDiff.String())
}
traceMsg += fmt.Sprintf(" TOTAL PROCESSING TIME: %s\r\n", time.Now().Sub(start).String())
logrus.Info(traceMsg)
logrus.Trace(traceMsg)
}()
tDiff = time.Now().Sub(t)
prom.SetTimeMetric("t_free_postgres", tDiff)
Expand Down
6 changes: 1 addition & 5 deletions pkg/sync/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ import (
"github.com/vulcanize/ipld-eth-indexer/pkg/shared"
)

const (
PayloadChanBufferSize = 2000
)

// Indexer is the top level interface for streaming, converting to IPLDs, publishing, and indexing all chain data at head
// This service is compatible with the Ethereum service interface (node.Service)
type Indexer interface {
Expand Down Expand Up @@ -97,7 +93,7 @@ func (sap *Service) Sync(wg *sync.WaitGroup) error {
return err
}
// spin up publish worker goroutines
publishPayload := make(chan statediff.Payload, PayloadChanBufferSize)
publishPayload := make(chan statediff.Payload, eth.PayloadChanBufferSize)
for i := 1; i <= int(sap.Workers); i++ {
go sap.transform(wg, i, publishPayload)
log.Debugf("ethereum sync worker %d successfully spun up", i)
Expand Down

0 comments on commit 6f117f5

Please sign in to comment.