Learn to prepare tasty,quality south indian, north indian, vegeterian,non-vegeterian,thai,tiffin,idli,dosa,vada,sambar.
Mongodb production database Linux deployment Best Recommendations
MongoDB can be deployed in a variety of paltforms including 32-bit windows 7, 64-bit windows 7, Mac OS, Linux, Soalris etc. Lets take a quick look at the best recommendaitons to be followed while deploying mongoDB production instances in Linux environment
1) Always run mongoDB in 64-bit environment
2) Linux kernel version 2.6.36 or later must be used
Simple command to find kernel version in Linux are
2.1) Use the uname command
uname -r
2.2) Access /proc/version files
cat /proc/version
2.3) Using Red Hat Package Manager command with -q option
rpm -q kernel
2.4) Look at dmesg command
dmesg |grep Linux
2.5) Look at book folder
ls /boot
3) Filesystem recommendation on MongoDB - As with RDBMS like Oracle, MongoDB preallocates the database files. MongoDB supports big data and often the files are large files. Filesystems like Ext4 and XFS can be used. Also, the filesystem should support fsync() on directories
4) We need to turn off accesstime aka atime in the storage volumes [disk drives] containing database files of MongoDB. atime is the file access time that is updated whenever a file is accessed including opening of files, operations like grep, sort, cat, head, tail and so on. As such this recommendaiton is to improve the speed of disk drives in Linux environment. Edit /etc/fstab file , add noatime,nodiratime at the end and disable atime
5) Optimal virtual memory apge size of mongoDB is 4096 bytes. Transparent Huge pages need to be disabled
6) To avoid conneciton issues in a heavy environment and to prevent loss of service, user limit and file descriptor limit should be set above 20000
ulimit -u
limit -n
Above command should return 20000 and above values
7) Non-Uniform Memory Access (NUMA) needs to be disabled at BIOS as there could be a performance impact while accessing multiple memory nodes
8) In a sharded cluster environment Network Time Protocol (NTP) to synchronize time among hosts
9) Block devices store database files. Readahead settings should be optimal. Often value of 32(16KB) works fine