20 Proven Linux Server Performance Tweaks Every Sysadmin Should Know
Learn how to boost Linux server efficiency with 20 practical tips—from kernel elevator adjustments and disabling unnecessary daemons to optimizing TCP, choosing the right filesystem, and leveraging performance tools like top, vmstat, iostat, free, and sar—ensuring faster, more secure, and cost-effective operations.
1. Adjust Linux kernel elevator algorithm for disk I/O
After selecting a filesystem, tune the kernel's elevator (I/O scheduler) to balance low latency and throughput, improving how read/write requests are organized on the disk.
2. Disable unnecessary daemons
Many services run by default but provide no benefit and consume memory, CPU, and increase attack surface. Disable them to speed up boot, free memory, and improve security.
Apmd – Advanced Power Management daemon
Nfslock – NFS file locking
Isdn – ISDN modem support
Autofs – Automatic mounting of filesystems (e.g., CD-ROM)
Sendmail – Mail Transfer Agent
Xfs – X Window font server
3. Turn off the GUI
Linux servers typically do not need a graphical interface; set the init level to 3 (command‑line) instead of 5, and start X only when required.
4. Clean unnecessary modules or features
Review server packages (e.g., Apache modules) and disable any that are not required, freeing memory and improving performance.
5. Disable control panels
Control panels such as cPanel, Plesk, Webmin, and phpMyAdmin consume ~120 MB of RAM; keep them disabled unless truly needed.
6. Improve Exim server performance
Use a DNS cache daemon (e.g., djbdns) to reduce DNS lookup latency and bandwidth usage, enhancing mail throughput.
7. Use AES256 to strengthen GPG file encryption
When encrypting backups or sensitive data, specify AES256 in GPG; the 256‑bit key is widely trusted for high security.
8. Remote backup service security
Prefer backup solutions that transfer data over SSH (scp or rsync) to prevent unauthorized access or deletion of backup files.
9. Update default kernel parameter settings
For database servers, increase shared memory and message queue limits. Example values:
kernel.shmmax=268435456 (32‑bit) kernel.shmmax=1073741824 (64‑bit) kernel.msgmni=1024 fs.file-max=8192 kernel.sem="250 32000 32 1024"
10. Optimize TCP
Increase the TCP window size on high‑latency, high‑bandwidth links to allow more data to be sent before acknowledgments are received.
11. Choose the correct filesystem
Replace ext3 with ext4 for larger storage limits, journaling, faster writes, and reduced mount‑time checks.
12. Use the noatime mount option
Adding noatime to /etc/fstab prevents access‑time updates, improving performance especially on external storage.
13. Adjust Linux file descriptor limits
Default per‑process limit is 1024 descriptors; increase it with ulimit -n for high‑concurrency servers (e.g., Zeus).
14. Properly configure MySQL
Allocate appropriate cache sizes; increase them if the server stalls under load, or decrease them to free memory.
15. Properly configure Apache
Monitor memory usage and tune StartServers and MinSpareServers to save 30‑40% memory.
16. Analyze Linux server performance
Identify bottlenecks such as insufficient RAM, slow disks, or high CPU load, and address them accordingly.
17. Learn five essential Linux performance commands
top – real‑time system summary
vmstat – CPU, I/O, and memory snapshot $ vmstat 10 iostat – CPU, device, and NFS utilization
free – memory and swap statistics $ free -s 5 sar – collects and reports long‑term performance data
18. Move log files to memory
Use ramlog to store logs in RAM and write them to disk only on shutdown, extending SSD lifespan and reducing disk activity.
19. Pack before writing
Allocate a fixed‑size RAM area for logs; on laptops with SSDs, reserve 50‑80 MB to reduce write cycles.
20. General tuning tips
Prefer static content over dynamic generation, and use FastCGI or mod_perl instead of CGI for faster API handling.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
