CentOS 6.5針對MongoDB叢集應該調整和優化哪些核心引數?
1.修改 Max processes 或者 files (Max processes,Max open files )
(1)方法一:修改配置檔案 /etc/security/limits.d/90-nproc.conf
使用vi /etc/security/limits.d/90-nproc.conf 命令
* soft nproc 1024
改為:
* soft nproc 65536
然後重啟MongoDB的相關服務即可
(2)方法二:修改配置檔案 /etc/security/limits.conf
使用vi /etc/security/limits.conf 命令
* soft nofile 65536
* hard nofile 65536
* soft nproc 65536
* hard nproc 65536
重啟 mongod 服務
檢視系統限制:ulimit -a
MongoDB推薦配置:
ulimit -f unlimited
ulimit -t unlimited
ulimit -v unlimited
ulimit -n 64000
ulimit -m unlimited
ulimit -u 64000
2.關閉透明大頁功能
禁用透明大頁的方法:
(1).修改檔案/etc/grub.conf,新增一行:transparent_hugepage=never
(2)修改檔案/etc/rc.local檔案,新增:
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
3.修改磁碟排程演算法:
echo deadline > /sys/block/sda/queue/scheduler
4.設定Linux核心引數:
vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 483183820800
kernel.shmall = 117964800
net.ipv4.tcp_max_tw_buckets = 180000
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 262144
net.ipv4.tcp_syn_retries = 3
net.ipv4.tcp_retries2 = 5
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.ip_local_port_range = 1024 65535
vm.zone_reclaim_mode = 0
vm.dirty_writeback_centisecs = 400
vm.dirty_expire_centisecs = 2400
vm.dirty_background_ratio = 5
vm.dirty_ratio = 20
vm.drop_caches = 1
vm.min_free_kbytes = 52428800
vm.vfs_cache_pressure = 200
fs.file-max = 98000
kernel.pid_max = 64000
kernel.threads-max = 64000
(1)方法一:修改配置檔案 /etc/security/limits.d/90-nproc.conf
使用vi /etc/security/limits.d/90-nproc.conf 命令
* soft nproc 1024
改為:
* soft nproc 65536
然後重啟MongoDB的相關服務即可
(2)方法二:修改配置檔案 /etc/security/limits.conf
使用vi /etc/security/limits.conf 命令
* soft nofile 65536
* hard nofile 65536
* soft nproc 65536
* hard nproc 65536
重啟 mongod 服務
檢視系統限制:ulimit -a
MongoDB推薦配置:
ulimit -f unlimited
ulimit -t unlimited
ulimit -v unlimited
ulimit -n 64000
ulimit -m unlimited
ulimit -u 64000
2.關閉透明大頁功能
禁用透明大頁的方法:
(1).修改檔案/etc/grub.conf,新增一行:transparent_hugepage=never
(2)修改檔案/etc/rc.local檔案,新增:
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
3.修改磁碟排程演算法:
echo deadline > /sys/block/sda/queue/scheduler
4.設定Linux核心引數:
vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 483183820800
kernel.shmall = 117964800
net.ipv4.tcp_max_tw_buckets = 180000
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 262144
net.ipv4.tcp_syn_retries = 3
net.ipv4.tcp_retries2 = 5
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.ip_local_port_range = 1024 65535
vm.zone_reclaim_mode = 0
vm.dirty_writeback_centisecs = 400
vm.dirty_expire_centisecs = 2400
vm.dirty_background_ratio = 5
vm.dirty_ratio = 20
vm.drop_caches = 1
vm.min_free_kbytes = 52428800
vm.vfs_cache_pressure = 200
fs.file-max = 98000
kernel.pid_max = 64000
kernel.threads-max = 64000
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2122155/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- swoole優化核心引數調整優化
- 大資料叢集核心引數調優大資料
- mysql之 CentOS系統針對mysql引數優化MySqlCentOS優化
- Linux 核心引數 和 Oracle相關引數調整LinuxOracle
- docker下的spark叢集,調整引數榨乾硬體DockerSpark
- LinuxSysctl調整核心引數Linux
- HP-UX調整核心引數UX
- Linux核心引數以及Oracle引數調整(updated)LinuxOracle
- CentOS6.5 安裝Zookeeper叢集CentOS
- CentOS6.5安裝Twemproxy叢集CentOS
- CentOS6.5 安裝Storm叢集CentOSORM
- CentOS6.5 安裝Kafka叢集CentOSKafka
- CentOS6.5 安裝Spark叢集CentOSSpark
- Linux核心引數調優Linux
- Kafka_2.12-2.5.1叢集搭建與引數調優Kafka
- Linux 核心引數及Oracle相關引數調整LinuxOracle
- SAP ECC6.0記憶體引數調整和調優記憶體
- hadoop叢集搭建配置檔案優化引數Hadoop優化
- MySQL 叢集7.4的搭建流程(CentOS 6.5)MySqlCentOS
- (轉)Linux 核心引數及Oracle相關引數調整LinuxOracle
- Mongodb特定場景效能數十倍提升優化實踐(記一次mongodb核心叢集雪崩故障)MongoDB優化
- Linux系統優化部分核心引數調優中文註釋Linux優化
- MySQL引數調整MySql
- JVM 引數調整對 sortx 的影響JVM
- [最佳化]Oracle 內在索引和引數數的調整(轉)Oracle索引
- HP-UX調整核心引數_kmtune_kctuneUX
- oracle 記憶體引數調整優化相關傾力整理Oracle記憶體優化
- 備份的優化和調整優化
- mongodb副本叢集和分片叢集佈署MongoDB
- Linux核心調優部分引數說明Linux
- Linux 核心引數優化(for oracle)Linux優化Oracle
- Linux核心引數(如kernel.shmmax)及Oracle相關引數調整LinuxHMMOracle
- FreeBSD系統最佳化部分核心引數調整中文註釋(轉)
- CentOS6.5安裝MongoDBCentOSMongoDB
- AIX fsfastpath 引數調整AIAST
- solaris10中安裝oracle核心引數的調整Oracle
- CentOS6.5安裝HBase叢集及多HMaster配置CentOSAST
- 調優引數