1. disable unnecessary servers
# Ntsysv
Retained
Crond
Linux scheduled Task Service
Irqbalance
Used to optimize interrupt allocation to make full use of multiple CPU Cores
Network
Sshd
Syslog
Linux Log System (important)
2. Disable iptables
# Services iptables stop & chkconfig iptables off
Disable SELinux
# Vim/etc/selinux/config
Change selinux = "" in the file to desabled and restart
You can use setenforce 0 to disable SELinux without restarting it, but it becomes invalid after restart.
3. Disable unwanted tty
# Vim/etc/inittab
# Run gettys in standard runlevels
1: 2345: respawn:/sbin/mingetty tty1
2: 2345: respawn:/sbin/mingetty tty2
3: 2345: respawn:/sbin/mingetty tty3
4: 2345: respawn:/sbin/mingetty tty4
5: 2345: respawn:/sbin/mingetty tty5
6: 2345: respawn:/sbin/mingetty tty6
Comment out the last four consoles and execute the init q command.
4. Stop the printing service.
#/Etc/init. d/cups stop
# Chkconfig cups off
5. Disable ipv6
# Vim/etc/modprobe. conf
Add content
Alias net-pf-10 off
Alias ipv6 off
Save and exit
# Echo "IPV6INIT = no">/etc/sysconfig/network-scripts/ifcfg-eth0
# Reboot restart takes effect
6. Adjust the maximum number of opened files in Linux.
# Vim/etc/rc. d/rc. local
Add content
Ulimit-SHn 65565
7. Disable the write disk I/O function of centos.
A linux file has three times by default.
Atime: Access time to this file
Ctime: the time when inode of this file changes.
Mtime: the time when the file was modified.
# Vim/etc/fstab
/Dev/sda2/data ext3 noatime, nodiratime 0 0
8. Optimize the kernel tcp Parameters in Linux to improve system performance.
# Vim/etc/sysctl. config
Add content
Net. ipv4.tcp _ fin_timeout = 30
Net. ipv4.tcp _ keepalive_time = 1200
Net. ipv4.tcp _ syncookise = 1
Net. ipv4.tcp _ tw_reuse = 1
Net. ipv4.tcp _ tw_recycle = 1
Net. ipv4.ip _ local_port_range = 1024 65000
Net. ipv4.tcp _ nax_syn_backlog = 8192
Net. ipv4.tcp _ max_tw_buckets = 5000
# Sysctl-p takes effect