-
Notifications
You must be signed in to change notification settings - Fork 160
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
Fix memory limit calculation for deployments with 20Gi+ of total memory #558
Conversation
Bug: If `SPLUNK_MEMORY_TOTAL_MIB` set to more than 20480, the calculated memory limit drops from 90% to 2048 and collector is failing to start with ``` main.go:283: Memory limit (2048) is less than 2x ballast (6761). Increase memory limit or decrease ballast size. ``` This change fixes the bug and removes the unnecessary complication for default memory limit calculation. If user wants to adjust memory allocation for a 20Gb+ deployment they can always use SPLUNK_MEMORY_LIMIT_MIB env var.
c1ac50c
to
cc0c763
Compare
@dmitryax I cannot reproduce this -- can you please provide the exact command and version to see the described behavior?
Using the above -- which I would assume would repro given the description -- I am able to start the collector and navigating to |
@flands |
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.
OK, confirmed. So keeping logic can just update line 297 otherwise we can remove logic. Only concern is that as memory increases more and more memory will be "wasted". I am good either way -- note other YAML config will need comments updated.
// The memory limit should be set to defaultMemoryLimitPercentage of total memory | ||
// while reserving a maximum of defaultMemoryLimitMaxMiB of memory. | ||
if (memTotalSizeMiB - memLimit) > defaultMemoryLimitMaxMiB { | ||
memLimit = defaultMemoryLimitMaxMiB |
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.
Keeping logic you can just change this to:
memLimit = (memTotalSizeMiB - defaultMemoryLimitMaxMiB)
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.
Yes, we discussed that option with @pjanotti and agreed on removing the logic.
@flands I think I already updated all the configurations. Please let me know if you see any of them missed |
Bug: If
SPLUNK_MEMORY_TOTAL_MIB
set to more than 20480, the calculated memory limit drops from 90% to 2048 and collector is failing to start withThis change fixes the bug and removes the unnecessary complication for default memory limit calculation. If user wants to adjust memory allocation for a 20Gb+ deployment they can always use
SPLUNK_MEMORY_LIMIT_MIB
env var.