Operations 21 min read

Mastering System Performance Tuning: A Practical 5W+1H Guide

This article provides a comprehensive, easy‑to‑understand overview of performance tuning, covering what, why, when, where, who, and how to optimize hardware, operating systems, and applications, with practical examples, metrics, tools, and step‑by‑step procedures for both pre‑deployment and post‑deployment optimization.

Efficient Ops
Efficient Ops
Efficient Ops
Mastering System Performance Tuning: A Practical 5W+1H Guide

1. Author Overview

In this blog post I avoid abstract concepts and aim to explain performance tuning in the simplest language possible.

Because my knowledge is limited, feel free to point out any mistakes or unclear parts. To make the topic of performance tuning more understandable, I will use the 5W+1H method.

2. What is Performance Tuning? (what)

Before defining performance tuning, let’s briefly discuss computer architecture.

As shown in the diagram, it consists of three layers: hardware, operating system, and application. Performance tuning involves adjusting these layers.

Hardware includes CPU, memory, disk, network card, etc.; the operating system includes processes, virtual memory, file system, network, etc.; applications include Apache, MySQL, Nginx, Memcached, and others.

Performance tuning means having a deep understanding of computer hardware, operating system, and applications, and adjusting the relationship among them to maximize overall system performance while continuously meeting business needs.

That’s what we call performance tuning, got it?

3. Why is Performance Tuning Needed? (why)

There are two main reasons: to achieve better system performance and to meet growing business demands. We illustrate this from three aspects:

Hardware selection (choose servers based on application type)

Operating system distribution (choose the right distro)

Application (e.g., Nginx, MySQL)

3.1 Hardware Selection

Whether you rent or buy servers, you must decide on the hardware configuration.

Generally, hardware is chosen based on the type of application because a single configuration cannot satisfy all needs. Below are common application types and recommended configurations:

Load balancer: low performance requirements; recommended CPU E5620×1, 8 GB RAM, 500 GB RAID5 disk.

Web server: serves static pages; recommended CPU E5620×1, 16 GB RAM, 500 GB RAID5 disk.

Application server: heavy workload; recommended CPU E5620×2, 32 GB RAM, 500 GB RAID10 disk.

Cache server (Varnish/Memcached): high memory; recommended CPU E5620×1, 32 GB RAM, 500 GB RAID10 disk.

Database server: high CPU, memory, disk demands; recommended CPU E5620×2, 64 GB RAM, SSD 500 GB RAID10.

Backup server: large storage needed; recommended CPU E5620×1, 4 GB RAM, 2 TB RAID5.

Monitoring server: ordinary PC is enough; recommended CPU E5620×1, 4 GB RAM, 500 GB RAID5.

Other servers: analyze based on specific needs.

Choosing appropriate hardware based on the specific application is essential for cost efficiency and resource utilization.

3.2 Operating System

Reference book: "Linux Performance Tuning" by Fernando Apesteguia.

Most distributions aim for broad compatibility, which leads to conservative default settings. Therefore, tuning the OS can unlock higher performance, such as enabling advanced disk features.

When selecting a distribution, CentOS/RedHat are common for enterprise applications; avoid the newest releases due to potential bugs.

3.3 Application

We will briefly look at Apache MPM configurations.

prefork model:

Apache starts with 8 processes, minimum 5, maximum 20, each handling up to 256 requests, total max 4000 requests.

worker model:

Worker starts with 2 processes, each with 150 requests, thread pool 25‑75 threads.

Default Apache settings are conservative; high‑performance sites need further tuning of compile options and configuration.

4. When is Performance Tuning Needed? (when)

Two phases:

Pre‑deployment (basic optimization)

Post‑deployment (continuous optimization)

Pre‑deployment includes hardware selection, OS installation, and environment setup. Post‑deployment requires performance monitoring and ongoing optimization.

5. Where is Performance Tuning Needed? (where)

The three major areas are:

Hardware (CPU, memory, disk, NIC)

Operating system (processes, file system, kernel, etc.)

Application (Nginx, MySQL, etc.)

6. Who Performs Performance Tuning? (who)

While operations engineers are often the first to think of performance tuning, it is a team effort involving development, operations, QA, and monitoring.

A typical e‑commerce project workflow includes operations, product, development, QA, and monitoring teams, all of which may need to address performance issues.

7. How to Perform Performance Tuning? (how)

Steps:

Performance metrics → Define measurement standards Performance testing → Validate metrics Performance analysis → Identify bottlenecks Performance tuning → Resolve issues Performance monitoring → Verify tuning effect

Performance Metrics

Key metrics: throughput (requests per unit time), concurrency (simultaneous users), response time (request‑response interval).

Performance Testing

Use tools to simulate user behavior and measure the three metrics.

Performance Analysis

Monitor hardware and software to locate bottlenecks using tools such as vmstat, sar, iostat, free, netstat, mysqlreport, mysqlsla, etc.

Hardware: CPU, memory, disk I/O, network.

OS: processes, file system, swap, kernel parameters.

Application (MySQL): query throughput, connection utilization, cache hit rates, index statistics, concurrency, etc.

Performance Tuning

Define clear goals (e.g., improve performance by 10‑20%). Adjust one resource at a time, change minimal parameters, and use multiple tools for verification.

After each tuning step, validate results with tools like ApacheBench (ab).

Performance Monitoring

Monitor server metrics (CPU usage, load, memory, I/O, network, disk space, processes) and service metrics (MySQL query throughput, connection rates, cache usage, index hit rates, concurrency).

8. Summary

This blog provides an overview of performance tuning concepts and practical steps, showing that performance optimization is approachable when you follow a systematic method.

Hope you find it useful.

Platform authorized repost Source: Ma Ge Linux Operations Author: Chen Mingqian Original link: http://mp.weixin.qq.com/s?__biz=MzA3OTgyMDcwNg==∣=402960938&idx=1&sn=91af63aec13ee4b0233559791ba74c82&scene=1&srcid=0324u7rHoR1mo8wLXGyuza5y#wechat_redirect
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

OperationsSystem optimizationHardwaresoftware
Efficient Ops
Written by

Efficient Ops

This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.