Skip to content
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

Get available limit from cgroups if set #9879

Merged
merged 3 commits into from Jun 24, 2019

Conversation

freva
Copy link
Member

@freva freva commented Jun 22, 2019

Returns 2^63 if uncapped.

After we get rid of VESPA_TOTAL_MEMORY_MB, I think we can change memory in container by just changing cgroup limit and restarting Vespa.

@freva freva requested a review from hakonhall June 23, 2019 17:07
@@ -71,6 +71,11 @@ configure_memory() {
available="$VESPA_TOTAL_MEMORY_MB"
else
available=`free -m | grep Mem | tr -s ' ' | cut -f2 -d' '`
if [ -x "$(command -v cgget)" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't work well unless cgget exists and is a program:

$ command -v foobar
$ command -v ls
alias ls='ls -G'

Looks like hash is ideal for this case:

if hash &>/dev/null; then

@hakonhall hakonhall merged commit 9e793e7 into master Jun 24, 2019
@hakonhall hakonhall deleted the freva/avoid-VESPA_TOTAL_MEMORY branch June 24, 2019 08:30
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.

None yet

2 participants