|
| 1 | +--- |
| 2 | +# User change |
| 3 | +title: "Benchmark MongoDB 7.0 on Arm with Yahoo Cloud Serving Benchmark (YCSB)" |
| 4 | + |
| 5 | +weight: 4 # (intro is 1), 2 is first, 3 is second, etc. |
| 6 | + |
| 7 | +# Do not modify these elements |
| 8 | +layout: "learningpathall" |
| 9 | +--- |
| 10 | +To further measure the performance of MongoDB, you will run the [Yahoo Cloud Serving Benchmark](http://github.com/brianfrankcooper/YCSB). |
| 11 | + |
| 12 | +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. |
| 13 | + |
| 14 | +## Additional software packages |
| 15 | + |
| 16 | +To run YCSB, additional software packages are required, [Apache Maven](https://maven.apache.org/), and [Python](https://www.python.org) 2.7. |
| 17 | + |
| 18 | +Installing Apache Maven: |
| 19 | + |
| 20 | +```bash |
| 21 | + cd ~ |
| 22 | + wget https://archive.apache.org/dist/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz |
| 23 | + sudo tar xzf apache-maven-*-bin.tar.gz -C /usr/local |
| 24 | + cd /usr/local |
| 25 | + sudo ln -s apache-maven-* maven |
| 26 | + cd ~/ |
| 27 | + export M2_HOME=/usr/local/maven |
| 28 | + export PATH="$M2_HOME/bin:$PATH" |
| 29 | +``` |
| 30 | + |
| 31 | +Installing Python 2.7: |
| 32 | + |
| 33 | +{{< tabpane code=true >}} |
| 34 | + {{< tab header="Ubuntu" >}} |
| 35 | +sudo apt-get update |
| 36 | +sudo apt install python -y |
| 37 | +{{< /tab >}} |
| 38 | +{{< tab header="RHE/Amazon" >}} |
| 39 | +sudo yum check-update |
| 40 | +sudo yum install python2 |
| 41 | +{{< /tab >}} |
| 42 | +{{< /tabpane >}} |
| 43 | +{{% notice Python Note%}} |
| 44 | + |
| 45 | +For Ubuntu 22.04 the `python` package may not be found. You can install Python 2.7 using: |
| 46 | +```console |
| 47 | +sudo apt install python2 -y |
| 48 | +sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1 |
| 49 | +``` |
| 50 | + |
| 51 | +For Red Hat you can configure `python2` to be the default `python` using: |
| 52 | +```console |
| 53 | +sudo alternatives --set python /usr/bin/python2 |
| 54 | +``` |
| 55 | +{{% /notice %}} |
| 56 | + |
| 57 | +## Setup YCSB |
| 58 | + |
| 59 | +Download the latest released YCSB zip file and uncompress it. |
| 60 | + |
| 61 | +```bash { pre_cmd="sudo apt install -y python" } |
| 62 | +mkdir ycsb && cd ycsb |
| 63 | +curl -O --location https://github.com/brianfrankcooper/YCSB/releases/download/0.17.0/ycsb-0.17.0.tar.gz |
| 64 | +tar xfvz ycsb-0.17.0.tar.gz |
| 65 | +``` |
| 66 | +Now `cd` into project folder and run the executable to print a description of how to use the benchmark. |
| 67 | + |
| 68 | +```bash { env="M2_HOME=/usr/local/maven,PATH=/usr/local/maven/bin:$PATH",cwd="./ycsb",ret_code="2" } |
| 69 | +cd ycsb-0.17.0 |
| 70 | +./bin/ycsb |
| 71 | +``` |
| 72 | +## Load/Insert Test on MongoDB |
| 73 | + |
| 74 | +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: |
| 75 | + |
| 76 | +```console |
| 77 | +./bin/ycsb load mongodb -s -P workloads/workloada -p mongodb.url=mongodb://localhost:27017/ycsb?w=0 -threads 10 |
| 78 | +``` |
| 79 | +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. |
| 80 | + |
| 81 | +## Update/Read/Read Modify Write Test on MongoDB |
| 82 | + |
| 83 | +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: |
| 84 | + |
| 85 | +```console |
| 86 | +./bin/ycsb load mongodb -s -P workloads/workloada -p mongodb.url=mongodb://localhost:27017/ycsb?w=0 |
| 87 | +``` |
| 88 | + |
| 89 | +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. |
| 90 | + |
| 91 | +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). |
| 92 | + |
| 93 | +## View the results |
| 94 | + |
| 95 | +At the end of each test, statistics are printed to the console. Shown below is the output from the end of Load/Insert test |
| 96 | + |
| 97 | +```output |
| 98 | +2022-07-06 15:50:18:917 1 sec: 1000 operations; 542.01 current ops/sec; [CLEANUP: Count=10, Max=12951, Min=0, Avg=1295.2, 90=4, 99=12951, 99.9=12951, 99.99=12951] [INSERT: Count=1000, Max=134655, Min=561, Avg=8506.37, 90=10287, 99=39903, 99.9=134015, 99.99=134655] |
| 99 | +[OVERALL], RunTime(ms), 1849 |
| 100 | +[OVERALL], Throughput(ops/sec), 540.8328826392644 |
| 101 | +[TOTAL_GCS_Copy], Count, 5 |
| 102 | +[TOTAL_GC_TIME_Copy], Time(ms), 23 |
| 103 | +[TOTAL_GC_TIME_%_Copy], Time(%), 1.2439156300703083 |
| 104 | +[TOTAL_GCS_MarkSweepCompact], Count, 0 |
| 105 | +[TOTAL_GC_TIME_MarkSweepCompact], Time(ms), 0 |
| 106 | +[TOTAL_GC_TIME_%_MarkSweepCompact], Time(%), 0.0 |
| 107 | +[TOTAL_GCs], Count, 5 |
| 108 | +[TOTAL_GC_TIME], Time(ms), 23 |
| 109 | +[TOTAL_GC_TIME_%], Time(%), 1.2439156300703083 |
| 110 | +[CLEANUP], Operations, 10 |
| 111 | +[CLEANUP], AverageLatency(us), 1295.2 |
| 112 | +[CLEANUP], MinLatency(us), 0 |
| 113 | +[CLEANUP], MaxLatency(us), 12951 |
| 114 | +[CLEANUP], 95thPercentileLatency(us), 12951 |
| 115 | +[CLEANUP], 99thPercentileLatency(us), 12951 |
| 116 | +[INSERT], Operations, 1000 |
| 117 | +[INSERT], AverageLatency(us), 8506.367 |
| 118 | +[INSERT], MinLatency(us), 561 |
| 119 | +[INSERT], MaxLatency(us), 134655 |
| 120 | +[INSERT], 95thPercentileLatency(us), 11871 |
| 121 | +[INSERT], 99thPercentileLatency(us), 39903 |
| 122 | +[INSERT], Return=OK, 1000 |
| 123 | +... |
| 124 | +``` |
| 125 | +## Other tests |
| 126 | + |
| 127 | +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/). |
| 128 | + |
0 commit comments