Skip to content

Commit

Permalink
Update dskit with -server.grpc.num-workers option (#6311)
Browse files Browse the repository at this point in the history
* Update dskit with -server.grpc.num-workers option

This option configures `gprc.NumStreamWorkers()` option, that allows
running long-living workers to handle the requests.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>

* Update CHANGELOG, mark as experimental

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>

* make doc

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>

* make clean-white-noise

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>

---------

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
  • Loading branch information
colega committed Oct 10, 2023
1 parent 1d1da72 commit 18c182f
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* [ENHANCEMENT] Ingester / store-gateway: optimized regex matchers. #6168 #6250
* [ENHANCEMENT] Distributor: Include ingester IDs in circuit breaker related metrics and logs. #6206
* [ENHANCEMENT] Querier: improve errors and logging when streaming chunks from ingesters and store-gateways. #6194
* [ENHANCEMENT] All: added an experimental `-server.grpc.num-workers` flag that configures the number of long-living workers used to process gRPC requests. This could decrease the CPU usage by reducing the number of stack allocations. #6311
* [ENHANCEMENT] All: improved IPv6 support by using the proper host:port formatting. #6311
* [BUGFIX] Query-frontend: Don't retry read requests rejected by the ingester due to utilization based read path limiting. #6032
* [BUGFIX] Ring: Ensure network addresses used for component hash rings are formatted correctly when using IPv6. #6068
* [BUGFIX] Query-scheduler: don't retain connections from queriers that have shut down, leading to gradually increasing enqueue latency over time. #6100 #6145
Expand Down
11 changes: 11 additions & 0 deletions cmd/mimir/config-descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,17 @@
"fieldType": "boolean",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "grpc_server_num_workers",
"required": false,
"desc": "If non-zero, configures the amount of GRPC server workers used to serve the requests.",
"fieldValue": null,
"fieldDefaultValue": 0,
"fieldFlag": "server.grpc.num-workers",
"fieldType": "int",
"fieldCategory": "experimental"
},
{
"kind": "field",
"name": "log_format",
Expand Down
2 changes: 2 additions & 0 deletions cmd/mimir/help-all.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2475,6 +2475,8 @@ Usage of ./cmd/mimir/mimir:
Duration after which a keepalive probe is sent in case of no activity over the connection., Default: 2h (default 2h0m0s)
-server.grpc.keepalive.timeout duration
After having pinged for keepalive check, the duration after which an idle connection should be closed, Default: 20s (default 20s)
-server.grpc.num-workers int
[experimental] If non-zero, configures the amount of GRPC server workers used to serve the requests.
-server.http-conn-limit int
Maximum number of simultaneous http connections, <=0 to disable
-server.http-idle-timeout duration
Expand Down
1 change: 1 addition & 0 deletions docs/sources/mimir/configure/about-versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ The following features are currently experimental:
- `log.rate-limit-logs-per-second-burst`
- Timeseries Unmarshal caching optimization in distributor (`-timeseries-unmarshal-caching-optimization-enabled`)
- Reusing buffers for marshalling write requests in distributors (`-distributor.write-requests-buffer-pooling-enabled`)
- Using a worker pool for handling GRPC requests (`-server.grpc.num-workers`)

## Deprecated features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,11 @@ grpc_tls_config:
# CLI flag: -server.grpc.keepalive.ping-without-stream-allowed
[grpc_server_ping_without_stream_allowed: <boolean> | default = true]
# (experimental) If non-zero, configures the amount of GRPC server workers used
# to serve the requests.
# CLI flag: -server.grpc.num-workers
[grpc_server_num_workers: <int> | default = 0]
# Output log messages in the given format. Valid formats: [logfmt, json]
# CLI flag: -log.format
[log_format: <string> | default = "logfmt"]
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/golang/snappy v0.0.4
github.com/google/gopacket v1.1.19
github.com/gorilla/mux v1.8.0
github.com/grafana/dskit v0.0.0-20231009143556-6a6d7e8a6f05
github.com/grafana/dskit v0.0.0-20231010092604-9b82fbd87ce1
github.com/grafana/e2e v0.1.1
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/json-iterator/go v1.1.12
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,8 @@ github.com/gosimple/slug v1.1.1 h1:fRu/digW+NMwBIP+RmviTK97Ho/bEj/C9swrCspN3D4=
github.com/gosimple/slug v1.1.1/go.mod h1:ER78kgg1Mv0NQGlXiDe57DpCyfbNywXXZ9mIorhxAf0=
github.com/grafana-tools/sdk v0.0.0-20220919052116-6562121319fc h1:PXZQA2WCxe85Tnn+WEvr8fDpfwibmEPgfgFEaC87G24=
github.com/grafana-tools/sdk v0.0.0-20220919052116-6562121319fc/go.mod h1:AHHlOEv1+GGQ3ktHMlhuTUwo3zljV3QJbC0+8o2kn+4=
github.com/grafana/dskit v0.0.0-20231009143556-6a6d7e8a6f05 h1:4htc/ow2X9ZGIott1BgvPdfswoekB6sfq1DmmGaCG70=
github.com/grafana/dskit v0.0.0-20231009143556-6a6d7e8a6f05/go.mod h1:byPCvaG/pqi33Kq+Wvkp7WhLfmrlyy0RAoYG4yRh01I=
github.com/grafana/dskit v0.0.0-20231010092604-9b82fbd87ce1 h1:u46tR3g8obq3eXKj6ifaPV8iC/98o1AymwHCOtHNkVc=
github.com/grafana/dskit v0.0.0-20231010092604-9b82fbd87ce1/go.mod h1:byPCvaG/pqi33Kq+Wvkp7WhLfmrlyy0RAoYG4yRh01I=
github.com/grafana/e2e v0.1.1 h1:/b6xcv5BtoBnx8cZnCiey9DbjEc8z7gXHO5edoeRYxc=
github.com/grafana/e2e v0.1.1/go.mod h1:RpNLgae5VT+BUHvPE+/zSypmOXKwEu4t+tnEMS1ATaE=
github.com/grafana/gomemcache v0.0.0-20230914135007-70d78eaabfe1 h1:MLYY2R60/74hfYl5vRRmC2VDo0Yuql1QQ1ig8hnvgSI=
Expand Down
1 change: 1 addition & 0 deletions pkg/util/fieldcategory/overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var overrides = map[string]Category{
"server.grpc.keepalive.ping-without-stream-allowed": Advanced,
"server.grpc.keepalive.time": Advanced,
"server.grpc.keepalive.timeout": Advanced,
"server.grpc.num-workers": Experimental,
"server.http-conn-limit": Advanced,
"server.http-idle-timeout": Advanced,
"server.http-listen-network": Advanced,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions vendor/github.com/grafana/dskit/server/server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 18c182f

Please sign in to comment.