Discussion on linux performance optimization 21: analysis of the mail system

Source: Internet
Author: User
Talking about linux performance optimization 21: Analyzing the mail system talking about linux Performance Optimization 20: Module Management and Kernel Compilation http: www2ctocomos201308235094html mail application service can allow latency, not like web, databases have high real-time requirements and fast response. 21 of linux Performance Optimization: analysis of the mail system; 20 of linux performance optimization; Module Management and Kernel Compilation http://www.2cto.com/os/201308/235094.html The Mail application service allows latency, which is not as demanding as the web and database in real time and responds quickly. This kind of application is particularly Designed. I give the postfix process information: # service type private unpriv chroot wakeup maxproc command + args # (yes) (never) (100) #===================================================== ======================================== smtp inet n-n --smtpd #628 inet n---qmqpdpickup fifo n-n 60 1 pickupcleanup unix n-0 cleanupqmgr fifo n-n 300 1 qmgr # qmgr fifo n-n 300 1 oqmgrtlsmgr unix--n 1000? 1 tlsmgrrewrite unix--n--trivial-rewritebounce unix--n-0 bouncedefer unix--n-0 bouncetrace unix--n-0 bounceverify unix--n-1 verifyflush unix n-n 1000? 0 flushproxymap unix--n--proxymapproxywrite unix--n-1 proxymapsmtp unix--n--smtp it can be seen that the pickup process will be awakened periodically to check newly received emails, then handed to cleanup for processing, the information administrator can manually adjust, qmgr queue manager is similar to the establishment of the mail server administrator should know, generally is to create their own virtual domain in the server, like XXXXXX@example.com, then it corresponds to a home directory of a local common user. the different files in the directory named XXXXXX are the letters of XXXXXX users, and many small files (generally use maildir to store letters, the mailbox has a file lock problem.) here we can use plain text. Note that in linux, if the mail server uses ext3 or ext4 file systems, inode may be exhausted, for details, refer to the "file system formatting considerations" I have previously written. of course, if you use a cluster file system such as gfs, you do not have to consider such a disk: one of the biggest problems in the mail system is that not many large files are read and written, but many small files are read and written. These read and write requests come from multiple processes or threads at the same time: assume that a mail is received by the server postfix, which is first detected and read by pickup, and then handed over to cleanup. you may call rewrite to rewrite the address, and finally enter the incoming queue, for application services with many small files processed by smtp, we recommend using the deadline algorithm for I/O scheduling memory: for postfix, each of its processes will not consume too much memory, what we expect is that a large amount of memory is automatically used in the disk cache to increase the disk I/O rate. of course, we don't need to perform this operation. linux has done it for us! Linux virtual memory management uses all idle memory space as hard disk cache by default. Therefore, in a productive Linux system with several GB of memory, we often see that the available memory is only 20 MB. Processor: for the mail system, whether it is smtp or imap, the CPU usage is not very large. However, for the mail system, the network subsystem is frequently used, however, the bottleneck of the mail system is the disk throughput rather than the network throughput. such applications do not require interaction, and latency is allowed! Of course, it is necessary to adjust some common network kernel parameters! These are just a simple analysis at the system level. for application services: email servers, Web servers, and database servers, analysis of the service itself is also very important. for service work methods and resource occupation, you can also use security protection and other aspects to consider tuning, and the effect may be better!
Related Article

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.