Skip to content

Commit

Permalink
Merge pull request #1468 from jasonrandrews/review
Browse files Browse the repository at this point in the history
Continue reviewing MongoDB, moving to draft during
  • Loading branch information
jasonrandrews authored Dec 20, 2024
2 parents 93243e0 + 72ac724 commit 1bfc962
Show file tree
Hide file tree
Showing 9 changed files with 229 additions and 192 deletions.
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
---
armips:
- Neoverse
title: Test the performance of MongoDB on Arm servers

draft: true
cascade:
draft: true

author_primary: Pareena Verma
layout: learningpathall
learning_objectives:
- Install and run MongoDB on an Arm server
- Test MongoDB performance using open-source tooling
- Measure and compare the performance of MongoDB on Arm versus other architectures with Yahoo Cloud Serving Benchmark (YCSB)
learning_path_main_page: 'yes'

minutes_to_complete: 30

learning_objectives:
- Install and run MongoDB on an Arm server.
- Test MongoDB performance using open-source tooling.
- Measure and compare the performance of MongoDB on Arm versus other architectures with Yahoo Cloud Serving Benchmark (YCSB).

prerequisites:
- An Arm based instance from a cloud service provider. The recommend YCSB configuration requires a cluster of 3 Arm servers.

armips:
- Neoverse

operatingsystems:
- Linux
prerequisites:
- An Arm based instance from a cloud service provider.

layout: learningpathall
learning_path_main_page: 'yes'
skilllevels: Introductory
subjects: Databases
test_images:
- mongo:latest
test_link: https://github.com/armflorentlebeau/arm-learning-paths/actions/runs/4312122327
test_maintenance: true
test_status:
- passed
title: Test the performance of MongoDB on Arm servers
test_maintenance: false
tools_software_languages:
- MongoDB
- GCC
- Snort

weight: 1
who_is_this_for: This is an introductory topic for software developers using MongoDB
as their database for mobile, IoT applications, content management, or real-time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# User change
title: "Automate MongoDB Performance Benchmarking Infrastructure Setup with Pulumi"

weight: 5 # (intro is 1), 2 is first, 3 is second, etc.
weight: 8 # (intro is 1), 2 is first, 3 is second, etc.

draft: true

# Do not modify these elements
layout: "learningpathall"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# User change
title: "Benchmark MongoDB 7.0 on Arm with Yahoo Cloud Serving Benchmark (YCSB)"

weight: 4 # (intro is 1), 2 is first, 3 is second, etc.
draft: true

weight: 20 # (intro is 1), 2 is first, 3 is second, etc.

# Do not modify these elements
layout: "learningpathall"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,46 +1,54 @@
---
# User change
title: "Benchmark MongoDB 8.0 on Arm with Yahoo Cloud Serving Benchmark (YCSB)"
title: "Benchmark MongoDB on Arm with Yahoo Cloud Serving Benchmark (YCSB)"

weight: 4 # (intro is 1), 2 is first, 3 is second, etc.

