Skip to content

Commit ce854eb

Browse files
authored
Merge pull request #2308 from pareenaverma/content_review
Tech review of MongoDB on Azure Cobalt
2 parents 32365b6 + 5189710 commit ce854eb

File tree

7 files changed

+68
-485
lines changed

7 files changed

+68
-485
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@ cascade:
77

88
minutes_to_complete: 30
99

10-
who_is_this_for: This Learning Path is designed for software developers looking to migrate their MongoDB workloads from x86_64 to Arm-based platforms, specifically on the Microsoft Azure Cobalt 100 processors.
10+
who_is_this_for: This Learning Path is designed for software developers looking to migrate their MongoDB workloads to Arm-based platforms, specifically on the Microsoft Azure Cobalt 100 processors.
1111

1212
learning_objectives:
13-
- Provision an Azure Arm64 virtual machine using Azure console, with Ubuntu Pro 24.04 LTS as the base image.
14-
- Deploy the MongoDB on an Azure ubuntu virtual machine.
15-
- Perform MongoDB baseline testing and benchmarking on both x86_64 and Arm64 virtual machine.
13+
- Provision an Azure Arm64 Cobalt 100 based virtual machine using Azure console, with Ubuntu Pro 24.04 LTS as the base image.
14+
- Deploy MongoDB on an Azure Cobalt 100 based virtual machine.
15+
- Perform MongoDB baseline testing and benchmarking on the Arm64 virtual machine.
1616

