Skip to content

Commit 0d9f654

Browse files
Merge pull request #3431 from anupras-mohapatra-arm/servers-and-cloud-computing
Tuning MySQL LP editorial review
2 parents 2faa8dd + 874785d commit 0d9f654

4 files changed

Lines changed: 111 additions & 33 deletions

File tree

content/learning-paths/servers-and-cloud-computing/mysql_tune/_index.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,57 @@ prerequisites:
1515
- On-prem or cloud [installation of MySQL](https://dev.mysql.com/doc/refman/en/)
1616
- A repeatable MySQL workload or benchmark that you can run before and after tuning
1717

18+
# START generated_summary_faq
19+
generated_summary_faq:
20+
template_version: summary-faq-v3
21+
generated_at: '2026-06-26T21:28:59Z'
22+
generator: ai
23+
ai_assisted: true
24+
ai_review_required: true
25+
model: gpt-5
26+
prompt_template: summary-faq-v3
27+
source_hash: 19acf30951401ec15201ee8e387eb59f9248f627664bc693cf05928233bf2b6f
28+
summary_generated_at: '2026-06-26T21:28:59Z'
29+
summary_source_hash: 19acf30951401ec15201ee8e387eb59f9248f627664bc693cf05928233bf2b6f
30+
faq_generated_at: '2026-06-26T21:28:59Z'
31+
faq_source_hash: 19acf30951401ec15201ee8e387eb59f9248f627664bc693cf05928233bf2b6f
32+
summary: >-
33+
You'll learn how to use a measurement-driven approach to tune MySQL performance on Arm-based platforms.
34+
You'll explore system factors — storage technology and file systems,
35+
disk scheduling, kernel memory management, compiler, and library versions — that you can adjust. In addition, you'll learn about optimizable MySQL parameters related to connection
36+
handling, memory usage, disk flush behavior, and concurrency, and learn how to enable and
37+
size huge pages based on the InnoDB buffer pool. By the end, you'll know what parameters to update for running controlled experiments,
38+
and be able to make persistent configuration choices aligned with your workload.
39+
faqs:
40+
- question: How do I know a MySQL tuning change actually helped?
41+
answer: >-
42+
Run the same repeatable workload before and after the change and compare throughput, latency,
43+
and profiles. Change one parameter at a time or use a designed experiment so results are
44+
attributable to specific settings.
45+
- question: Should I set MySQL parameters in an option file or on the `mysqld` command line?
46+
answer: >-
47+
Use an option file for persistent tuning so changes are reviewable, version controlled,
48+
and applied on restart. The examples in the Learning Path target the `[mysqld]` group. Command-line flags are suitable
49+
for temporary tests.
50+
- question: Which storage option should I use when testing performance?
51+
answer: >-
52+
In general, locally attached SSD storage performs best, but network-based storage can also
53+
perform well. Test the storage technologies and file systems you have, and review disk scheduling
54+
behavior with your workload.
55+
- question: When should I look at kernel, compiler, or library choices instead of MySQL settings?
56+
answer: >-
57+
Evaluate them before or alongside MySQL tuning because operating system settings, kernel
58+
memory management, compiler choices, and library versions can affect throughput and latency.
59+
Treat them as part of the same performance experiment set.
60+
- question: How should I size huge pages for MySQL?
61+
answer: >-
62+
Enable huge pages for MySQL and size them based on the InnoDB buffer pool. This aligns page
63+
allocation with the primary memory consumer in typical MySQL deployments.
64+
# END generated_summary_faq
65+
1866
author: Julio Suarez
1967

20-
generate_summary_faq: true
68+
generate_summary_faq: false
2169
rerun_summary: false
2270
rerun_faqs: false
2371

content/learning-paths/servers-and-cloud-computing/mysql_tune/before_and_after.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Measure MySQL tuning impact"
2+
title: Measure the impact of tuning MySQL
33
description: Learn how to approach MySQL performance tuning as a measurement-driven process and compare baseline results with tuned results.
44
weight: 2
55
layout: "learningpathall"
@@ -15,7 +15,7 @@ Whatever method you use, keep the measurements repeatable. Record the system con
1515

1616
## Why tune MySQL
1717

18-
MySQL performance can be limited by memory usage, disk I/O, connection handling, concurrency, or synchronization overhead. Tuning helps you use the available compute, memory, and storage resources more efficiently.
18+
MySQL performance can be limited by memory usage, disk I/O, connection handling, concurrency, or synchronization overhead. By tuning MySQL, you can use the available compute, memory, and storage resources more efficiently.
1919

2020
Improved performance can give you higher throughput, lower latency, or better cost efficiency. A tuned configuration can increase capacity on the same system, or help you meet the same performance target with fewer compute resources.
2121

@@ -30,3 +30,9 @@ This benchmark result is an example, not a guaranteed improvement for every work
3030
{{% notice Note %}}
3131
Links to MySQL documentation in this Learning Path point to the latest version of the documentation. If you use an older version of MySQL, select the matching documentation version after opening the links.
3232
{{% /notice %}}
33+
34+
## What you've learned and what's next
35+
36+
You've now learned why tuning MySQL is beneficial, and reviewed an example benchmark result demonstrating improvement in throughput after tuning.
37+
38+
Next, you'll learn about different system parameters that you can tune for performance.

content/learning-paths/servers-and-cloud-computing/mysql_tune/kernel_comp_lib.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# User change
3-
title: "Tune system, kernel, compiler, and library settings"
3+
title: Tune storage, kernel, compiler, and library settings for performance
44
description: Learn how storage, kernel page size, Linux huge pages, compiler settings, and OpenSSL choices can affect MySQL performance on Arm-based systems.
55

66
weight: 3 # 1 is first, 2 is second, etc.
@@ -11,27 +11,29 @@ layout: "learningpathall"
1111

1212
## Tune the system around MySQL
1313

14-
MySQL configuration is only one part of performance tuning. Operating system settings, storage behavior, kernel memory management, compiler choices, and library versions can also affect throughput and latency. This section highlights system-level areas to check before or alongside MySQL-specific tuning.
14+
MySQL configuration is only one part of performance tuning. Operating system settings, storage behavior, kernel memory management, compiler choices, and library versions can also affect throughput and latency. The following are system-level areas to check before or alongside MySQL-specific tuning.
1515

16-
## Storage technology, file systems, and disk scheduling
16+
### Storage technology, file systems, and disk scheduling
1717

1818
Storage technology and file system choices can affect performance. In general, locally attached SSD storage performs best, but network-based storage systems can also perform well. Test the storage technologies and configuration options available in your environment.
1919

2020
The file system used with MySQL can also affect performance. The `xfs` file system is a good starting point, and `ext4` is another good option. For production systems, use storage volumes dedicated to the database instead of sharing them with the operating system or other applications.
2121

22-
When running in the cloud, the disk scheduling algorithm is typically set to `noop` or a similar minimal scheduler. This is usually a good setting for MySQL in cloud environments, so no adjustment is needed. If you run MySQL on an on-premises server, double-check the disk scheduling algorithm and test alternatives. According to the [Optimizing InnoDB Disk I/O documentation](https://dev.mysql.com/doc/refman/en/optimizing-innodb-diskio.html), `noop` or `deadline` might be better options for some systems.
22+
When running in the cloud, the disk scheduling algorithm is typically set to `noop` or a similar minimal scheduler. This is usually a good setting for MySQL in cloud environments, so no adjustment is needed.
2323

24-
## MySQL storage engines
24+
If you run MySQL on an on-premises server, double-check the disk scheduling algorithm and test alternatives. According to the [Optimizing InnoDB Disk I/O documentation](https://dev.mysql.com/doc/refman/en/optimizing-innodb-diskio.html), `noop` or `deadline` might be better options for some systems.
25+
26+
### MySQL storage engines
2527

2628
MySQL supports different storage engines. The default storage engine is `InnoDB`, which performs best across the broadest set of use cases.
2729

28-
Information on alternative storage engines can be found in the [MySQL documentation](https://dev.mysql.com/doc/refman/en/storage-engines.html).
30+
For more information on alternative storage engines, see the [MySQL storage engine documentation](https://dev.mysql.com/doc/refman/en/storage-engines.html).
2931

30-
## Kernel configuration
32+
### Kernel configuration
3133

32-
MySQL can benefit from adjustments to kernel parameters. The following kernel-related settings can have a positive impact on performance.
34+
MySQL can benefit from adjustments to kernel parameters. The following kernel-related settings can improve performance.
3335

34-
### Linux virtual memory subsystem
36+
#### Linux virtual memory subsystem
3537

3638
Making changes to the Linux virtual memory subsystem can improve performance.
3739

@@ -45,17 +47,17 @@ To list all sysctl parameters available:
4547
sudo sysctl -a
4648
```
4749

48-
See the `sysctl` command documentation for more.
50+
For more information, see the `sysctl` command documentation.
4951

50-
### Consider 64 KB kernel pages on Arm
52+
#### Consider 64 KB kernel pages on Arm
5153

5254
Some Arm Linux distributions provide kernels built with `64 KB` base pages instead of `4 KB` base pages. This is a kernel selection or build-time choice, not a `sysctl` setting you can change on a running system.
5355

5456
A `64 KB` base page can improve some memory-intensive workloads because each base page maps more memory. This can reduce Memory Management Unit (MMU) translation overhead, reduce page-table walk depth, and relieve Translation Lookaside Buffer (TLB) pressure, including instruction-side TLB pressure in the CPU front end.
5557

5658
The tradeoff is memory efficiency. Larger base pages can increase internal fragmentation for workloads with many small or sparsely touched mappings, which can reduce the effective amount of memory available to the application and operating system.
5759

58-
The benefit is workload dependent, so compare a `4 KB` kernel and a `64 KB` kernel with the same MySQL & storage configuration.
60+
The benefit is workload dependent, so compare a `4 KB` kernel and a `64 KB` kernel with the same MySQL and storage configuration.
5961

6062
Base page size also affects the huge page sizes available on Arm. The common PMD-level huge page sizes are:
6163

@@ -93,11 +95,7 @@ Huge pages are not being used if `HugePages_Total` is `0` (this is typically the
9395

9496
The `Hugepagesize` value depends on the kernel base page size and platform configuration. Use the value reported by `/proc/meminfo` when calculating `vm.nr_hugepages`.
9597

96-
The sysctl parameter that enables huge pages is shown below:
97-
98-
```output
99-
vm.nr_hugepages
100-
```
98+
The sysctl parameter that enables huge pages is `vm.nr_hugepages`.
10199

102100
This parameter sets the number of huge pages you want the kernel to make available to applications.
103101

@@ -116,7 +114,7 @@ echo "vm.nr_hugepages=512" | sudo tee /etc/sysctl.d/99-mysql-hugepages.conf
116114
sudo sysctl --system
117115
```
118116

119-
### Selecting the number of huge pages to use
117+
#### Selecting the number of huge pages to use
120118

121119
If huge pages improve your workload, set `vm.nr_hugepages` to a value that gives a total huge page space equal to or slightly larger than the InnoDB buffer pool size, which is controlled by `innodb_buffer_pool_size`.
122120

@@ -128,12 +126,18 @@ Selecting the buffer pool size is discussed in the [Tuning MySQL](/learning-path
128126

129127
Typically, only the number of huge pages needs to be configured. However, for more information on the different parameters that affect the configuration of huge pages, review the [admin-guide for hugetlbpage in the Linux source code](https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/mm/hugetlbpage.rst).
130128

131-
## Compiler considerations
129+
### Compiler considerations
132130

133131
If you build MySQL from source, the compiler version and optimization flags can affect performance. Use a recent version of GCC, and consider flags such as `-mcpu` and `-flto` for additional optimization. These flags are explained in the [Migrating C/C++ applications](/learning-paths/servers-and-cloud-computing/migration/c/) section of the [Migrating applications to Arm servers](/learning-paths/servers-and-cloud-computing/migration/) Learning Path.
134132

135-
## OpenSSL considerations
133+
### OpenSSL considerations
136134

137135
MySQL relies on [OpenSSL](https://www.openssl.org/) for cryptographic operations. The OpenSSL version used with MySQL, and the compiler version and switches used to build it, can affect performance. The default OpenSSL version provided by your Linux distribution is typically sufficient.
138136

139137
If you build MySQL from source, you can also build and install a newer version of OpenSSL before building MySQL. This might improve performance for workloads that spend significant time in cryptographic operations.
138+
139+
## What you've learned and what's next
140+
141+
You've now explored changes you can make at the system-level related to storage, memory pages, compiler flags, and OpenSSL to improve MySQL performance on Arm.
142+
143+
Next, you'll learn about specific MySQL parameters that you can tune for performance.

0 commit comments

Comments
 (0)