Skip to content

Commit e877de7

Browse files
authored
Merge pull request #2379 from pareenaverma/content_review
MySQL on Cobalt Tech Review
2 parents fe17602 + 8fcced6 commit e877de7

File tree

5 files changed

+112
-75
lines changed

5 files changed

+112
-75
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ draft: true
55
cascade:
66
draft: true
77

8-
minutes_to_complete: 40
8+
minutes_to_complete: 30
99

10-
who_is_this_for: This is an advanced topic that introduces MySQL deployment on Microsoft Azure Cobalt 100 (Arm-based) virtual machines. It is designed for developers migrating MySQL applications from x86_64 to Arm.
10+
who_is_this_for: This is an introductory topic that introduces MySQL deployment on Microsoft Azure Cobalt 100 (Arm-based) virtual machines. It is designed for developers migrating MySQL applications from x86_64 to Arm.
1111

1212
learning_objectives:
1313
- Provision an Azure Arm64 virtual machine using Azure console, with Ubuntu Pro 24.04 LTS as the base image.
1414
- Deploy MySQL on the Ubuntu virtual machine.
15-
- Perform MySQL baseline testing and benchmarking on both x86_64 and Arm64 virtual machines.
15+
- Perform MySQL baseline testing and benchmarking on Arm64 virtual machines.
1616

