Get the App
SLTechnology News&Howtos  ›  Database  › 

Stress Test of MONGODB

Shulou Source: shulou.com Published: 2022-06-01 16:53:36 10月30日 Update

According to the needs of the business, the stress test of the online server to understand a peak in the running process. Stress testing of MONGODB is mainly used through the mongo-mload tool.

Download the http://down.51cto.com/data/2287216### toolkit

Testing process:

1. Clean the database:

Go run mload.go-host 127.0.0.1-clean true

2. Insert data

Go run mload.go-- host 127.0.0.1-- datanum 10000-- procnum 8-- cpunum 8-- jsonfile. / test_data.json-- operation insert

First clean up the database:

Go run mload.go-host 127.0.0.1-clean true

Then prepare the data for the query (for example, 1000000 items):

Go run mload.go-- host 127.0.0.1-- datanum 1000000-- procnum 1-- operation prepare

Next, test (of limit one):

Use 8-core cpu,8 concurrency

Go run mload.go-host 127.0.0.1-datanum 1000000-procnum 8-cpunum 8-operation query

In the process of non-limit one

Use 8-core cpu,8 concurrency

Go run mload.go-- host 127.0.0.1-- datanum 1000000-- procnum 8-- cpunum 8-- operation query-- queryall true

First clean up the database:

Go run mload.go-host 127.0.0.1-clean true

Then prepare the data for the query (for example, 1000000 items):

Go run mload.go-host 127.0.0.1-datanum 1000000-procnum 1-logpath / tmp/log.log-operation prepare

And then run the test.

Go run mload.go-host 127.0.0.1-datanum 1000000-procnum 1-logpath / tmp/log.log-operation tps

Update test

First clean up the database:

Go run mload.go-host 127.0.0.1-clean true

Then prepare the data for the query (for example, 1000000 items):

Go run mload.go-- host 127.0.0.1-- datanum 10-- procnum 1-- operation prepare

Let's do the update pressure test.

Go run mload.go-- host 127.0.0.1-- datanum 1-- procnum 10-- operation update

Geo query test

First clean up the database:

Go run mload.go-host 127.0.0.1-clean true

Then prepare the data for the query (for example, 1000000 items):

Go run mload.go-- host 127.0.0.1-- datanum 100000-- procnum 2-- operation prepare

Go run mload.go-host 127.0.0.1-- datanum 100000-- procnum 2-- operation prepare-- db test-- collection testccc-- geofield gps-- geo

Next, test (of limit one):

Use 8-core cpu,8 concurrency

Go run mload.go-host 127.0.0.1-datanum 100000-procnum 8-cpunum 4-operation query-geofield loc-geo true

Go run mload.go-host 127.0.0.1-datanum 100000-procnum 8-cpunum 4-operation query-db metok_core-collection cell_position-geofield loc-geo

In the process of non-limit one

Use 8-core cpu,8 concurrency

Go run mload.go-host 127.0.0.1-datanum 100000-procnum 8-cpunum 4-operation query-queryall true-geofield loc-geo true

Go run mload.go-host 127.0.0.1-datanum 100000-procnum 8-cpunum 4-operation query-queryall true-db metok_core-collection cell_position-geofield loc-geo

Tags: Data test preparation database query stress next tools process business peak toolkit server requirements update service run Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Tech Info macOS Redmi Linux