-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new gc_max_allocs tuneable #2636
Conversation
More than gc_max_allocs may be running on a node, but terminal allocs will be garbage collected to try to keep the total number below the limit.
84abd9f
to
cc11d9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
client/config/config.go
Outdated
@@ -205,6 +209,7 @@ func DefaultConfig() *Config { | |||
GCParallelDestroys: 2, | |||
GCDiskUsageThreshold: 80, | |||
GCInodeUsageThreshold: 70, | |||
GCMaxAllocs: 200, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest 50
@@ -100,6 +100,12 @@ client { | |||
- `gc_inode_usage_threshold` `(float: 70)` - Specifies the inode usage percent | |||
which Nomad tries to maintain by garbage collecting terminal allocations. | |||
|
|||
- `gc_max_allocs` `(int: 200)` - Specifies the maximum number of allocations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to 50
One failing config test: https://travis-ci.org/hashicorp/nomad/builds/231747600#L3543 |
Went overboard before I realized there's only one test case.
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
More than gc_max_allocs may be running on a node, but terminal allocs
will be garbage collected to try to keep the total number below the
limit.
The default of 200 allocs was a guess. Let me know if you have a number with more science behind it.
I also split
go gc.run()
out of theNewAllocGarbageCollector
function as tests were creating and leaking gc goroutines. Not a big deal, but since it's only called one place in runtime code it's not really any convenience to hide it away inside the New func.