1717
prerequisites:
1818
- A [Microsoft Azure](https://azure.microsoft.com/) account with access to Cobalt 100 based instances (Dpsv6)
@@ -21,7 +21,7 @@ prerequisites:
2121
author: Pareena Verma
2222

2323
### Tags
24-
skilllevels: Advanced
24+
skilllevels: Introductory
2525
subjects: Databases
2626
cloud_service_providers: Microsoft Azure
2727

content/learning-paths/servers-and-cloud-computing/mysql-azure/baseline.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,29 @@ weight: 6
66
layout: learningpathall
77
---
88

9-
## Run a functional test of MySQL on Azure Cobalt 100
10-
11-
After installing MySQL on your Arm64 virtual machine, you can perform simple baseline testing to validate that MySQL runs correctly and produces the expected output.
9+
After installing MySQL on your Azure Cobalt 100 Arm64 virtual machine, you should run a functional test to confirm that the database is operational and ready for use. Beyond just checking service status, validation ensures MySQL is processing queries correctly, users can authenticate, and the environment is correctly configured for cloud workloads.
1210

1311
### Start MySQL
1412

15-
Make sure MySQL is running:
13+
Ensure MySQL is running and configured to start on boot:
1614

1715
```console
1816
sudo systemctl start mysql
1917
sudo systemctl enable mysql
2018
```
2119
### Connect to MySQL
2220

21+
Connect using the MySQL client:
22+
2323
```console
2424
mysql -u admin -p
2525
```
26-
Opens the MySQL client and connects as the new user(admin), prompting you to enter the admin password.
26+
This opens the MySQL client and connects as the new user(admin), prompting you to enter the admin password.
27+
28+
### Show and Use Database
2729

28-
### Show and use Database
30+
Once you’ve connected successfully with your new user, the next step is to create and interact with a database. This verifies that your MySQL instance is not only accessible but also capable of storing and organizing data.
31+
Run the following commands inside the MySQL shell:
2932

3033
```sql
3134
CREATE DATABASE baseline_test;
@@ -69,10 +72,13 @@ mysql> SELECT DATABASE();
6972
+---------------+
7073
1 row in set (0.00 sec)
7174
```
72-
You created a new database named **baseline_test**, verified its presence with `SHOW DATABASES`, and confirmed it is the active database using `SELECT DATABASE()`.
75+
You created a new database named `baseline_test`, verified its presence with `SHOW DATABASES`, and confirmed it is the active database using `SELECT DATABASE()`.
7376

7477
### Create and show Table
7578

79+
After creating and selecting a database, the next step is to define a table, which represents how your data will be structured. In MySQL, tables are the core storage objects where data is inserted, queried, and updated.
80+
Run the following inside the `baseline_test` database:
81+
7682
```sql
7783
CREATE TABLE test_table (
7884
id INT AUTO_INCREMENT PRIMARY KEY,
@@ -100,10 +106,13 @@ mysql> SHOW TABLES;
100106
+-------------------------+
101107
1 row in set (0.00 sec)
102108
```
103-
You successfully created the table **test_table** in the `baseline_test` database and verified its existence using `SHOW TABLES`.
109+
You successfully created the table `test_table` in the `baseline_test` database and verified its existence using `SHOW TABLES`.
104110

105111
### Insert Sample Data
106112

113+
Once the table is created, you can populate it with sample rows. This validates that MySQL can handle write operations and that the underlying storage engine is working properly.
114+
115+
Run the following SQL command inside the baseline_test database:
107116
```sql
108117
INSERT INTO test_table (name, value)
109118
VALUES
@@ -114,7 +123,7 @@ VALUES
114123
- `INSERT INTO test_table (name, value)` - Specifies which table and columns to insert into.
115124
- `VALUES` - Provides three rows of data.
116125

117-
After inserting, you can check the data with:
126+
After inserting data into `test_table`, you can confirm the write operation succeeded by retrieving the rows with:
118127

119128
```sql
120129
SELECT * FROM test_table;
@@ -135,6 +144,6 @@ mysql> SELECT * FROM test_table;
135144
+----+---------+-------+
136145
3 rows in set (0.00 sec)
137146
```
147+
This confirms that that rows were successfully inserted, the auto-increment primary key (id) is working correctly and the query engine can read back from disk/memory and return results instantly.
138148

139-
The functional test was successful — the **test_table** contains three rows (**Alice, Bob, and Charlie**) with their respective values, confirming MySQL is working
140-
correctly.
149+
The functional test was successful. The test_table contains the expected three rows (Alice, Bob, and Charlie) with their respective values. This confirms that MySQL is working correctly on your Cobalt 100 Arm-based VM, completing the installation and validation phase.

content/learning-paths/servers-and-cloud-computing/mysql-azure/benchmarking.md

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,34 @@ weight: 7
66
layout: learningpathall
77
---
88

9-
## Benchmark MySQL on Azure Cobalt 100 Arm-based instances and x86_64 instances
9+
## Benchmark MySQL on Azure Cobalt 100 Arm-based instances
1010

11-
`mysqlslap` is the official MySQL benchmarking tool used to simulate multiple client connections and measure query performance. It helps evaluate **read/write throughput, query response times**, and overall MySQL server performance under different workloads, making it ideal for baseline testing and optimization.
11+
To understand how MySQL performs on Azure Cobalt 100 (Arm64) VMs, you can use the built-in `mysqlslap` tool.
12+
13+
`mysqlslap` is the official MySQL benchmarking tool used to simulate multiple client connections and measure query performance. It helps evaluate read/write throughput, query response times, and overall MySQL server performance under different workloads, making it ideal for baseline testing and optimization.
1214

1315
## Steps for MySQL Benchmarking with mysqlslap
1416

1517
1. Connect to MySQL and Create a Database
1618

17-
To access the MySQL server, use the following command based on your `admin` user password:
19+
Before running `mysqlslap`, you will create a dedicated test database so that benchmarking doesn’t interfere with your application data. This ensures clean test results and avoids accidental modifications to production schemas.
20+
Connect to MySQL using the admin user:
1821

1922
```console
2023
mysql -u admin -p
2124
```
22-
Once logged in, you can create a benchmark_db using SQL commands like:
25+
Once logged in, create a benchmarking database:
2326

2427
```sql
2528
CREATE DATABASE benchmark_db;
2629
USE benchmark_db;
2730
```
2831

29-
3. Create a Table and Populate Data
32+
2. Create a Table and Populate Data
33+
34+
With a dedicated `benchmark_db` created, the next step is to define a test table and populate it with data. This simulates a realistic workload so that `mysqlslap` can measure query performance against non-trivial datasets.
3035

31-
After logging into MySQL, you can create a table to store benchmark data. Here’s a simple example:
36+
Create a benchmark table:
3237

3338
```sql
3439
CREATE TABLE benchmark_table (
@@ -37,14 +42,18 @@ CREATE TABLE benchmark_table (
3742
score INT
3843
);
3944
```
40-
Insert some sample rows manually:
45+
Insert Sample Rows Manually:
4146

47+
For quick validation:
4248
```sql
4349
INSERT INTO benchmark_table (username,score) VALUES
4450
('John',100),('Jane',200),('Mike',300);
4551
```
52+
This verifies that inserts work correctly and allows you to test small queries.
4653

47-
Or populate automatically with 1000 rows:
54+
Populate Automatically with 1000 Rows
55+
56+
For benchmarking, larger datasets give more meaningful results. You can use a stored procedure to generate rows programmatically:
4857

4958
```sql
5059
DELIMITER //
@@ -62,15 +71,14 @@ DELIMITER ;
6271
CALL populate_benchmark_data();
6372
DROP PROCEDURE populate_benchmark_data;
6473
```
65-
- The table `benchmark_table` has three columns: `record_id` (primary key), `username`, and `score`.
66-
- You can insert a few rows manually for testing or use a procedure to generate **1000 rows automatically** for more realistic benchmarking
74+
At this stage, you have a populated `benchmark_table` inside `benchmark_db`. This provides a realistic dataset for running `mysqlslap`, enabling you to measure how MySQL performs on Azure Cobalt 100 under read-heavy, write-heavy, or mixed workloads.
6775

6876
## Run a Simple Read/Write Benchmark
6977

70-
Once your table is ready, you can use `mysqlslap` to simulate multiple clients performing queries. This helps test MySQL’s performance under load.
78+
With the `benchmark_table` populated, you can run a synthetic workload using mysqlslap to simulate multiple clients performing inserts or queries at the same time. This tests how well MySQL handles concurrent connections and query execution.
7179

7280
```console
73-
mysqlslap --user=admin --password="MyStrongPassword!" --host=127.0.0.1 --concurrency=10 --iterations=5 --query="INSERT INTO benchmark_db.benchmark_table (username,score) VALUES('TestUser',123);" --create-schema=benchmark_db
81+
mysqlslap --user=admin --password=`MyStrongPassword!` --host=127.0.0.1 --concurrency=10 --iterations=5 --query="INSERT INTO benchmark_db.benchmark_table (username,score) VALUES('TestUser',123);" --create-schema=benchmark_db
7482
```
7583
- **--user / --password:** MySQL login credentials.
7684
- **--host:** MySQL server address (127.0.0.1 for local).
@@ -79,7 +87,7 @@ mysqlslap --user=admin --password="MyStrongPassword!" --host=127.0.0.1 -
7987
- **--query:** The SQL statement to run repeatedly.
8088
- **--create-schema:** The database in which to run the query.
8189

82-
You should see output similar to the following:
90+
You should see output similar to:
8391

8492
```output
8593
Benchmark
@@ -90,13 +98,15 @@ Benchmark
9098
Average number of queries per client: 1
9199
```
92100

93-
Below command runs a **read benchmark** on your MySQL database using `mysqlslap`. It simulates multiple clients querying the table at the same time and records the results.
101+
Run a Read Benchmark (table scan):
102+
103+
You can now run a test that simulates multiple clients querying the table at the same time and records the results:
94104

95105
```console
96106
mysqlslap --user=admin --password="MyStrongPassword!" --host=127.0.0.1 --concurrency=10 --iterations=5 --query="SELECT * FROM benchmark_db.benchmark_table WHERE record_id < 500;" --create-schema=benchmark_db --verbose | tee -a /tmp/mysqlslap_benchmark.log
97107
```
98108

99-
You should see output similar to the following:
109+
You should see output similar to:
100110

101111
```output
102112
Benchmark
@@ -109,11 +119,11 @@ Benchmark
109119

110120
## Benchmark Results Table Explained:
111121

112-
- **Average number of seconds to run all queries:** This is the average time it took for all the queries in one iteration to complete across all clients. It gives you a quick sense of overall performance.
113-
- **Minimum number of seconds to run all queries:** This is the fastest time any iteration of queries took.
114-
- **Maximum number of seconds to run all queries:** This is the slowest time any iteration of queries took. The closer this is to the average, the more consistent your performance is.
115-
- **Number of clients running queries:** Indicates how many simulated users (or connections) ran queries simultaneously during the test.
116-
- **Average number of queries per client:** Shows the average number of queries each client executed in the benchmark iteration.
122+
Average number of seconds to run all queries: This is the average time it took for all the queries in one iteration to complete across all clients. It gives you a quick sense of overall performance.
123+
Minimum number of seconds to run all queries: This is the fastest time any iteration of queries took.
124+
Maximum number of seconds to run all queries: This is the slowest time any iteration of queries took. The closer this is to the average, the more consistent your performance is.
125+
Number of clients running queries: Indicates how many simulated users (or connections) ran queries simultaneously during the test.
126+
Average number of queries per client: Shows the average number of queries each client executed in the benchmark iteration.
117127

118128
## Benchmark summary on Arm64:
119129
Here is a summary of benchmark results collected on an Arm64 **D4ps_v6 Ubuntu Pro 24.04 LTS virtual machine**.
@@ -123,21 +133,13 @@ Here is a summary of benchmark results collected on an Arm64 **D4ps_v6 Ubuntu Pr
123133
| INSERT | 0.267 | 0.265 | 0.271 | 10 | 1 |
124134
| SELECT | 0.263 | 0.261 | 0.264 | 10 | 1 |
125135

126-
## Benchmark summary on x86_64:
127-
Here is a summary of the benchmark results collected on x86_64 **D4s_v6 Ubuntu Pro 24.04 LTS virtual machine**.
128-
129-
| Query Type | Average Time (s) | Minimum Time (s) | Maximum Time (s) | Clients | Avg Queries per Client |
130-
|------------|-----------------|-----------------|-----------------|--------|----------------------|
131-
| INSERT | 0.243 | 0.231 | 0.273 | 10 | 1 |
132-
| SELECT | 0.222 | 0.214 | 0.233 | 10 | 1 |
133136

134137
## Insights from Benchmark Results
135138

136139
The benchmark results on the Arm64 virtual machine show:
137140

138-
- **Balanced Performance for Read and Write Queries:** Both `INSERT` and `SELECT` queries performed consistently, with average times of **0.267s** and **0.263s**, respectively.
139-
- **Low Variability Across Iterations:** The difference between the minimum and maximum times was very small for both query types, indicating stable and predictable behavior under load.
140-
- **Moderate Workload Handling:** With **10 clients** and an average of **1 query per client**, the system handled concurrent operations efficiently without significant delays.
141-
- **Key Takeaway:** The MySQL setup on Arm64 provides reliable and steady performance for both data insertion and retrieval tasks, making it a solid choice for applications requiring dependable database operations.
142-
143-
You have now benchmarked MySql on an Azure Cobalt 100 Arm64 virtual machine and compared results with x86_64.
141+
Balanced Performance for Read and Write Queries: Both `INSERT` and `SELECT` queries performed consistently, with average times of 0.267s and 0.263s, respectively.
142+
Low Variability Across Iterations: The difference between the minimum and maximum times was very small for both query types, indicating stable and predictable behavior under load.
143+
Moderate Workload Handling: With 10 clients and an average of 1 query per client, the system handled concurrent operations efficiently without significant delays.
144+
145+
This demonstrates that the MySQL setup on Arm64 provides reliable and steady performance for both data insertion and retrieval tasks, making it a solid choice for applications requiring dependable database operations.

content/learning-paths/servers-and-cloud-computing/mysql-azure/create-instance.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
---
2-
title: Create an Arm based cloud virtual machine using Microsoft Cobalt 100 CPU
2+
title: Create an Azure Cobalt 100 Arm64 virtual machine
33
weight: 3
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Introduction
9+
## Prerequisites and setup
1010

11-
There are several ways to create an Arm-based Cobalt 100 virtual machine : the Microsoft Azure console, the Azure CLI tool, or using your choice of IaC (Infrastructure as Code). This guide will use the Azure console to create a virtual machine with Arm-based Cobalt 100 Processor.
11+
There are several common ways to create an Arm-based Cobalt 100 virtual machine, and you can choose the method that best fits your workflow or requirements:
1212

13-
This learning path focuses on the general-purpose virtual machine of the D series. Please read the guide on [Dpsv6 size series](https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/dpsv6-series) offered by Microsoft Azure.
13+
- The Azure Portal
14+
- The Azure CLI
15+
- An infrastructure as code (IaC) tool
1416

15-
If you have never used the Microsoft Cloud Platform before, please review the microsoft [guide to Create a Linux virtual machine in the Azure portal](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-portal?tabs=ubuntu).
17+
In this section, you will launch the Azure Portal to create a virtual machine with the Arm-based Azure Cobalt 100 processor.
18+
19+
This Learning Path focuses on general-purpose virtual machines in the Dpsv6 series. For more information, see the [Microsoft Azure guide for the Dpsv6 size series](https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/dpsv6-series).
20+
21+
While the steps to create this instance are included here for convenience, you can also refer to the [Deploy a Cobalt 100 virtual machine on Azure Learning Path](/learning-paths/servers-and-cloud-computing/cobalt/).
1622

1723
#### Create an Arm-based Azure Virtual Machine
1824

0 commit comments

Comments
 (0)