Merge pull request #151 from NeowayLabs/limits

Recommended limits for for mongod
This commit is contained in:
Sergei Antipov 2019-04-26 23:22:54 -04:00 committed by GitHub
commit 9219f68648
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 13 deletions

View File

@ -101,7 +101,7 @@ mongodb_replication_oplogsize: 1024 # specifies a maximum size in
mongodb_set_parameters: { "enableLocalhostAuthBypass": "true", "authenticationMechanisms": "SCRAM-SHA-1,MONGODB-CR" } mongodb_set_parameters: { "enableLocalhostAuthBypass": "true", "authenticationMechanisms": "SCRAM-SHA-1,MONGODB-CR" }
# MMS Agent # MMS Agent
mongodb_mms_agent_pkg: https://mms.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager_1.4.2.783-1_amd64.deb mongodb_mms_agent_pkg: https://cloud.mongodb.com/download/agent/monitoring/mongodb-mms-monitoring-agent_7.2.0.488-1_amd64.ubuntu1604.deb
mongodb_mms_group_id: "" mongodb_mms_group_id: ""
mongodb_mms_api_key: "" mongodb_mms_api_key: ""
mongodb_mms_base_url: https://mms.mongodb.com mongodb_mms_base_url: https://mms.mongodb.com

View File

@ -70,7 +70,7 @@ mongodb_replication_replindexprefetch: "all" # specify index prefetching be
mongodb_replication_oplogsize: 1024 # specifies a maximum size in megabytes for the replication operation log mongodb_replication_oplogsize: 1024 # specifies a maximum size in megabytes for the replication operation log
# MMS Agent # MMS Agent
mongodb_mms_agent_pkg: https://mms.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager_1.4.2.783-1_amd64.deb mongodb_mms_agent_pkg: https://cloud.mongodb.com/download/agent/monitoring/mongodb-mms-monitoring-agent_7.2.0.488-1_amd64.ubuntu1604.deb
mongodb_mms_group_id: "" mongodb_mms_group_id: ""
mongodb_mms_api_key: "" mongodb_mms_api_key: ""
mongodb_mms_base_url: https://mms.mongodb.com mongodb_mms_base_url: https://mms.mongodb.com

View File

@ -4,9 +4,25 @@ Documentation=man:mongod(1)
[Service] [Service]
User=mongodb User=mongodb
ExecStart=/usr/bin/mongod --config /etc/mongod.conf ExecStart=/usr/bin/numactl --interleave=all /usr/bin/mongod --config /etc/mongod.conf
LimitNOFILE=65535 # file size
LimitNPROC=65535 LimitFSIZE=infinity
# cpu time
LimitCPU=infinity
# virtual memory size
LimitAS=infinity
# open files
LimitNOFILE=64000
# processes/threads
LimitNPROC=64000
# locked memory
LimitMEMLOCK=infinity
# total threads (user+kernel)
TasksMax=infinity
TasksAccounting=false
# Recommended limits for for mongod as specified in
# http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -8,8 +8,8 @@
service: name={{ mongodb_daemon_name }} state=restarted service: name={{ mongodb_daemon_name }} state=restarted
when: mongodb_manage_service when: mongodb_manage_service
- name: mongodb-mms-automation-agent restart - name: mongodb-mms-monitoring-agent restart
service: name=mongodb-mms-automation-agent state=restarted service: name=mongodb-mms-monitoring-agent state=restarted
when: mongodb_manage_service when: mongodb_manage_service
- name: reload systemd - name: reload systemd

View File

@ -32,9 +32,9 @@
- name: Create log if missing - name: Create log if missing
file: state=touch dest={{ mongodb_systemlog_path }} owner={{ mongodb_user }} group={{mongodb_user}} mode=0755 file: state=touch dest={{ mongodb_systemlog_path }} owner={{ mongodb_user }} group={{mongodb_user}} mode=0755
when: ( logfile_stat is defined when: ( mongodb_systemlog_destination == "file"
and not logfile_stat.stat.exists and logfile_stat is defined
and mongodb_systemlog_destination == "file" ) and not logfile_stat.stat.exists )
- name: Ensure dbpath directory - name: Ensure dbpath directory
file: file:

View File

@ -25,9 +25,9 @@
file: state=directory path=/etc/mongodb-mms owner={{mongodb_user}} group={{mongodb_user}} mode=0755 file: state=directory path=/etc/mongodb-mms owner={{mongodb_user}} group={{mongodb_user}} mode=0755
- name: Configure the MMS agent pt. 2 - name: Configure the MMS agent pt. 2
template: src=automation-agent.config.j2 dest=/etc/mongodb-mms/automation-agent.config template: src=monitoring-agent.config.j2 dest=/etc/mongodb-mms/monitoring-agent.config
notify: mongodb-mms-automation-agent restart notify: mongodb-mms-monitoring-agent restart
- name: Ensure that the MMS agent is started - name: Ensure that the MMS agent is started
service: name=mongodb-mms-automation-agent state=started enabled=yes service: name=mongodb-mms-monitoring-agent state=started enabled=yes
when: mongodb_manage_service when: mongodb_manage_service