BKJIA: Linux is an open-source operating system that supports various hardware platforms. Linux servers are well-known all over the world. The main difference between Linux and Windows is that, by default, a Linux server does not provide a GUI (graphical user interface) but a command line interface. The main purpose of the GUI is to efficiently process non-interactive processes. The response time is not that important. On the contrary, it is critical to be able to process high loads for a long time. The Linux high-availability server cluster solution allows IT system administrators to easily cope with many common hardware and software faults, and allows multiple computers to work together to ensure the normal operation of key services, the system administrator can perform maintenance and upgrade without interrupting services.
Linux servers have various purposes, such as Web servers or internal branch servers, CMS or CRS servers, file servers (for Windows and/or Linux users), and VoIP telephone servers, email or Domain Name Server, database server, infrastructure node in cloud computing configuration, etc.
Linux features are rich, powerful, and flexible. You can use it to complete various tasks. In this article, we will discuss some techniques to improve the performance of Linux servers.
1. Adjust the Linux kernel elevator Algorithm for disk I/O
After selecting a file system, some kernel and mount options may affect its performance. One of the kernel settings is the elevator algorithm. by adjusting the elevator algorithm, the system can balance low latency requirements, collect enough data to effectively organize read and write requests to the disk.
2. disable unnecessary daemon to save memory and CPU resources.
Many daemon or services are running on each server. The irony is that many of them are not usually necessary and do not play a role, however, it consumes valuable memory and CPU time. In addition, they may put servers in a dangerous situation. running one service is equivalent to opening a long drive-in door to multiple hackers. Therefore, you should remove them from the server, the biggest advantage of disabling them is that it can speed up the startup time and release the memory. In addition, you can reduce the number of processes that the CPU needs to process. Another advantage of disabling them is to enhance the security of the server, because the fewer daemon processes, the fewer vulnerabilities that can be attacked and exploited.
The following are some Linux daemon that should be disabled. By default, they all run automatically:
| Serial number |
Daemon |
Description |
| 1 |
Apmd |
Advanced Power Management daemon |
| 2 |
Nfslock |
Used to lock NFS files |
| 3 |
Isdn |
Supported by ISDN Moderm |
| 4 |
Autofs |
Automatic File System mounting in the background (such as automatic Mount CD-ROM) |
| 5 |
Sendmail |
Email transmission proxy |
| 6 |
Xfs |
X Window Font Server |
3. Turn off the GUI
Generally, the Linux server does not require a GUI, and all management tasks can be completed under the command line. Therefore, it is best to turn off the GUI and redirect the X Display or display it through a Web browser interface. To Disable GUI, "init level (startup level)" should be set to 3 (command line logon), instead of 5 (graphical logon). If you need GUI, you can run startx at any time to enter the graphic user interface.
4. Clear unnecessary modules or functions
There are too many enabled functions or modules in the server software package that are not actually needed (for example, many functional modules in Apache). Check the Apache configuration file carefully, determine whether the FrontPage support or other additional modules are actually used. If you do not need it, do not hesitate to disable it from the server. This will help increase the system memory usage, free up more resources for the software that is really needed to make them run faster.
5. Disable Control Panel
In Linux, there are many popular control panels, such as Cpanel, Plesk, Webmin, and phpMyAdmin. I believe every beginner Linux user will like these control panels very much. However, disabling these software packages can free up to MB of memory, so I strongly recommend Disabling these control panels unless they are actually needed and they can be used through PHP scripts (although somewhat insecure ), or the command line command is enabled. After this is done, the memory usage can be reduced by about 30-40%.
6. improve Linux Exim server performance
There are many ways to improve the server's Exim performance, one of which is to use the DNS Cache daemon, which can reduce the bandwidth and CPU time required to parse DNS records, DNS Cache eliminates the need to search for DNS records from the root node each time to improve network performance. Djbdns is a very powerful DNS server with the DNS Cache function, djbdns is safer and better performing than the bind dns server. It can be obtained directly by downloading http://cr.yp.to/or using the software package provided by red Hat.
7. Use AES256 to enhance the security of gpg file encryption
To improve the security of backup files or sensitive information, many Linux system administrators use gpg for encryption. When using gpg, it is best to specify the gpg to use the AES256 encryption algorithm, and AES256 to use the 256-bit key, it is an open encryption algorithm, which is used by the National Security Agency (NSA) to protect top secret information. Nothing is safer than it.
8. Remote Backup Service Security
Security is the most important factor in choosing the remote backup service. Most system administrators are afraid of two things: (hackers) can delete Backup files and cannot recover the system from backup.
To ensure the security of backup file 100%, the backup service company provides a remote backup server and uses scp script or RSYNC to transmit data through SSH. In this way, no one can directly access and access the remote system. Therefore, no one can delete data from the backup service. When selecting a remote backup service provider, it is best to learn about its service robustness from multiple aspects. If you can, you can test it yourself.
9. Update the default Kernel Parameter settings
To smoothly and successfully run enterprise applications, such as database servers, you may need to update some default Kernel Parameter settings. For example, the msgmni parameter of the 2.4.x series kernel message queue has a default value (for example, shared Memory, or shmmax is only 33554432 bytes by default on the Red Hat system), it only allows a limited number of concurrent connections to the database, the following provides some suggestions for better running of database servers (from the IBM DB2 support website ):
Kernel. shmmax = 268435456 (32-bit) kernel. shmmax = 1073741824 (64-bit) kernel. msgmni = 1024fs. file-max = 8192kernel. sem = "250 32000 32 1024 ″
10. Optimize TCP
Optimizing the TCP protocol helps improve network throughput. The larger the bandwidth used for cross-Wan communication, the longer the delay time. We recommend that you use a larger TCP Linux size to increase the data transmission rate, the size of TCP Linux determines how much data can be sent to the receiving host when the sending host does not receive the data transmission confirmation.