MongoDB server selection and basic optimization reference

Source: Internet
Author: User
Tags mongodb server
I haven't posted any articles for a long time! Hard Disk Selection 1. If the hard disk has conditions, try to select a SAS disk. If there is no bad money, you can choose SSD, funsion-io, and so on. You can also consider SATA based on the selected application environment.

I haven't posted any articles for a long time! Hard Disk Selection 1. If the hard disk has conditions, try to select a SAS disk. If there is no bad money, you can choose SSD, funsion-io, and so on. You can also consider SATA based on the selected application environment.

I haven't posted any articles for a long time!

Hard Disk Selection

1. Try to select a SAS disk if possible on the hard disk. If there is no bad money, you can choose SSD, funsion-io, and so on. You can also consider SATA Disks Based on the selected application environment.

2. For RAID, you can select RAID 10 and RAID 5. We recommend that you use RAID 10 and Hong Kong space. This space is fast and secure. If RAID 5 is used, it is suitable for reading more businesses. However, we recommend that you use RAID10 in exchange for time. RAID5's performance degrades rapidly when a disk encounters a problem!

3. Select a large brand of RAID card as much as possible to reduce various RAID card faults. In addition, the RAID cache should be relatively large!

Memory Selection

Now the memory is the price of cabbage, and now it is generally 16 GB for laptops. No company will be entangled in memory. Theoretically, the larger the memory size of any server, the better, especially the database server, at least 16 GB.

CPU Selection

The 64-bit CPU is not required. The server space, in addition, requires a large cache and multiple CPU cores and multithreading. However, some databases do not have strict requirements on multi-core CPU, such as MongoDB, mongoDB has high memory requirements! MySQL's InnoDB engine has a high CPU utilization rate. Try to use a powerful CPU!

System Selection

1. The system must be a 64-bit system, either linux or unix. linux has many options, including website space, commonly used CentOS Ubuntu runtime. For Unix, you can choose the open-source FreeBSD.

2. kernel selection. We recommend more than 2.6 of the kernel, which is not too high.

3. file System Selection: EXT3/EXT4/XFS, EXT4 and XFS are more suitable for databases. In fact, XFS is more suitable for MySQL database file systems, you can increase the performance by 1.5 times based on EXT3.

Other aspects:

The Network Adapter should be at least M, and M is better. bonding can be used if there are no M.

In short, we recommend that you select a server that is not applicable to different applications, especially data.


The following describes how to select the MongoDB server hardware:

1. Related hardware level

2. The network is at least M Nic, and it is better to have M Nic!

2. Large Memory (memory can be set based on the index size. In principle, the larger the memory, the better .)

2. dual-core high-speed CPU, there is no need to build multiple cores for mongodb instances, because mongodb does not support many CPU cores well, but as a mongos Routing Server, it consumes a lot of CPU resources!

Store Data to isolate frequent io operations.

2. System Level

2. The 64-bit system supports more memory and enables greater data storage.

2. Statistics on the number of reads prohibited from file system updates (modifying the/etc/fstab file)

Mount-o remount, noatime/data

2. If there are large files in the stored data, we recommend that you use a file system like ext4/xfs.

Here we can consider separating the data directory from the log file and the related middleware directory (if any) to isolate IO

Set the maximum open file descriptor

Cat/etc/security/limits. conf

Soft nofile 102400

Hard nofile 102400

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.