![]()
The number of blocks to read ahead should be adjusted to approximately 32 blocks (or 16 KB) of data. In addition, the default disk read ahead settings on EC2 are not optimized for MongoDB. We can disable this feature by editing the fstab file: sudo nano /etc/fstabĪdd the noatime flag directly after defaults: LABEL=cloudimg-rootfs / ext4 defaults,noatime,discard 0 0 When MongoDB performs frequent writes to the filesystem, this will create unnecessary overhead and performance degradation. #INSTALL MONGODB ON WINDOWS USING AMAZON EC2 UPDATE#Linux by default will update the last access time when files are modified. Set it to start automatically on boot: sudo update-rc.d disable-transparent-hugepages defaults Make it executable: sudo chmod 755 /etc/init.d/disable-transparent-hugepages Thp_path=/sys/kernel/mm/redhat_transparent_hugepage Thp_path=/sys/kernel/mm/transparent_hugepageĮlif then # Description: Disable Linux transparent huge pages, to improve # Short-Description: Disable Linux transparent huge pages # X-Start-Before: mongod mongodb-mms-automation-agent # Provides: disable-transparent-hugepages Run the following commands to create an init script that will automatically disable THP on system boot: sudo nano /etc/init.d/disable-transparent-hugepages You should disable THP to ensure best performance with MongoDB. However, database workloads often perform poorly with THP, because they tend to have sparse rather than contiguous memory access patterns. Transparent Huge Pages (THP) is a Linux memory management system that reduces the overhead of Translation Lookaside Buffer (TLB) lookups on machines with large amounts of memory by using larger memory pages. ![]() Paste the following lines into the file: * soft nproc 32000 Next, create a file called nf in /etc/security/limits.d/: sudo nano /etc/security/limits.d/nf Modify them by editing the nf file: sudo nano /etc/security/nfĪdd the following lines to the end of the file: * soft nofile 64000 The default file and process limits shipped with Ubuntu are not applicable for MongoDB. MongoDB needs to be able to create file descriptors when clients connect and spawn a large number of processes in order to operate effectively. ![]() Make sure to modify and set it to each server's DNS hostname. Sudo bash -c 'echo > /etc/hostname & hostname -F /etc/hostname ' #INSTALL MONGODB ON WINDOWS USING AMAZON EC2 HOW TO#SSH into each server and set its hostname so that when we initialize the replica set, members will be able to understand how to reach one another: We will need to modify the server to the underlying OS in order for it to behave nicely with MongoDB. For each record, enter each instance's Public DNS hostname, visible in the EC2 instances dashboard. Go to your domain's DNS console and add CNAME records for db1, db2, arbiter1.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |