From 6f117f583311b59cf0603b70ec876531773a05cd Mon Sep 17 00:00:00 2001 From: Ian Norden Date: Tue, 20 Oct 2020 20:47:53 -0500 Subject: [PATCH] adjust chan buff sizes; move trace msg to trace logrus level --- pkg/eth/streamer.go | 2 +- pkg/eth/transformer.go | 2 +- pkg/sync/service.go | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pkg/eth/streamer.go b/pkg/eth/streamer.go index 729f2e955..d0ec90bf4 100644 --- a/pkg/eth/streamer.go +++ b/pkg/eth/streamer.go @@ -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 diff --git a/pkg/eth/transformer.go b/pkg/eth/transformer.go index 570f63f0c..722db812a 100644 --- a/pkg/eth/transformer.go +++ b/pkg/eth/transformer.go @@ -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) diff --git a/pkg/sync/service.go b/pkg/sync/service.go index 8007bc28c..e9b28ad52 100644 --- a/pkg/sync/service.go +++ b/pkg/sync/service.go @@ -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 { @@ -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)