ceph 调优 =========================================================================================================================== 一、关于内核调优 /etc/sysctl.conf # Controls IP packet forwarding net.ipv4.ip_forward = 0 # Controls source route verification net.ipv4.conf.default.rp_filter = 1 # Do not accept source routing net.ipv4.conf.default.accept_source_route = 0 # Controls the System Request debugging functionality of the kernel kernel.sysrq = 0 # Controls whether core dumps will append the PID to the core filename. # Useful for debugging multi-threaded applications. kernel.core_uses_pid = 1 # disable TIME_WAIT.. wait .. net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 # Controls the use of TCP syncookies net.ipv4.tcp_syncookies = 0 # Controls the maximum size of a message, in bytes kernel.msgmnb = 65536 # Controls the default maxmimum size of a mesage queue kernel.msgmax = 65536 # Controls the maximum shared segment size, in bytes kernel.shmmax = 68719476736 # Controls the maximum number of shared memory segments, in pages kernel.shmall = 4294967296 二、巨型帧调整 如果交换机支持巨型帧,则较大的MTU大小会有所帮助。我们的测试显示 9000 MTU改善了顺序读/写性能。 三、硬盘配置 Read_ahead是Linux操作系统中使用的文件预取技术。它是一个系统调用,它将文件的内容加载到页面缓存中。随后访问文件时,其内容将从物理内 存而不是从磁盘读取,这要快得多。readahead是Linux系统API,是提示(hint)系统将指定文件的某区域预读进页缓存, 便于接下来对该区域进 行读域进行读取时,不会因缺页(page fault)而阻塞。 echo 512 > /sys/block/sda/queue/read_ahead_kb 四、参考文档 http://tracker.ceph.com/projects/ceph/wiki/Tuning_for_All_Flash_Deployments#Sample-Ceph-Vendor-Solutions kernel.sched_min_granularity_ns = 10000000 kernel.sched_wakeup_granularity_ns = 15000000 fs.aio-max-nr=1048576 kernel.pid_max=4194303 fs.file-max=26234859 vm.zone_reclaim_mode=0 vm.swappiness=1 vm.dirty_ratio = 10 vm.dirty_background_ratio = 5 net.ipv4.tcp_rmem=4096 87380 134217728 net.ipv4.tcp_wmem=4096 65536 134217728 net.core.rmem_max=268435456 net.core.wmem_max=268435456 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_fin_timeout = 10 net.ipv4.tcp_slow_start_after_idle = 0 net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.all.accept_source_route = 0 net.ipv4.tcp_mtu_probing = 1 net.ipv4.tcp_timestamps = 0 net.core.netdev_max_backlog = 50000 net.ipv4.tcp_max_syn_backlog = 30000 net.ipv4.tcp_max_tw_buckets = 2000000 ===========================================================================================================================