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

Reserve 1Gb for Application Memory #7618

Merged
merged 1 commit into from Nov 2, 2020
Merged

Conversation

humitos
Copy link
Member

@humitos humitos commented Oct 29, 2020

We have noticed some strange behavior when trying to create_container and
remove_container using the Docker API. For some reason we started getting
ReadTimeout and I'm supposing that our Docker daemon has been restarted (because
of OOM) or in a dumb state.

This commit increases from 750 to 1000 Mb of RAM memory reserved for our
application and OS processes.

The user will get 7000Mb instead of 7200Mb in build-large instances and
in build-default instances they will get 2400 intead of 2700Mb.

Reference: #7583 (comment)

We have noticed some strange behavior when trying to `create_container` and
`remove_container` using the Docker API. For some reason we started getting
ReadTimeout and I'm supposing that our Docker daemon has been restarted (because
of OOM) or in a dumb state.

This commit increases from 750 to 1000 Mb of RAM memory reserved for our
application and OS processes.

The user will get 7000Mb instead of 7200Mb in build-large instances and
in build-default instances they will get 2400 intead of 2700Mb.
@humitos humitos requested a review from a team October 29, 2020 12:13
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

Seems reasonable 👍

@@ -495,7 +495,7 @@ def _get_docker_memory_limit(self):
"free -m | awk '/^Mem:/{print $2}'",
shell=True,
))
return total_memory, round(total_memory - 750, -2)
return total_memory, round(total_memory - 1000, -2)
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be a constant, or at least have a comment explaining the logic.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree. I'm merging it for now so it goes out tomorrow, tho.

@humitos humitos merged commit 2c0de38 into master Nov 2, 2020
3 checks passed
@humitos humitos deleted the humitos/docker-mem-limit branch November 2, 2020 18:56
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