Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

grpc: raise global default message size from 4 MB to 90 MB#55209

Merged
ggilmore merged 1 commit into
mainfrom
grpc-raise-message-size
Jul 21, 2023
Merged

grpc: raise global default message size from 4 MB to 90 MB#55209
ggilmore merged 1 commit into
mainfrom
grpc-raise-message-size

Conversation

@ggilmore

@ggilmore ggilmore commented Jul 21, 2023

Copy link
Copy Markdown
Contributor

See https://sourcegraph.slack.com/archives/C04HCK4K3DL/p1689969401765809 for more context.

This raises our global maximum message size that gRPC servers and clients are allowed to receive to 90 MB (up from 4MB). 4MB megabytes seems too restrictive for many of our use cases, and many projects (in the Slack message) seem to also increase their minimum. https://sourcegraph.com/search?q=context:global+MaxCallRecvMsgSize+-f:vendor+-r:grpc/grpc-go&patternType=standard&sm=1&groupBy=repo

However, at the same time we should strive to keep our message sizes as small as possible. I will prioritize adding additional Prometheus metrics to track this next week.

Note: Our existing REST code effectively has no cap on message sizes, so we're still no worse off than we were before.

Test plan

CI

See https://sourcegraph.slack.com/archives/C04HCK4K3DL/p1689969401765809 for more context.

This raises our global maximum message size that gRPC servers and clients are allowed to receive to 90 MB (up from 4MB). 4MB megabytes seems too restrictive for many of our use cases, and many projects (in the Slack message) seem to also increase the minimum.
@ggilmore ggilmore requested review from camdencheek and mucles July 21, 2023 20:55
@cla-bot cla-bot Bot added the cla-signed label Jul 21, 2023
@sourcegraph-bot

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff aba1d58...0c85c28.

Notify File(s)
@indradhanush internal/gitserver/addrs.go
@sashaostrikov internal/gitserver/addrs.go

@ggilmore ggilmore enabled auto-merge (squash) July 21, 2023 20:58
@ggilmore ggilmore merged commit bce2029 into main Jul 21, 2023
@ggilmore ggilmore deleted the grpc-raise-message-size branch July 21, 2023 21:15
@github-actions

Copy link
Copy Markdown
Contributor

The backport to 5.1 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-5.1 5.1
# Navigate to the new working tree
cd .worktrees/backport-5.1
# Create a new branch
git switch --create backport-55209-to-5.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 bce2029f622b1e652fe0624971d40f30943bd830
# Push it to GitHub
git push --set-upstream origin backport-55209-to-5.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-5.1

Then, create a pull request where the base branch is 5.1 and the compare/head branch is backport-55209-to-5.1.

@github-actions github-actions Bot added backports failed-backport-to-5.1 release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases labels Jul 21, 2023
@ggilmore ggilmore changed the title grpc: raise global default message size from 4MB to 90 MB grpc: raise global default message size from 4 MB to 90 MB Jul 24, 2023
ggilmore added a commit that referenced this pull request Jul 24, 2023
coury-clark pushed a commit that referenced this pull request Jul 24, 2023
@ggilmore ggilmore removed the release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases label Jul 25, 2023
@ggilmore ggilmore mentioned this pull request Jul 25, 2023
camdencheek referenced this pull request Aug 2, 2023
…sages sent by servers/clients (#55495)

Follow up to https://github.com/sourcegraph/sourcegraph/pull/55209 and
https://github.com/sourcegraph/sourcegraph/pull/55242.

This PR adds interceptors that records Prometheus metrics that observe:

- the individual size of each **sent** protobuf message by a server or
client
- the total amount data sent over the course a single RPC by a server
(responses) or client (requests)

This allows us to track the total amount of a data returned by any of
our RPCs. In some cases, this can reveal opportunities for future
performance / stability improvements (Example: symbols'
[LocalCodeIntel method returning ~gigabyte sized responses that has to
be held all at once in
memory](https://github.com/sourcegraph/sourcegraph/pull/55242)).

This PR also provides new grafana dashboards that track this metric for
every gRPC service. See below for a screenshot of what this looks like
when I run the symbols service locally.

Co-authored-by: Geoffrey Gilmore <geoffrey@sourcegraph.com>
@ggilmore ggilmore mentioned this pull request Aug 8, 2023
10 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants