# mongo-stress **Repository Path**: shiner-chen/mongo-stress ## Basic Information - **Project Name**: mongo-stress - **Description**: stress tool for MongoDB - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-08-19 - **Last Updated**: 2025-08-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README This repository is forked from [influxdata/influx-stress](https://github.com/influxdata/influx-stress). It is modified to support MongoDB. # Stress tool ## Build Instructions Building `mongo-stress` requires the Golang toolchain. If you do not have the Golang toolchain installed please follow the instructions [golang.org/doc/install](https://golang.org/doc/install) ```sh git clone https://gitee.com/shiner-chen/mongo-stress.git cd mongo-stress go build -o mongo-stress cmd/mongo-stress/main.go ``` ## Top Level Command ``` Create artificial load on an InfluxDB instance Usage: mongo-stress [command] Available Commands: insert Insert data into MongoDB Flags: -h, --help help for mongo-stress Use "mongo-stress [command] --help" for more information about a command. ``` ## Insert Subcommand ```bash Insert data into MongoDB Usage: influx-stress insert SERIES FIELDS [flags] Flags: -b, --batch-size uint number of points in a batch (default 10000) --create string Use a custom create database command --db string Database that will be written to (default "stress") --dump string Dump to given file instead of writing over HTTP -f, --fast Run as fast as possible --host string Address of InfluxDB instance (default "http://localhost:8086") -n, --points uint number of points that will be written (default 18446744073709551615) --pps uint Points Per Second (default 200000) -p, --precision string Resolution of data being written (default "n") -q, --quiet Only print the write throughput -r, --runtime duration Total time that the test will run (default 2562047h47m16.854775807s) -s, --series int number of series that will be written (default 100000) --strict Strict mode will exit as soon as an error or unexpected status is encountered ``` ## Example Usage Writing an example series key with 2000 series and 400000 points per second ```bash $ mongo-stress insert --host mongodb://localhost:27017 --db stress --collection sensor -s 2000 -r 5s --pps 400000 "tags=sensor,region" "fields=temperature:float" ```