1717
prerequisites:
1818
- A [Microsoft Azure](https://azure.microsoft.com/) account with access to Cobalt 100 based instances (Dpsv6).
19-
- Basic understanding of Linux command line.
2019
- Familiarity with the [MongoDB architecture](https://www.mongodb.com/) and deployment practices on Arm64 platforms.
2120

22-
author: Jason Andrews
21+
author: Pareena Verma
2322

2423
### Tags
2524
skilllevels: Introductory

content/learning-paths/servers-and-cloud-computing/mongodb-on-azure/baseline-testing.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ layout: learningpathall
88

99

1010
### Baseline testing of MongoDB
11-
Perform baseline testing by verifying MongoDB is running, logging into the shell, executing a few test queries, and monitoring live performance. This ensures the database is functioning correctly before starting any benchmarks.
11+
In this section you will perform baseline testing by verifying MongoDB is running, logging into the shell, executing a few test queries, and monitoring live performance. This ensures the database is functioning correctly before starting any benchmarks.
1212

1313
1. Verify Installation & Service Health
1414

@@ -17,11 +17,12 @@ ps -ef | grep mongod
1717
mongod --version
1818
netstat -tulnp | grep 27017
1919
```
20+
An explanation of what each command is doing:
2021
- **ps -ef | grep mongod** – Checks if the MongoDB server process is running.
2122
- **mongod --version** – Shows the version of MongoDB installed.
2223
- **netstat -tulnp | grep 27017** – Checks if MongoDB is listening for connections on its default port 27017.
2324

24-
You should see an output similar to:
25+
You should see output similar to:
2526

2627
```output
2728
mongod --version
@@ -48,12 +49,12 @@ tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN
4849

4950
2. Storage and Health Check
5051

51-
Run the command below to check how fast your storage can **randomly read small 4KB chunks** from a 100 MB file for 30 seconds, using one job, and then show a summary report:
52+
To perform a storage and health check, run the command below. This command checks how fast your storage can randomly read small 4KB chunks from a 100 MB file for 30 seconds, using one job, followed by a summary report:
5253

5354
```console
5455
fio --name=baseline --rw=randread --bs=4k --size=100M --numjobs=1 --time_based --runtime=30 --group_reporting
5556
```
56-
You should see an output similar to:
57+
You should see output similar to:
5758

5859
```output
5960
baseline: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
@@ -91,6 +92,13 @@ The output shows how fast it read data (**16.6 MB/s**) and how many reads it did
9192

9293
3. Connectivity and CRUD Sanity Check
9394

95+
To verify that the MongoDB server is reachable you will perform a connectivity check. You will run a sanity test of core database functionality and permissions, refered to as CRUD:
96+
97+
C - Create: Insert a new record/document into the database.
98+
R - Read: Query the database to retrieve data.
99+
U - Update: Modify an existing record.
100+
D - Delete: Remove a record.
101+
94102
```console
95103
mongosh --host localhost --port 27017
96104
```
@@ -107,7 +115,7 @@ exit
107115
```
108116
These commands create a test record, read it, update its value, and then delete it a simple way to check if MongoDB’s basic **add, read, update, and delete** operations are working.
109117

110-
You should see an output similar to:
118+
You should see output similar to:
111119

112120
```output
113121
test> use baselineDB
@@ -141,6 +149,8 @@ baselineDB> db.testCollection.deleteOne({ name: "baseline-check" })
141149

142150
4. Basic Query Performance Test
143151

152+
You will now perform a lightweight query performance check:
153+
144154
```console
145155
mongosh --eval '
146156
db = db.getSiblingDB("baselineDB");
@@ -150,16 +160,17 @@ db.perf.find({ value: { $gt: 0.5 } }).count();
150160
print("Query Time (ms):", new Date() - start);
151161
'
152162
```
153-
The command connected to MongoDB, switched to the **baselineDB** database, inserted **1,000 documents** into the perf collection, and then measured the execution time for counting documents where **value > 0.5**. The final output displayed the **query execution time** in milliseconds.
163+
The command connected to MongoDB, switched to the `baselineDB` database, inserted 1,000 documents into the perf collection, and then measured the execution time for counting documents where value > 0.5. The final output displayed the query execution time in milliseconds.
154164

155-
You should see an output similar to:
165+
You should see the Query Time output similar to:
156166

157167
```output
158168
Query Time (ms): 2
159169
```
160170

161171
5. Index Creation Speed Test
162172

173+
You will now run a performance sanity check that measures how long MongoDB takes to create an index on a given collection:
163174
```console
164175
mongosh --eval '
165176
db = db.getSiblingDB("baselineDB");
@@ -168,24 +179,26 @@ db.perf.createIndex({ value: 1 });
168179
print("Index Creation Time (ms):", new Date() - start);
169180
'
170181
```
171-
The test connected to MongoDB, switched to the **baselineDB** database, and created an index on the **value** field in the **perf** collection. The index creation process completed in **22 milliseconds**, indicating relatively fast index building for the dataset size.
182+
The test connected to MongoDB, switched to the `baselineDB` database, and created an index on the value field in the `perf` collection. The index creation process completed in 22 milliseconds, indicating relatively fast index building for the dataset size.
172183

173-
You should see an output similar to:
184+
You should see output similar to:
174185

175186
```output
176187
Index Creation Time (ms): 22
177188
```
178189

179190
6. Concurrency Smoke Test
180191

192+
You will now verify that MongoDB can handle concurrent client connections and inserts without errors:
193+
181194
```console
182195
for i in {1..5}; do
183196
mongosh --eval 'use baselineDB; db.concurrent.insertMany([...Array(1000).keys()].map(k => ({ test: k, ts: new Date() })))' &
184197
done
185198
wait
186199
```
187-
This command runs **five MongoDB insert jobs at the same time**, each adding **1,000 new records** to the **baselineDB.concurrent** collection.
188-
It’s a quick way to test how MongoDB handles **multiple users writing data at once**.
200+
This command runs five MongoDB insert jobs at the same time, each adding 1,000 new records to the `baselineDB.concurrent` collection.
201+
It is a quick way to test how MongoDB handles multiple users writing data at once.
189202

190203
You should see an output similar to:
191204

@@ -207,8 +220,8 @@ switched to db baselineDB;
207220
[5]+ Done mongosh --eval 'use baselineDB; db.concurrent.insertMany([...Array(1000).keys()].map(k => ({ test: k, ts: new Date() })))'
208221
```
209222

210-
**Five parallel MongoDB shell sessions** were executed, each inserting **1,000** test documents into the baselineDB.concurrent collection. All sessions completed successfully, confirming that concurrent data insertion works as expected.
223+
Five parallel MongoDB shell sessions were executed, each inserting 1,000 test documents into the baselineDB.concurrent collection. All sessions completed successfully, confirming that concurrent data insertion works as expected.
211224

212-
The above operations confirm that MongoDB is installed successfully and is functioning as expected on the Azure Cobalt 100 (Arm64) environment.
225+
With these tests you have confirmed that MongoDB is installed successfully and is functioning as expected on the Azure Cobalt 100 (Arm64) environment.
213226

214-
Now, your MongoDB instance is ready for further benchmarking and production use.
227+
You are now ready to perform further benchmarking for MongoDB.

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ layout: learningpathall
88

99
## Benchmark MongoDB with **mongotop** and **mongostat**
1010

11-
This guide will help the user measure MongoDBs performance in real time.
12-
The user will install the official MongoDB database tools, start MongoDB, run a script to simulate heavy load, and watch the databases live performance using **mongotop** and **mongostat**.
11+
In this section, you will measure MongoDB's performance in real time.
12+
You will install the official MongoDB database tools, start MongoDB and run a script to simulate heavy load. With the script running you will then meassure the database's live performance using **mongotop** and **mongostat**.
1313

1414
1. Install MongoDB Database Tools
1515

@@ -20,7 +20,7 @@ sudo apt install -y ./mongodb-database-tools-ubuntu2404-arm64-100.13.0.deb
2020
echo 'export PATH=$PATH:~/mongodb-database-tools-ubuntu2404-arm64-100.13.0/bin' >> ~/.bashrc
2121
source ~/.bashrc
2222
```
23-
These commands download and unpack MongoDBs official monitoring tools (**mongotop** & **mongostat**), then add them to your PATH so you can run them from any terminal.
23+
These commands download and unpack MongoDB's official monitoring tools (**mongotop** & **mongostat**), then add them to your PATH so you can run them from any terminal.
2424

2525
2. Verify the Installation
2626

@@ -30,7 +30,7 @@ mongostat --version
3030
```
3131
This checks that both tools were installed correctly and are ready to use.
3232

33-
You should see an output similar to:
33+
You should see output similar to:
3434
```output
3535
mongostat --version
3636
mongotop version: 100.13.0
@@ -52,11 +52,11 @@ Go version: go1.23.11
5252
```console
5353
mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log --fork
5454
```
55-
These commands create a folder for MongoDBs data, then start the database server in the background, allowing connections from any IP, and save logs for troubleshooting.
55+
These commands create a folder for MongoDB's data, then start the database server in the background, allowing connections from any IP, and save logs for troubleshooting.
5656

5757
4. Create a Long-Running Load Script for Benchmarking
5858

59-
Save this script file as **long_system_load.js**:
59+
Use a file editor of your choice and create a file named `long_system_load.js` with the content below:
6060

6161
```javascript
6262
function randomString(len) {
@@ -109,15 +109,15 @@ for (let cycle = 0; cycle < totalCycles; cycle++) {
109109
print("=== Long load generation completed ===");
110110
```
111111

112-
This is the load generator script, it creates several collections and repeatedly **inserts, queries, updates** and **deletes** data. Running it simulates real application traffic so the monitors have something to measure.
112+
This is the load generator script, it creates several collections and repeatedly inserts, queries, updates and deletes data. Running it simulates real application traffic so the monitors have something to measure.
113113

114114
{{% notice Note %}}
115115
Before proceeding, the load script and the monitoring tools must be run in separate terminals simultaneously.
116116

117117
- The load script continuously generates activity in MongoDB, keeping the database busy with multiple operations.
118118
- The mongotop and mongostat tools monitor and report this activity in real time as it happens.
119119

120-
If all commands are run in the same terminal, the monitoring tools will only start after the script finishes, preventing real-time observation of MongoDBs performance.
120+
If all commands are run in the same terminal, the monitoring tools will only start after the script finishes, preventing real-time observation of MongoDB's performance.
121121
{{% /notice %}}
122122

123123
### Run the load script (start the workload) — Terminal 1
@@ -128,7 +128,7 @@ mongosh < long_system_load.js
128128

129129
This command tells the MongoDB shell to execute the entire script. The script will run through its cycles and print the progress while generating the read/write activity on the server.
130130

131-
You should see an output similar to:
131+
You should see output similar to:
132132
```output
133133
test> // long_system_load.js
134134
@@ -255,7 +255,7 @@ test> print("=== Long load generation completed ===");
255255
256256
```
257257

258-
The load has been generated successfully. Now, you can proceed with the monitoring:
258+
The load has been generated successfully. Now, you can proceed to the next section where you will monitor this running workload with:
259259

260260
- **mongotop** to observe activity per collection.
261261
- **mongostat** to monitor overall operations per second, memory usage, and network activity.

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ layout: learningpathall
88

99
## Introduction
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 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). In this section, you will use the Azure console to create a virtual machine with Arm-based Azure Cobalt 100 Processor.
1212

1313
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.
1414

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).
15+
While the steps to create this instance are included here for your convenience, you can also refer to the [Deploy a Cobalt 100 Virtual Machine on Azure Learning Path](/learning-paths/servers-and-cloud-computing/cobalt/)
1616

1717
#### Create an Arm-based Azure Virtual Machine
1818

@@ -43,8 +43,4 @@ Creating a virtual machine based on Azure Cobalt 100 is no different from creati
4343

4444
![Azure portal VM creation — Azure Cobalt 100 Arm64 virtual machine (D4ps_v6) alt-text#center](images/final-vm.png "Figure 5: VM deployment confirmation in Azure portal")
4545

46-
{{% notice Note %}}
47-
48-
To learn more about Arm-based virtual machine in Azure, refer to “Getting Started with Microsoft Azure” in [Get started with Arm-based cloud instances](/learning-paths/servers-and-cloud-computing/csp/azure).
49-
50-
{{% /notice %}}
46+
While the virtual machine ready, proceed to the next section to delpoy MongoDB on your running instance.

content/learning-paths/servers-and-cloud-computing/mongodb-on-azure/deploy.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ echo 'export PATH=/usr/local/mongodb/bin:$PATH' | sudo tee /etc/profile.d/mongod
3636
source /etc/profile.d/mongodb.sh
3737
```
3838

39-
4. Create a data and log directories
39+
4. Create data and log directories to use with MongoDB:
4040

4141
Set up the database data directory:
4242
```console
@@ -47,7 +47,7 @@ sudo chown -R $USER:$USER /var/lib/mongo /var/log/mongodb
4747

4848
5. Start MongoDB Server
4949

50-
Start MongoDB manually:
50+
You can start MongoDB manually as shown:
5151
```console
5252
mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log --fork
5353
```
@@ -77,12 +77,12 @@ source /etc/profile.d/mongosh.sh
7777

7878
### Verify MongoDB and mongosh Installation
7979

80-
Check if MongoDB and mongosh is properly installed:
80+
Check if MongoDB and mongosh are properly installed on your machine:
8181
```console
8282
mongod --version
8383
mongosh --version
8484
```
85-
You should see an output similar to:
85+
You should see output similar to:
8686
```output
8787
db version v8.0.12
8888
Build Info: {
@@ -102,11 +102,11 @@ Build Info: {
102102

103103
### Connect to MongoDB via mongosh
104104

105-
Start interacting with MongoDB through its shell interface:
105+
You can now start interacting with MongoDB through its shell interface:
106106
```console
107107
mongosh mongodb://127.0.0.1:27017
108108
```
109-
You should see an output similar to:
109+
You should see output on your terminal similar to:
110110
```output
111111
Current Mongosh Log ID: 68b573411523231d81a00aa0
112112
Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.3.8
@@ -130,4 +130,4 @@ For mongosh info see: https://www.mongodb.com/docs/mongodb-shell/
130130
test>
131131
```
132132

133-
MongoDB installation is complete. You can now proceed with the baseline testing.
133+
With this you have verified that the MongoDB installation is complete. You can now proceed with the baseline testing of MongoDB on your Azure Cobalt 100 based VM.

0 commit comments

Comments
 (0)