Operations 13 min read

Mastering Performance Testing: Key Metrics, Threading, and OS Bottleneck Detection

This article explains core performance‑testing concepts such as TPS, response time, think time, and threading, then details how to identify CPU, memory, and disk bottlenecks on Linux using tools like top, vmstat, iostat, and pidstat, linking system resources to overall application performance.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Mastering Performance Testing: Key Metrics, Threading, and OS Bottleneck Detection

Performance Testing Basics

1. Understanding TPS TPS (Transactions Per Second) measures the number of transactions completed per unit time. It reflects system throughput and is linked to the number of virtual users. Throughput grows linearly with users until a bottleneck appears.

2. Understanding Threads A thread is a lightweight process within a program. Benefits include low creation cost, fast context switching, shared memory, and parallel execution. In Java, thread states can be inspected with jstack or jprofiler.

3. Understanding Response Time Response time is the duration to complete a business transaction, including network latency and server processing. It is recorded by performance tools as Transaction Response Time.

4. Relationship among Response Time, TPS, and Users Before a bottleneck, response time stays stable while TPS increases linearly with concurrent users. After a bottleneck, response time rises and TPS plateaus or drops.

5. Think Time and Pacing in LoadRunner Think time simulates user think pauses between actions; pacing sets the interval between iterations, both helping to model realistic user behavior.

Operating System Monitoring

1. Identifying CPU Bottlenecks Monitor CPU utilization (user, system, idle) with tools like top, uptime, and vmstat. High user/system percentages and long run queues indicate overload. Excessive context switches also degrade performance.

2. Identifying Memory Bottlenecks Check used, free, shared, and cached memory. Monitor swap activity (si, so) and page faults (minflt/s, majflt/s) with vmstat, pidstat, or sar. Frequent page faults and growing swap usage signal memory pressure.

3. Identifying Disk Bottlenecks Use iostat to watch %util and iowait; values near 100% indicate saturation. Monitor disk I/O with pidstat -d and ensure virtual memory is not the limiting factor.

4. CPU‑Memory‑Disk Interdependence Processes reside in memory, execute on CPU, and read/write data on disk. Memory shortage triggers swapping, which generates disk I/O and consumes CPU time, creating a cascade of bottlenecks.

5. Paging In/Out Linux swaps rarely used pages to disk (page‑out) and brings needed pages back (page‑in). Excessive paging leads to thrashing and severe performance loss; vmstat -s reports page‑in/out counts.

6. Context Switches Each CPU core runs one thread at a time; Linux preemptively switches threads, storing and restoring state. High context‑switch rates increase kernel CPU usage and slow applications.

7. Disk I/O Characteristics Disk I/O is inherently slow; insufficient memory forces swapping, which adds to I/O load. CPU‑bound workloads suffer when iowait becomes large.

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.

Memory MonitoringResponse TimeCPU BottleneckTPSperformance-testinglinux-ops
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

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.