Skip to content

Add GOGC and GOMEMLIMIT properties to BBS job#1130

Merged
ameowlia merged 2 commits into
cloudfoundry:developfrom
plamen-bardarov:bbs-gc-tuning-properties
Apr 29, 2026
Merged

Add GOGC and GOMEMLIMIT properties to BBS job#1130
ameowlia merged 2 commits into
cloudfoundry:developfrom
plamen-bardarov:bbs-gc-tuning-properties

Conversation

@plamen-bardarov
Copy link
Copy Markdown
Contributor

Summary

Adds two optional BOSH properties (diego.bbs.gogc, diego.bbs.gomemlimit) that allow operators to configure Go GC behavior for the BBS process via the deployment manifest.

When set, the values are injected as environment variables in bpm.yml. When left empty (default), no env vars are added and Go defaults apply.

Backward Compatibility

Breaking Change? No

@plamen-bardarov plamen-bardarov requested a review from a team as a code owner April 29, 2026 14:18
Copy link
Copy Markdown
Member

@ameowlia ameowlia left a comment

Choose a reason for hiding this comment

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

  1. since these are int properties, I think it is confusing to have the default be an empty string. If you don't provide a default is the value nil, which could serve the same purpose?
  2. Please add template tests.
  3. Is there any more description you could add? Like "consider setting this value to X, or increasing for this reason, or decreasing for that reason." ?

@plamen-bardarov
Copy link
Copy Markdown
Contributor Author

updated. both properties are strings because they are set as env variables and cant be represented as int, for example GOGC can be 100, 200 etc or 'off' while GOMEMLIMIT has unit of measure like GiB MiB etc..

@ameowlia ameowlia self-requested a review April 29, 2026 15:25
@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Application Runtime Platform Working Group Apr 29, 2026
@ameowlia ameowlia merged commit 65ff0b7 into cloudfoundry:develop Apr 29, 2026
16 of 17 checks passed
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Application Runtime Platform Working Group Apr 29, 2026
@plamen-bardarov
Copy link
Copy Markdown
Contributor Author

Just putting it here for future reference:

The change was needed because of persistent latency spikes (5-10s) on the BBS ActualLRPs endpoint. CPU profiling and the execution trace showed GC was consuming nearly 100% of available CPU time.

Setting GOGC=off and GOMEMLIMIT=8GiB immediately resolved the latency. With these settings, GC only runs when approaching the memory limit using smooth pacing, instead of aggressive GC cycles based on heap growth ratio.

This PR adds BOSH properties so operators can configure these values through the deployment manifest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

2 participants