Skip to content

Commit

Permalink
add flag to set maximum concurrent requests on a tier2 instance
Browse files Browse the repository at this point in the history
  • Loading branch information
colindickson committed Mar 11, 2024
1 parent 33a6a73 commit ab75b74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Operators, you should copy/paste content of this content straight to your projec

If you were at `firehose-core` version `1.0.0` and are bumping to `1.1.0`, you should copy the content between those 2 version to your own repository, replacing placeholder value `fire{chain}` with your chain's own binary.

## Unreleased

* Added `--substreams-tier2-max-concurrent-requests` to limit the number of concurrent requests to the tier2 substreams service.

## v1.2.4

### Substreams improvements
Expand Down
5 changes: 5 additions & 0 deletions cmd/apps/substreams_tier2.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func RegisterSubstreamsTier2App[B firecore.Block](chain *firecore.Chain[B], root
RegisterFlags: func(cmd *cobra.Command) error {
cmd.Flags().String("substreams-tier2-grpc-listen-addr", firecore.SubstreamsTier2GRPCServingAddr, "Address on which the substreams tier2 will listen. Default is plain-text, appending a '*' to the end to jkkkj")
cmd.Flags().String("substreams-tier2-discovery-service-url", "", "URL to advertise presence to the grpc discovery service") //traffic-director://xds?vpc_network=vpc-global&use_xds_reds=true
cmd.Flags().Uint64("substreams-tier2-max-concurrent-requests", 0, "Maximum number of concurrent requests allowed on the server. When the tier2 service hits this limit, it will set itself as 'Not Ready' until requests are processed. Default 0 (no limit)")

// all substreams
registerCommonSubstreamsFlags(cmd)
Expand All @@ -64,6 +65,8 @@ func RegisterSubstreamsTier2App[B firecore.Block](chain *firecore.Chain[B], root

stateBundleSize := viper.GetUint64("substreams-state-bundle-size")

maximumConcurrentRequests := viper.GetUint64("substreams-tier2-max-concurrent-requests")

tracing := os.Getenv("SUBSTREAMS_TRACING") == "modules_exec"

var serviceDiscoveryURL *url.URL
Expand Down Expand Up @@ -98,6 +101,8 @@ func RegisterSubstreamsTier2App[B firecore.Block](chain *firecore.Chain[B], root

GRPCListenAddr: grpcListenAddr,
ServiceDiscoveryURL: serviceDiscoveryURL,

MaximumConcurrentRequests: maximumConcurrentRequests,
}, &app.Tier2Modules{
CheckPendingShutDown: runtime.IsPendingShutdown,
}), nil
Expand Down

0 comments on commit ab75b74

Please sign in to comment.