Skip to content

Commit 30869fb

Browse files
authored
Merge pull request #2233 from odidev/mongod
Deploy MongoDB on Azure Cobalt 100 processors
2 parents 343d0a1 + 2ceba2b commit 30869fb

14 files changed

Lines changed: 1364 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Run MongoDB on the Microsoft Azure Cobalt 100 processors
3+
4+
draft: true
5+
cascade:
6+
draft: true
7+
8+
minutes_to_complete: 30
9+
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.
11+
12+
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.
16+
17+
prerequisites:
18+
- A [Microsoft Azure](https://azure.microsoft.com/) account with access to Cobalt 100 based instances (Dpsv6).
19+
- Basic understanding of Linux command line.
20+
- Familiarity with the [MongoDB architecture](https://www.mongodb.com/) and deployment practices on Arm64 platforms.
21+
22+
author: Jason Andrews
23+
24+
### Tags
25+
skilllevels: Introductory
26+
subjects: Databases
27+
cloud_service_providers: Microsoft Azure
28+
29+
armips:
30+
- Neoverse
31+
32+
tools_software_languages:
33+
- MongoDB
34+
- mongotop
35+
- mongostat
36+
37+
operatingsystems:
38+
- Linux
39+
40+
further_reading:
41+
- resource:
42+
title: MongoDB Manual
43+
link: https://www.mongodb.com/docs/manual/
44+
type: documentation
45+
- resource:
46+
title: MongoDB Performance Tool
47+
link: https://github.com/idealo/mongodb-performance-test#readme
48+
type: documentation
49+
- resource:
50+
title: MongoDB on Azure
51+
link: https://azure.microsoft.com/en-us/solutions/mongodb
52+
type: documentation
53+
54+
55+
### FIXED, DO NOT MODIFY
56+
# ================================================================================
57+
weight: 1 # _index.md always has weight of 1 to order correctly
58+
layout: "learningpathall" # All files under learning paths have this same wrapper
59+
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
60+
---
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# ================================================================================
3+
# FIXED, DO NOT MODIFY THIS FILE
4+
# ================================================================================
5+
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
6+
title: "Next Steps" # Always the same, html page title.
7+
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
8+
---
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: "Overview"
3+
4+
weight: 2
5+
6+
layout: "learningpathall"
7+
---
8+
9+
## Cobalt 100 Arm-based processor
10+
11+
Azure’s Cobalt 100 is built on Microsoft's first-generation, in-house Arm-based processor: the Cobalt 100. Designed entirely by Microsoft and based on Arm’s Neoverse N2 architecture, this 64-bit CPU delivers improved performance and energy efficiency across a broad spectrum of cloud-native, scale-out Linux workloads. These include web and application servers, data analytics, open-source databases, caching systems, and more. Running at 3.4 GHz, the Cobalt 100 processor allocates a dedicated physical core for each vCPU, ensuring consistent and predictable performance.
12+
13+
To learn more about Cobalt 100, refer to the blog [Announcing the preview of new Azure virtual machine based on the Azure Cobalt 100 processor](https://techcommunity.microsoft.com/blog/azurecompute/announcing-the-preview-of-new-azure-vms-based-on-the-azure-cobalt-100-processor/4146353).
14+
15+
## MongoDB
16+
MongoDB is a popular open-source NoSQL database designed for high performance, scalability, and flexibility.
17+
18+
It stores data in JSON-like BSON documents, making it ideal for modern applications that require dynamic, schema-less data structures.
19+
20+
MongoDB is widely used for web, mobile, IoT, and real-time analytics workloads. Learn more from the [MongoDB official website](https://www.mongodb.com/) and its [official documentation](https://www.mongodb.com/docs/).
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
---
2+
title: MongoDB Baseline Testing
3+
weight: 5
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
10+
### 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.
12+
13+
1. Verify Installation & Service Health
14+
15+
```console
16+
ps -ef | grep mongod
17+
mongod --version
18+
netstat -tulnp | grep 27017
19+
```
20+
- **ps -ef | grep mongod** – Checks if the MongoDB server process is running.
21+
- **mongod --version** – Shows the version of MongoDB installed.
22+
- **netstat -tulnp | grep 27017** – Checks if MongoDB is listening for connections on its default port 27017.
23+
24+
You should see an output similar to:
25+
26+
```output
27+
mongod --version
28+
netstat -tulnp | grep 27017
29+
ubuntu 4288 1 0 10:40 ? 00:00:01 mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log --fork
30+
ubuntu 4545 1764 0 10:43 pts/0 00:00:00 grep --color=auto mongod
31+
db version v8.0.12
32+
Build Info: {
33+
"version": "8.0.12",
34+
"gitVersion": "b60fc6875b5fb4b63cc0dbbd8dda0d6d6277921a",
35+
"openSSLVersion": "OpenSSL 3.0.13 30 Jan 2024",
36+
"modules": [],
37+
"allocator": "tcmalloc-google",
38+
"environment": {
39+
"distmod": "ubuntu2404",
40+
"distarch": "aarch64",
41+
"target_arch": "aarch64"
42+
}
43+
}
44+
(Not all processes could be identified, non-owned process info
45+
will not be shown, you would have to be root to see it all.)
46+
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 4288/mongod
47+
```
48+
49+
2. Storage and Health Check
50+
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+
53+
```console
54+
fio --name=baseline --rw=randread --bs=4k --size=100M --numjobs=1 --time_based --runtime=30 --group_reporting
55+
```
56+
You should see an output similar to:
57+
58+
```output
59+
baseline: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
60+
fio-3.36
61+
Starting 1 process
62+
Jobs: 1 (f=1): [r(1)][100.0%][r=14.8MiB/s][r=3799 IOPS][eta 00m:00s]
63+
baseline: (groupid=0, jobs=1): err= 0: pid=3753: Mon Sep 1 10:25:07 2025
64+
read: IOPS=4255, BW=16.6MiB/s (17.4MB/s)(499MiB/30001msec)
65+
clat (usec): min=88, max=46246, avg=234.23, stdev=209.81
66+
lat (usec): min=88, max=46246, avg=234.28, stdev=209.81
67+
clat percentiles (usec):
68+
| 1.00th=[ 99], 5.00th=[ 111], 10.00th=[ 126], 20.00th=[ 167],
69+
| 30.00th=[ 190], 40.00th=[ 229], 50.00th=[ 243], 60.00th=[ 253],
70+
| 70.00th=[ 269], 80.00th=[ 289], 90.00th=[ 318], 95.00th=[ 330],
71+
| 99.00th=[ 416], 99.50th=[ 490], 99.90th=[ 799], 99.95th=[ 1106],
72+
| 99.99th=[ 3884]
73+
bw ( KiB/s): min=14536, max=19512, per=100.00%, avg=17046.10, stdev=1359.69, samples=59
74+
iops : min= 3634, max= 4878, avg=4261.53, stdev=339.92, samples=59
75+
lat (usec) : 100=1.27%, 250=56.61%, 500=41.65%, 750=0.34%, 1000=0.06%
76+
lat (msec) : 2=0.04%, 4=0.01%, 10=0.01%, 20=0.01%, 50=0.01%
77+
cpu : usr=0.33%, sys=2.93%, ctx=127668, majf=0, minf=8
78+
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
79+
submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
80+
complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
81+
issued rwts: total=127661,0,0,0 short=0,0,0,0 dropped=0,0,0,0
82+
latency : target=0, window=0, percentile=100.00%, depth=1
83+
84+
Run status group 0 (all jobs):
85+
READ: bw=16.6MiB/s (17.4MB/s), 16.6MiB/s-16.6MiB/s (17.4MB/s-17.4MB/s), io=499MiB (523MB), run=30001-30001msec
86+
87+
Disk stats (read/write):
88+
sda: ios=127195/29, sectors=1017560/552, merge=0/15, ticks=29133/8, in_queue=29151, util=96.37%
89+
```
90+
The output shows how fast it read data (**16.6 MB/s**) and how many reads it did per second (**~4255 IOPS**), which tells you how responsive your storage is for random reads.
91+
92+
3. Connectivity and CRUD Sanity Check
93+
94+
```console
95+
mongosh --host localhost --port 27017
96+
```
97+
98+
Inside shell:
99+
100+
```javascript
101+
use baselineDB
102+
db.testCollection.insertOne({ name: "baseline-check", value: 1 })
103+
db.testCollection.find()
104+
db.testCollection.updateOne({ name: "baseline-check" }, { $set: { value: 2 } })
105+
db.testCollection.deleteOne({ name: "baseline-check" })
106+
exit
107+
```
108+
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.
109+
110+
You should see an output similar to:
111+
112+
```output
113+
test> use baselineDB
114+
switched to db baselineDB
115+
baselineDB> db.testCollection.insertOne({ name: "baseline-check", value: 1 })
116+
{
117+
acknowledged: true,
118+
insertedId: ObjectId('689acdae6a86b49bca74e39a')
119+
}
120+
baselineDB> db.testCollection.find()
121+
[
122+
{
123+
_id: ObjectId('689acdae6a86b49bca74e39a'),
124+
name: 'baseline-check',
125+
value: 1
126+
}
127+
]
128+
baselineDB> db.testCollection.updateOne({ name: "baseline-check" }, { $set: { value: 2 } })
129+
...
130+
{
131+
acknowledged: true,
132+
insertedId: null,
133+
matchedCount: 1,
134+
modifiedCount: 1,
135+
upsertedCount: 0
136+
}
137+
baselineDB> db.testCollection.deleteOne({ name: "baseline-check" })
138+
...
139+
{ acknowledged: true, deletedCount: 1 }
140+
```
141+
142+
4. Basic Query Performance Test
143+
144+
```console
145+
mongosh --eval '
146+
db = db.getSiblingDB("baselineDB");
147+
for (let i=0; i<1000; i++) { db.perf.insertOne({index:i, value:Math.random()}) };
148+
var start = new Date();
149+
db.perf.find({ value: { $gt: 0.5 } }).count();
150+
print("Query Time (ms):", new Date() - start);
151+
'
152+
```
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.
154+
155+
You should see an output similar to:
156+
157+
```output
158+
Query Time (ms): 2
159+
```
160+
161+
5. Index Creation Speed Test
162+
163+
```console
164+
mongosh --eval '
165+
db = db.getSiblingDB("baselineDB");
166+
var start = new Date();
167+
db.perf.createIndex({ value: 1 });
168+
print("Index Creation Time (ms):", new Date() - start);
169+
'
170+
```
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.
172+
173+
You should see an output similar to:
174+
175+
```output
176+
Index Creation Time (ms): 22
177+
```
178+
179+
6. Concurrency Smoke Test
180+
181+
```console
182+
for i in {1..5}; do
183+
/usr/bin/mongosh --eval 'use baselineDB; db.concurrent.insertMany([...Array(1000).keys()].map(k => ({ test: k, ts: new Date() })))' &
184+
done
185+
wait
186+
```
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**.
189+
190+
You should see an output similar to:
191+
192+
```output
193+
[1] 3818
194+
[2] 3819
195+
[3] 3820
196+
[4] 3821
197+
[5] 3822
198+
switched to db baselineDB;
199+
[1] Done mongosh --eval 'use baselineDB; db.concurrent.insertMany([...Array(1000).keys()].map(k => ({ test: k, ts: new Date() })))'
200+
switched to db baselineDB;
201+
switched to db baselineDB;
202+
switched to db baselineDB;
203+
[2] Done mongosh --eval 'use baselineDB; db.concurrent.insertMany([...Array(1000).keys()].map(k => ({ test: k, ts: new Date() })))'
204+
[4]- Done mongosh --eval 'use baselineDB; db.concurrent.insertMany([...Array(1000).keys()].map(k => ({ test: k, ts: new Date() })))'
205+
[3]- Done mongosh --eval 'use baselineDB; db.concurrent.insertMany([...Array(1000).keys()].map(k => ({ test: k, ts: new Date() })))'
206+
switched to db baselineDB;
207+
[5]+ Done mongosh --eval 'use baselineDB; db.concurrent.insertMany([...Array(1000).keys()].map(k => ({ test: k, ts: new Date() })))'
208+
```
209+
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.
211+
212+
The above operations confirm that MongoDB is installed successfully and is functioning as expected on the Azure Cobalt 100 (Arm64) environment.
213+
214+
Now, your MongoDB instance is ready for further benchmarking and production use.

0 commit comments

Comments
 (0)