You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/mysql_tune/before_and_after.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: "Measure MySQL tuning impact"
2
+
title: Measure the impact of tuning MySQL
3
3
description: Learn how to approach MySQL performance tuning as a measurement-driven process and compare baseline results with tuned results.
4
4
weight: 2
5
5
layout: "learningpathall"
@@ -15,7 +15,7 @@ Whatever method you use, keep the measurements repeatable. Record the system con
15
15
16
16
## Why tune MySQL
17
17
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.
19
19
20
20
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.
21
21
@@ -30,3 +30,9 @@ This benchmark result is an example, not a guaranteed improvement for every work
30
30
{{% notice Note %}}
31
31
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.
32
32
{{% /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.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/mysql_tune/kernel_comp_lib.md
+24-20Lines changed: 24 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
# User change
3
-
title: "Tune system, kernel, compiler, and library settings"
3
+
title: Tune storage, kernel, compiler, and library settings for performance
4
4
description: Learn how storage, kernel page size, Linux huge pages, compiler settings, and OpenSSL choices can affect MySQL performance on Arm-based systems.
5
5
6
6
weight: 3# 1 is first, 2 is second, etc.
@@ -11,27 +11,29 @@ layout: "learningpathall"
11
11
12
12
## Tune the system around MySQL
13
13
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.
15
15
16
-
## Storage technology, file systems, and disk scheduling
16
+
###Storage technology, file systems, and disk scheduling
17
17
18
18
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.
19
19
20
20
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.
21
21
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.
23
23
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
25
27
26
28
MySQL supports different storage engines. The default storage engine is `InnoDB`, which performs best across the broadest set of use cases.
27
29
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).
29
31
30
-
## Kernel configuration
32
+
###Kernel configuration
31
33
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.
33
35
34
-
### Linux virtual memory subsystem
36
+
####Linux virtual memory subsystem
35
37
36
38
Making changes to the Linux virtual memory subsystem can improve performance.
37
39
@@ -45,17 +47,17 @@ To list all sysctl parameters available:
45
47
sudo sysctl -a
46
48
```
47
49
48
-
See the `sysctl` command documentation for more.
50
+
For more information, see the `sysctl` command documentation.
49
51
50
-
### Consider 64 KB kernel pages on Arm
52
+
####Consider 64 KB kernel pages on Arm
51
53
52
54
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.
53
55
54
56
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.
55
57
56
58
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.
57
59
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.
59
61
60
62
Base page size also affects the huge page sizes available on Arm. The common PMD-level huge page sizes are:
61
63
@@ -93,11 +95,7 @@ Huge pages are not being used if `HugePages_Total` is `0` (this is typically the
93
95
94
96
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`.
95
97
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`.
101
99
102
100
This parameter sets the number of huge pages you want the kernel to make available to applications.
103
101
@@ -116,7 +114,7 @@ echo "vm.nr_hugepages=512" | sudo tee /etc/sysctl.d/99-mysql-hugepages.conf
116
114
sudo sysctl --system
117
115
```
118
116
119
-
### Selecting the number of huge pages to use
117
+
####Selecting the number of huge pages to use
120
118
121
119
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`.
122
120
@@ -128,12 +126,18 @@ Selecting the buffer pool size is discussed in the [Tuning MySQL](/learning-path
128
126
129
127
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).
130
128
131
-
## Compiler considerations
129
+
###Compiler considerations
132
130
133
131
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.
134
132
135
-
## OpenSSL considerations
133
+
###OpenSSL considerations
136
134
137
135
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.
138
136
139
137
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