Skip to content

Commit 631188b

Browse files
Updates
1 parent 42ca893 commit 631188b

File tree

2 files changed

+34
-31
lines changed

2 files changed

+34
-31
lines changed

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

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@ weight: 5
66
layout: learningpathall
77
---
88

9-
10-
### Baseline testing of MongoDB
9+
## Baseline testing of MongoDB
1110
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.
1211

13-
1. Verify Installation & Service Health
12+
## Verify MongoDB installation and service health (Azure Cobalt 100 Arm64)
1413

1514
```console
1615
ps -ef | grep mongod
1716
mongod --version
1817
netstat -tulnp | grep 27017
1918
```
20-
An explanation of what each command is doing:
21-
- **ps -ef | grep mongod** – Checks if the MongoDB server process is running.
22-
- **mongod --version** – Shows the version of MongoDB installed.
23-
- **netstat -tulnp | grep 27017** – Checks if MongoDB is listening for connections on its default port 27017.
19+
What each command does:
20+
- **ps -ef | grep mongod** checks if the MongoDB server process is running
21+
- **mongod --version** shows the installed MongoDB version
22+
- **netstat -tulnp | grep 27017** confirms MongoDB is listening on the default port 27017
2423

2524
You should see output similar to:
2625

@@ -47,9 +46,9 @@ Build Info: {
4746
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 4288/mongod
4847
```
4948

50-
2. Storage and Health Check
49+
## Run storage baseline with fio (random read IOPS on Ubuntu 24.04):
5150

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:
51+
This reads random 4 KB blocks from a 100 MB file for 30 seconds with one job and prints a summary
5352

5453
```console
5554
fio --name=baseline --rw=randread --bs=4k --size=100M --numjobs=1 --time_based --runtime=30 --group_reporting
@@ -70,7 +69,7 @@ baseline: (groupid=0, jobs=1): err= 0: pid=3753: Mon Sep 1 10:25:07 2025
7069
| 30.00th=[ 190], 40.00th=[ 229], 50.00th=[ 243], 60.00th=[ 253],
7170
| 70.00th=[ 269], 80.00th=[ 289], 90.00th=[ 318], 95.00th=[ 330],
7271
| 99.00th=[ 416], 99.50th=[ 490], 99.90th=[ 799], 99.95th=[ 1106],
73-
| 99.99th=[ 3884]
72+
| 99.99th=[ 3884]
7473
bw ( KiB/s): min=14536, max=19512, per=100.00%, avg=17046.10, stdev=1359.69, samples=59
7574
iops : min= 3634, max= 4878, avg=4261.53, stdev=339.92, samples=59
7675
lat (usec) : 100=1.27%, 250=56.61%, 500=41.65%, 750=0.34%, 1000=0.06%
@@ -90,7 +89,7 @@ Disk stats (read/write):
9089
```
9190
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.
9291

93-
3. Connectivity and CRUD Sanity Check
92+
## Connectivity and CRUD Sanity Check
9493

9594
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:
9695

@@ -103,7 +102,7 @@ D - Delete: Remove a record.
103102
mongosh --host localhost --port 27017
104103
```
105104

106-
Inside shell:
105+
Inside the shell:
107106

108107
```javascript
109108
use baselineDB
@@ -113,7 +112,11 @@ db.testCollection.updateOne({ name: "baseline-check" }, { $set: { value: 2 } })
113112
db.testCollection.deleteOne({ name: "baseline-check" })
114113
exit
115114
```
116-
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.
115+
What these commands do:
116+
- Create a test document
117+
- Read it
118+
- Update its value
119+
- Delete it
117120

118121
You should see output similar to:
119122

@@ -147,9 +150,9 @@ baselineDB> db.testCollection.deleteOne({ name: "baseline-check" })
147150
{ acknowledged: true, deletedCount: 1 }
148151
```
149152

150-
4. Basic Query Performance Test
153+
## Basic query performance test (count filter)
151154

152-
You will now perform a lightweight query performance check:
155+
Run a lightweight query performance check:
153156

154157
```console
155158
mongosh --eval '
@@ -160,17 +163,18 @@ db.perf.find({ value: { $gt: 0.5 } }).count();
160163
print("Query Time (ms):", new Date() - start);
161164
'
162165
```
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.
166+
This connects to MongoDB, selects the `baselineDB` database, inserts 1,000 documents into the `perf` collection, and measures the time to count documents where `value > 0.5`
164167

165-
You should see the Query Time output similar to:
168+
You should see output similar to:
166169

167170
```output
168171
Query Time (ms): 2
169172
```
170173

171-
5. Index Creation Speed Test
174+
## Index creation speed test in MongoDB
175+
176+
Measure how long MongoDB takes to create an index on a collection:
172177

173-
You will now run a performance sanity check that measures how long MongoDB takes to create an index on a given collection:
174178
```console
175179
mongosh --eval '
176180
db = db.getSiblingDB("baselineDB");
@@ -179,28 +183,27 @@ db.perf.createIndex({ value: 1 });
179183
print("Index Creation Time (ms):", new Date() - start);
180184
'
181185
```
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.
186+
This creates an index on the `value` field in the `perf` collection and prints the time taken
183187

184188
You should see output similar to:
185189

186190
```output
187191
Index Creation Time (ms): 22
188192
```
189193

190-
6. Concurrency Smoke Test
194+
## Concurrency smoke test with parallel mongosh sessions
191195

192-
You will now verify that MongoDB can handle concurrent client connections and inserts without errors:
196+
Verify that MongoDB can handle concurrent client connections and inserts
193197

194198
```console
195199
for i in {1..5}; do
196200
mongosh --eval 'use baselineDB; db.concurrent.insertMany([...Array(1000).keys()].map(k => ({ test: k, ts: new Date() })))' &
197201
done
198202
wait
199203
```
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.
204+
This runs five parallel MongoDB shell sessions, each inserting 1,000 documents into the `baselineDB.concurrent` collection.
202205

203-
You should see an output similar to:
206+
You should see output similar to
204207

205208
```output
206209
[1] 3818

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ weight: 4
66
layout: learningpathall
77
---
88

9-
## Install MongoDB and mongosh on the Ubuntu Pro 24.04 LTS Arm instance
9+
## Getting started
1010

11-
Install MongoDB and `mongosh on Ubuntu Pro 24.04 LTS (Arm64) by downloading the binaries, setting up environment paths, configuring data and log directories, and starting the server for local access and verification.
11+
Install MongoDB and `mongosh` on Ubuntu Pro 24.04 LTS (Arm64) by downloading the binaries, setting up environment paths, configuring data and log directories, and starting the server for local access and verification.
1212

1313
## Install system dependencies
1414

@@ -58,9 +58,9 @@ forked process: 3356
5858
child process started successfully, parent exiting
5959
```
6060

61-
6. **Install mongosh**
61+
## Install mongosh
6262

63-
**mongosh** is the MongoDB shell used to interact with your MongoDB server. It provides a modern, user-friendly CLI for running queries and database operations.
63+
`Mongosh` is the MongoDB shell used to interact with your MongoDB server. It provides a modern, user-friendly CLI for running queries and database operations.
6464

6565
Download and install the MongoDB shell for Arm:
6666
```console
@@ -75,7 +75,7 @@ echo 'export PATH=/usr/local/mongosh/bin:$PATH' | sudo tee /etc/profile.d/mongos
7575
source /etc/profile.d/mongosh.sh
7676
```
7777

78-
### Verify MongoDB and mongosh installation
78+
## Verify MongoDB and mongosh installation
7979

8080
Check if MongoDB and `mongosh` are properly installed on your machine:
8181
```console
@@ -100,7 +100,7 @@ Build Info: {
100100
2.3.8
101101
```
102102

103-
### Connect to MongoDB via mongosh
103+
## Connect to MongoDB using mongosh
104104

105105
Start interacting with MongoDB through the shell:
106106
```console

0 commit comments

Comments
 (0)