Basic Optimizations for Linux

Source: Internet
Author: User

It boils down to a formula:

one clear, one fine, one increase, two excellent, four set, seven other

a clear: timed cleanup Log/var/spool/clientsqueue

One fine: thin boot start service

One increase: increase the file descriptor

two excellent: optimization of Linux kernel parameters, yum source optimization

Four set: set the system's character set, set SSH login restrictions, Set the boot information and kernel information, set the size of the block

Seven other: file system optimization, sync data synchronously writes to disk, does not update timestamps, lock System Key files, time synchronization, sudo centralized management, shutting down firewalls and SELinux

1.sync data synchronously written to disk

Async Sync

2. Do not update timestamps

Noatime

3. File system optimization: Prohibit ext3, ext4 log function

business that is less important to data can be disabled

4. Set the block size, generally 4K

Mkfs-t Ext3-b 4096/dev/sda1

5. Lock the system's key files

Chattr +/-i/etc/passwd

kernel tuning for 6.linux systems (parameter tuning )

............

7. Set the boot information, as well as system information

/etc/motd/etc/issue

8. Build the system's Yum source and optimize it (upgrade)

/etc/yum.repos.d/

9. Time synchronization; server can build time synchronization server between 50-100 units NtpServer

/usr/sbin/ntpdate time.windows.com

10. Set the system's character set

/etc/sysconfig/i18n

11. Use the Sudo tool to centralize user management

Visudo

12. Restrict SSH login settings, such as change port, prohibit root login, prohibit login without password, etc.

/etc/ssh/sshd.conf

13. Increase the file descriptor

Echo ' *-nofile 65535 ' >>/etc/security/limits.conf

14. Regular cleaning/var/spool/clientsqueue/

Write a script that is scheduled to be cleaned at timed tasks

15. Streamlined Boot Service

a) Setup, tick the boot-up service

b) Terminal input NTSYSV

c) Script writing

cat/server/scripts/chkinfo.sh

#setup SYS start server or process

For i in ' chkconfig--list |grep 3:on|awk ' {print '} ';d o chkconfig--level 3 $i off;done

/bin/sh/server/scripts/chkinfo.sh

The above detailed optimization can be consulted: the CentOS production server environment minimizes post-installation security and optimal configuration

Basic Optimizations for Linux

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.