Last active
December 21, 2022 23:17
-
-
Save kennwhite/2a0eb0adbe6d591dced8efdc3ad6c498 to your computer and use it in GitHub Desktop.
Set Ubuntu 20.04 mongodb recommended ulimits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ulimit -a | |
| # sudo sysctl net.ipv4.tcp_fastopen=3 | |
| # sudo sysctl vm.max_map_count=524288 | |
| # note: "-l" (max locked memory) has no soft limit | |
| # apt-get install numactl | |
| sudo sh -c "sysctl -w net.ipv4.tcp_fastopen=3 ; \ | |
| sysctl -w vm.max_map_count=524288 ; \ | |
| ulimit -l unlimited ; \ | |
| ulimit -S -v unlimited ; \ | |
| sudo -u ubuntu /bin/bash -c '\ | |
| ulimit -S -f unlimited; \ | |
| ulimit -S -t unlimited; \ | |
| ulimit -S -n 64000; \ | |
| ulimit -S -m 65536; \ | |
| numactl --interleave=all ./bin/mongod \ | |
| --replSet rs0 --dbpath ./dbfiles \ | |
| --bind_ip 0.0.0.0 \ | |
| -port 27017 \ | |
| --logpath ./dblogs/mongod.log 2>&1 &'" | |
| sleep 5 && echo "rs.initiate()" | mongosh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment