About linux Performance Optimization: Remove unnecessary overhead
Source: Internet
Author: User
Talking about linux performance optimization 8: Removing unnecessary overhead talking about linux performance optimization 7: Cropping System Services http://www.2cto.com/os/201307/228390.html About linux performance tuning 7: I mentioned how to disable some system services in the cropping system service, but it still exists... talking about linux performance optimization 8: Removing unnecessary overhead talking about linux performance optimization 7: Cropping System Services http://www.2cto.com/os/201307/228390.html In "talking about linux performance tuning 7: cropping system services", I talked about how to disable some system services. However, there are still some waste of resources that cannot be easily discovered by administrators, in this section, I will talk about the following: 1. when we use ssh to log on to the server, we will find that the wait time is long, up to 2 minutes. The reason is that the ssh server will automatically resolve the client host name by default, but it is useless to resolve the host name to the client, it is a waste of time for the client and unnecessary resources for the server. Solution: vim/etc/ssh/sshd_config UseDNS no/etc/init. d/sshd restart is similar to: apache (HostnameLookups Off) option 2. update the file database/etc/cron by using linux to schedule tasks. daily/makewhatis. cron makewhatis. cron is used to create a whatis database to serve whatis. Search for specific command name whatis-search for specific command abstract whatis keyWord in the whatis resource library... description: The whatis Resource Library contains a brief description of all system directives, while the whatis command will search for the matching keyword orders in this resource library, the result is displayed in standard output. The whatis resource library is used to consume resources created by makewhatis. /Etc/cron. daily/mlocate. cron mlocate. cron is used to update the mlocate database. it is used to serve the locate and consumes resources and can be stopped. 3. disable unnecessary logs: logs should be the most resource-consuming for major services! In/etc/rsyslog. conf configuration, or make the logs concentrated on the log server for Analysis 4. close useless tty (huh, this online saw, did not notice before) the default system will enable 6 TTY, is ctrl + alt + F1--F6 modify/etc/inittab, find # 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 add # comments to the front of the desired tty, and then use init q Effective immediately 5. disable disk I/O writing. a Linux file has three default times: atime: access time to this file ctime: inode time of this file mtime: the modification time of this file does not need to record the file access time for disks with many images and static webpages, reducing unnecessary system resources. by using two parameters, noatime can be implemented, nodiratime edit/etc/fstab/dev/sdb1/mnt ext3 noatime, nodiratime 0 0 6. resource-consuming operations: in the system: find/-name dstfilename in the database: select * from tablename; of course, this is a special case, but be sure to pay attention to it! 7. close the image (close the image to close a series of additional operations) go to running level 3 #################################### ################################## PID USER PR NI VIRT RES SHR S % CPU % mem time + COMMAND 2161 root 20 0 171 m 64 m 9892 S 1.0 3.3. 69 Xorg ###################################### ###############################
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.