Basic Optimization after centos 5.6 linux is installed

Source: Internet
Author: User

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
 

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.