echo "192.168.14.141 mysql1" >> /etc/hosts echo "export LANG=en_US" >> ~/.bash_profile 资源限制参数 cat >> /etc/security/limits.conf <<EOF * soft nproc 65535 * hard nproc 65535 * soft nofile 65535 * soft nofile 65535 * soft stack 65535 * soft stack 65535 EOF echo "* - nproc 65535" > /etc/security/limits.d/90-nproc.conf 安全策略 selinux setenforce 0 getenforce echo "SELINUX=disabled" > /etc/selinux/config echo "SELINUXTYPE=targeted" >> /etc/selinux/config cat /etc/selinux/config setenforce 0 关闭防火墙 service iptables stop chkconfig --level 2345 iptables off service firewalld stop Redirecting to /bin/systemctl stop firewalld.service chkconfig --level 2345 firewalld off Note: Forwarding request to 'systemctl disable firewalld.service'. systemctl disable firewalld.service systemctl list-dependencies firewalld echo "session required pam_limits.so" >> /etc/pam.d/login vim /etc/default/grub GRUB_CMDLINE_LINUX="rhgb quiet numa=off" grub2-mkconfig -o /etc/grub2.cfg 重新生成/etc/grub2.cfg grub2-mkconfig -o /etc/grub2-efi.cfg reboot dmesg|grep -i numa dmesg|grep -i numa [ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.10.0-1160.81.1.el7.x86_64 root=UUID=839b281c-1683-453e-b28e-ae188dbc4b8e ro rhgb quiet numa=off [ 0.000000] NUMA turned off [ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-1160.81.1.el7.x86_64 root=UUID=839b281c-1683-453e-b28e-ae188dbc4b8e ro rhgb quiet numa=off cat /proc/cmdline BOOT_IMAGE=/vmlinuz-3.10.0-1160.81.1.el7.x86_64 root=UUID=839b281c-1683-453e-b28e-ae188dbc4b8e ro rhgb quiet numa=off numa 参考 https://blog.csdn.net/llh931886/article/details/114361256 io调度算法和io优化操作 cat /sys/block/sd*/queue/scheduler noop [deadline] cfq noop [deadline] cfq noop [deadline] cfq [root@mysql1 ~]# echo 'deadline' > /sys/block/sda/queue/scheduler You have new mail in /var/spool/mail/root [root@mysql1 ~]# cat /sys/block/sd*/queue/scheduler noop [deadline] cfq noop [deadline] cfq noop [deadline] cfq [root@mysql1 ~]# echo 'noop' > /sys/block/sda/queue/scheduler [root@mysql1 ~]# cat /sys/block/sd*/queue/scheduler [noop] deadline cfq noop [deadline] cfq noop [deadline] cfq --sas/stat echo "deadline" > /sys/block/sda/queue/scheduler --ssd echo 'NOOP' > /sys/block/sda/queue/scheduler 减少预读 echo '16' > /sys/block/sda/queue/read_ahead_k echo '16' > /sys/block/sdb/queue/read_ahead_k echo '16' > /sys/block/sdc/queue/read_ahead_k [root@mysql1 ~]# cat /sys/block/sda/queue/nr_requests 128 增大队列 echo '512' > /sys/block/sda/queue/nr_requests echo '512' > /sys/block/sdb/queue/nr_requests echo '512' > /sys/block/sdc/queue/nr_requests vim /etc/rc.local echo '16' > /sys/block/sda/queue/read_ahead_k echo '16' > /sys/block/sdb/queue/read_ahead_k echo '16' > /sys/block/sdc/queue/read_ahead_k echo '512' > /sys/block/sda/queue/nr_requests echo '512' > /sys/block/sdb/queue/nr_requests echo '512' > /sys/block/sdc/queue/nr_requests chmod +x /etc/rc.local vim /etc/sysctl.conf vm.swappiness=10 # 当物理内存剩余10%的时候,使用交换分区 vm.min_free_kbytes=51200 sysctl -p
标签:sys,centos,echo,queue,etc,deadline,初始,os,block From: https://www.cnblogs.com/lzjloveit/p/17373935.html