Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The basic optimization mode of Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "the basic optimization method of Linux". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and go deep into it slowly to study and learn "the basic optimization method of Linux" together.

It boils down to:

One clear, one fine, one increase, two excellent, four set, seven others

A clear: regularly clean logs/var/spool/clientsqueue

One essence: streamline boot service

Increase: Increase file descriptor

Two excellent: linux kernel parameter optimization, yum source optimization

Four settings: set the character set of the system, set the ssh login limit, set the boot prompt information and kernel information, and set the block size.

Seven others: file system optimization, sync data synchronous writing to disk, do not update timestamp, lock system critical files, time synchronization, sudo centralized management, turn off firewall and selinux

1. sync data synchronous writing to disk

async sync

2. Do not update timestamp

noatime

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

Disabled for less data-critical services

4. Set the block size, usually 4K

mkfs -t ext3 -b 4096 /dev/sda1

5. Lock down key files of the system

chattr +/-i /etc/passwd

6.Linux kernel tuning (parameter tuning)

…………

7. Set boot prompt information and system information

/etc/motd /etc/issue

8. Set up yum sources for the system and upgrade

/etc/yum.repos.d/

9. Time synchronization; between 50-100 servers can be set up time synchronization server ntpserver

/usr/sbin/ntpdate time.windows.com

10. Set the character set of the system

/etc/sysconfig/i18n

11. Use sudo tools to centralize user management

visudo

12. Limit ssh login settings, such as changing ports, prohibiting root logins, prohibiting password-less logins, and so on.

/etc/ssh/sshd.conf

13. Enlarge file descriptor

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

14. The requested URL/var/spool/clientsqueak/was not found on this server.

Write scripts, put them in timed tasks, and clean them up regularly.

15. Streamlined boot service

a) setup, check the startup service

b) Terminal input ntsysv

c) Scripting

cat /server/scripts/chkinfo.sh

#setup sys start server or process

for i in `chkconfig --list |grep 3:on|awk '{print $1}'`;do chkconfig --level 3 $i off;done

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

Thank you for reading, the above is the "basic optimization of Linux" content, after the study of this article, I believe that everyone has a deeper understanding of the basic optimization of Linux, the specific use of the situation also needs to be verified. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report