# Do not modify these elements
layout: "learningpathall"
---
To further measure the performance of MongoDB, you will run the [Yahoo Cloud Serving Benchmark](http://github.com/brianfrankcooper/YCSB).

YCSB is an open sourced project which provides the framework and common set of workloads to evaluate the performance of different "key-value" and "cloud" serving stores. Here are the steps to run YCSB to evaluate the performance of MongoDB running on 64-bit Arm machine.
To further measure the performance of MongoDB, you can run the [Yahoo Cloud Serving Benchmark](http://github.com/brianfrankcooper/YCSB).

## Additional software packages
YCSB is an open source project which provides the framework and common set of workloads to evaluate the performance of different "key-value" and "cloud" serving stores. Use the steps below to run YCSB to evaluate the performance of MongoDB running on 64-bit Arm machine.

To run YCSB, additional software packages are required: default-jdk, default-jre, maven, make and Python.
## Additional software packages

To run YCSB, additional software packages are required.

Install all other packages:
Install the additional software:

{{< tabpane code=true >}}
{{< tab header="Ubuntu" >}}
sudo apt-get update
sudo apt install -y default-jre default-jdk maven make gcc
{{< /tab >}}
sudo apt install -y maven make gcc
{{< /tab >}}
{{< tab header="RHE/Amazon" >}}
sudo yum check-update
sudo yum install python2
{{< /tab >}}
{{< /tabpane >}}
{{% notice Python Note%}}

For Ubuntu 22.04 and 24.04 the `python` package may not be found. You can install Python 2.7 using:
For Ubuntu 22.04 and 24.04, Python 2 is not available using the package manager.

You can install Python 2.7 using:

```console
cd $HOME
wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
tar xvf Python-2.7.18.tgz
cd Python-2.7.18
sudo ./configure --enable-optimizations
make altinstall
ln -s /usr/local/bin/python2.7 /usr/bin/python
./configure --enable-optimizations
make -j $nproc
sudo make altinstall
sudo ln -s /usr/local/bin/python2.7 /usr/local/bin/python
```
{{% /notice %}}

## Setup YCSB

Download the latest released YCSB zip file and uncompress it.

```bash
cd $HOME
mkdir ycsb && cd ycsb
curl -O --location https://github.com/brianfrankcooper/YCSB/releases/download/0.17.0/ycsb-0.17.0.tar.gz
tar xfvz ycsb-0.17.0.tar.gz
Expand All @@ -53,36 +61,24 @@ cd ycsb-0.17.0
./bin/ycsb
```

## Most Common MongoDB Test Setup

The recommended test setup is a relica set. Which contains three nodes each of equal size. A primary will be the node you send the YCSB traffic to.

## Recommended Tests on MongoDB
## Load/Insert Test on MongoDB

The most common real world test to run is a 95/5 test, 95% read and 5% update. 100/0 and 90/10 are also popular. Run the following commands for about 5 mins before collecting data.
To load and test the performance of loading data(INSERT) into default database `ycsb` at `localhost:27017` where MongoDB is running using the synchronous driver run the following command:

Load the dataset
```console
./bin/ycsb load mongodb -s -P workloads/workloadb -p mongodb.url=mongodb://localhost:27017 -p compressibility=2 -p fieldlengthdistribution=zipfian -p minfieldlength=50 -threads 64 -p recordcount=20000000
./bin/ycsb load mongodb -s -P workloads/workloada -p mongodb.url=mongodb://localhost:27017/ycsb?w=0 -threads 10
```
The "-P" parameter is used to load property files. In this example, you used it load the workloada parameter file which sets the recordcount to 1000 in addition to other parameters. The "-threads" parameter indicates the number of threads and is set to 1 by default.

95/5
```console
./bin/ycsb run mongodb -s -P workloads/workloadb -p mongodb.url=mongodb://localhost:27017 -p minfieldlength=50 -p compressibility=2 -p maxexecutiontime=120 -threads 64 -p operationcount=40000000 -p recordcount=20000000 -p requestdistribution=zipfian -p readproportion=0.95 -p updateproportion=0.05
## Update/Read/Read Modify Write Test on MongoDB

```
To test the performance of executing a workload which includes running UPDATE, Read Modify Write(RMW) and/or READ operations on the data using 10 threads for example, use the following command:

100/0
```console
./bin/ycsb run mongodb -s -P workloads/workloadc -p mongodb.url=mongodb://Localhost:27017 -p minfieldlength=50 -p compressibility=2 -p maxexecutiontime=120 -threads 64 -p operationcount=40000000 -p recordcount=20000000 -p requestdistribution=zipfian -p readproportion=1.0 -p updateproportion=0.0

./bin/ycsb load mongodb -s -P workloads/workloada -p mongodb.url=mongodb://localhost:27017/ycsb?w=0
```

90/10
```console
./bin/ycsb run mongodb -s -P workloads/workloadb -p mongodb.url=mongodb://localhost:27017 -p minfieldlength=50 -p compressibility=2 -p maxexecutiontime=120 -threads 64 -p operationcount=40000000 -p recordcount=20000000 -p requestdistribution=zipfian -p readproportion=0.90 -p updateproportion=0.10

```
The workloads/workloada file in this example sets the following values `readproportion=0.5` and `updateproportion=0.5` which means there is an even split between the number of READ and UPDATE operations performed. You can change the type of operations and the splits by providing your own workload parameter file.

For more detailed information on all the parameters for running a workload refer to [this section](https://github.com/brianfrankcooper/YCSB/wiki/Running-a-Workload).

Expand Down Expand Up @@ -118,7 +114,6 @@ At the end of each test, statistics are printed to the console. Shown below is t
[INSERT], Return=OK, 1000
...
```
## Other tests

For instructions on running any other tests or more details on the metrics reported, refer to the [GitHub project for the YCSB](https://github.com/brianfrankcooper/YCSB/wiki/).
Continue to the next section to run YCSB on a 3 node cluster.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@
# User change
title: "MongoDB test configuration and setup"

weight: 3 # 1 is first, 2 is second, etc.
draft: true

weight: 30 # 1 is first, 2 is second, etc.

# Do not modify these elements
layout: "learningpathall"
---
The most popular test setup for read world testing is a replica set. A replica set of three equal sized nodes is created and initiated.

The most popular test setup for real world testing is a replica set. A replica set of three equal sized nodes is created and initiated.

## What is a replica Set?
A replica set is a group of instances that maintain the same data set. A replica set contains many nodes and in our test three nodes. Out of the three nodes, one and only one member is the primary node, while the other nodes are secondary nodes.

A replica set is a group of instances that maintain the same data set. A replica set contains many nodes, and in this test it is 3 nodes. Of the 3 nodes, one node is the primary node, while the other nodes are secondary nodes.

## What node size should I use?
The most common size for testing MongoDB is a 8vCPU instance. You are welcome to test with any sized machine. But If you are looking for ideal testing conditionals 8 is more than enough. 32 Gb of ram is recommended for testing.

The most common size for testing MongoDB is an 8 vCPU instance. You can test with any sized machine, but if you are looking for ideal testing conditions 8 nodes is enough. Each node should have 32GB of RAM.

## How should I run this test?
It is recommended to avoid disk and keep the complete date set within memory. The recommended configuration is below and will be explains in detail.

You should keep the complete data set in memory. Additional details abut the recommended configuration are provided below.

## Mongod.conf

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Install the appropriate run-time environment to be able to use the performance t

{{< tabpane code=true >}}
{{< tab header="Ubuntu" >}}
sudo apt-get install -y openjdk-18-jre
sudo apt install default-jre default-jdk -y
{{< /tab >}}
{{< tab header="RHE/Amazon" >}}
sudo yum install java-17-openjdk
Expand Down Expand Up @@ -64,9 +64,11 @@ As the test runs, the count will be printed periodically. It will increase until
## Run Update-one test

Similarly, to run this test, updating one document per query using 10, 20 and finally 30 threads for 1 hour each run (3 hours in total) run the following command:

```console
java -jar $jarfile -m update_one -d 3600 -t 10 20 30 -db test -c perf
```

For instructions on running any other tests or more details on the metrics reported, refer to the [github project for the performance tool](https://github.com/idealo/mongodb-performance-test#readme).

## View the results
Expand Down
Loading

0 comments on commit 1bfc962

Please sign in to comment.