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

Respect container memory limits #34

Open
rueberger opened this issue Feb 22, 2018 · 2 comments
Open

Respect container memory limits #34

rueberger opened this issue Feb 22, 2018 · 2 comments

Comments

@rueberger
Copy link

Apologies if this isn't the best place for this issue.

I've noticed that with docker 17.12.0-ce and the mongo:3.4.1 image, memory limits imposed on the container are not "respected" by mongo. What I mean by this is that mongo seems to not recognize the memory limit and tries to use the full memory of the host system.

This leads to bad things happening when memory fills up - mongo starts spilling into swap and performance slows to a crawl.

I would rather not give mongo unrestricted access to the host's memory, or be forced to periodically kill mongod.

I considered explicitly limiting the cache size for WiredTiger, but that's no good because the file-system cache is still unbounded.

Any ideas for a workaround?

@ronaldescalona
Copy link

Hey @rueberger !

I'm working around this issue too, but I still looking for a workaround, without success.
Perhaps, do you had found the way to fix this behaviour?

My lab on Kubernetes:
Sharding Cluster: 1 replica set Config Servers (3 servers), 1 Shard (1 replica set, 3 servers + 2 arbiters) and 2 mongos.

Thanks,
Ronald E.

@rueberger
Copy link
Author

I haven't had any issues for a while, but I'm not really sure what changed. Now running mongo:3.6, with the following mongo.conf:

storage:
  dbPath: /data/db
  wiredTiger:
    engineConfig:
         cacheSizeGB: 6

and a container memory limit of 10G. Hope that helps.

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

No branches or pull requests

2 participants