-
Notifications
You must be signed in to change notification settings - Fork 134
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
Fixes #29425 - Configure default mongo cache size #492
Conversation
7579a5c
to
027f8d1
Compare
Local test passed, test procedure:
Mar 27 18:01:33 centos7-katello-3-15.apex.example.com mongod.27017[8441]: [initandlisten] options: { command: [ "run" ], config: "/etc/opt/rh/rh-mongodb34/mongod.conf", net: { bindIp: "127.0.0.1" }, processManagement: { fork: true, pidFilePath: "/var/opt/rh/rh-mongodb34/run/mongodb/mongod.pid" }, security: { authorization: "disabled" }, storage: { dbPath: "/var/lib/mongodb", journal: { enabled: true }, wiredTiger: { engineConfig: { cacheSizeGB: 1.13 } } }, systemLog: { destination: "syslog", quiet: true } }
# facter -p memory | grep total_bytes
total_bytes => 2147479552,
total_bytes => 6087458816, <-- this is the system memory info
|
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.
Overall it looks good. I've always been wondering about doing this, but then in the postgresql department. We may even be able to drop some of the explicit tuning profile options then.
Configuring default mongo cache size to 20% of total memory. See[1] Otherwise mongo goes onto consume about 50% of total memory. See[2] [1] https://access.redhat.com/solutions/4505561 [2] https://docs.mongodb.com/manual/core/wiredtiger/#memory-use
027f8d1
to
c75d2df
Compare
@@ -22,3 +22,6 @@ postgresql::server::config_entries: | |||
log_line_prefix: '%t ' | |||
log_min_duration_statement: 1000 | |||
log_rotation_size: 200000 | |||
|
|||
mongodb::server::config_data: | |||
storage.wiredTiger.engineConfig.cacheSizeGB: "%{facts.kafo.scenario.custom.mongo_cache_size}" |
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.
If a user hasn't upgraded to wiredTiger will this configuration option existing be a no-op for them? That is, will it break if not on wiredTiger?
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.
it shouldn't. Let me see if I can get an older version of server to test this. It may be tricky to get one though.
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 can't get older versions of upstream / downstream boxes to get non-wiredTiger, is there a way to do it properly?
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 found an old Satellite 6.3.5 server running mmapv1 and added the following to the custom-hiera.yaml and ran the installer. The mongo service came back up without any issues.
mongodb::server::config_data:
storage.wiredTiger.engineConfig.cacheSizeGB: 2
Note, tests have not run yet. Travis is being flaky. |
Configuring default mongo cache size to 20% of total memory. See[1]
Otherwise mongo goes onto consume about 50% of total memory. See[2]
[1] https://access.redhat.com/solutions/4505561
[2] https://docs.mongodb.com/manual/core/wiredtiger/#memory-use