Skip to content

Specify a read buffer size for agent WorkloadAPI server#6875

Merged
sorindumitru merged 1 commit into
spiffe:mainfrom
sorindumitru:read-buffer-size
Apr 23, 2026
Merged

Specify a read buffer size for agent WorkloadAPI server#6875
sorindumitru merged 1 commit into
spiffe:mainfrom
sorindumitru:read-buffer-size

Conversation

@sorindumitru
Copy link
Copy Markdown
Member

@sorindumitru sorindumitru commented Apr 15, 2026

Pull Request check list

  • Commit conforms to CONTRIBUTING.md?
  • Proper tests/regressions included?
  • Documentation updated?

Affected functionality
Hopefully none, but it may lead to multiple read() calls when reading large requests for WorkloadAPI, SDSv3 and gRPC Healthcheck.

Description of change
gRPC allocates a 32KB buffer per active connection for reading data from callers. This is excessive since we don't usually have large incoming requests.

In a testing setup this dropped the memory usage of spire-agent from ~340MB to ~200MB

In the case where we have larger incoming payloads, we would end up making multiple read() calls to read the incoming data, so no functionality is affected but if there are larger requests (maybe for the SDSv3 API?) incoming we could have some performance degradation.

gRPC allocates a 32KB buffer per active connection for reading data from callers. This is excessive since we don't usually have large incoming requests.

In a testing setup this dropped the memory usage of spire-agent from ~340MB to ~200MB

In the case where we have larger incoming payloads, we would end up making multiple read() calls to read the incoming data, so no functionality is affected but if there are larger requests (maybe for the SDSv3 API?) incoming we could have some performance degradation.

Signed-off-by: Sorin Dumitru <sorin@returnze.ro>
Copy link
Copy Markdown
Member

@amartinezfayo amartinezfayo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@sorindumitru sorindumitru added this pull request to the merge queue Apr 21, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 21, 2026
@sorindumitru sorindumitru added this to the 1.15.0 milestone Apr 23, 2026
@sorindumitru sorindumitru added this pull request to the merge queue Apr 23, 2026
Merged via the queue into spiffe:main with commit f32c8c7 Apr 23, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants