https://github.com/parse-community/benchmark
Parse Server Continuous Benchmark
https://github.com/parse-community/benchmark
benchmark mongodb parse-server postgres
Last synced: 7 months ago
JSON representation
Parse Server Continuous Benchmark
- Host: GitHub
- URL: https://github.com/parse-community/benchmark
- Owner: parse-community
- License: apache-2.0
- Created: 2019-08-15T23:28:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-25T11:56:42.000Z (over 2 years ago)
- Last Synced: 2025-06-17T07:34:13.924Z (7 months ago)
- Topics: benchmark, mongodb, parse-server, postgres
- Language: JavaScript
- Homepage: https://benchmark.parseplatform.org/
- Size: 5.61 MB
- Stars: 25
- Watchers: 4
- Forks: 10
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Benchmark for Parse Server
A HTTP/1.1 benchmarking tool for Parse Server backends.
## Getting Started
Parse Benchmark is a highly configurable tool for testing Parse Server [instances][server] against different [load tests][benchmark].
This tool also features a trigger bot that queues merged pull requests on [Parse Server][parse-server] repo and runs benchmarks.
The results can be view on the benchmark [website][website].
### Setup Mongodb
```
$ npm install -g mongodb-runner
$ mongodb-runner start
```
***Note:*** *If installation with* `-g` *fails due to permission problems* (`npm ERR! code 'EACCES'`), *please refer to [this link][npm-permissions].*
### Setup PostgreSQL
Install [PostgreSQL][postgres].
If you have Mac the [PostgreSQL App][postgres-app] is recommended.
```
$ psql -c 'create database parse_benchmark;' -U postgres
$ psql -c 'CREATE EXTENSION postgis;' -U postgres -d parse_benchmark
$ psql -c 'CREATE EXTENSION postgis_topology;' -U postgres -d parse_benchmark
```
## Running Benchmark
### Locally
```
$ git clone https://github.com/parse-community/benchmark.git
$ cd benchmark
$ npm install
$ npm start
```
### Usage
```
-c, --connections The number of concurrent connections to use. default: 10.
-p, --pipelining The number of pipelined requests to use. default: 1.
-d, --duration The number of seconds to run the autocannnon. default: 10.
-o, --output Output to JSON file. default: result.json
-h, --help output usage information
```
#### One to One Benchmark
You can pass in the file name of the [server][server] and [benchmark][benchmark] to test against.
```
$ npm start -- test # runs one to one benchmark test
```
Example: [servers/mongo][server] [benchmarks/get][benchmark]
```
# 100 connections, 1 thread, run for 20 seconds
$ npm start -- test mongo get -c 100 -p 1 -d 20
```
#### All Benchmarks
```
$ npm start -- run
```
#### Connect to any server
This tool uses [autocannon][autocannon] under the hood. You can pass options directly to run against any server.
The is a sample json file [options.sample.json](options.sample.json).
Learn more about options [here][autocannon-options].
```
$ npm start -- options
```
### Environment Variables
```
PARSE_APP_NAME: 'Parse Server Benchmark',
PARSE_APP_ID: 'app-id',
PARSE_JAVASCRIPT_KEY: 'javascript-key',
PARSE_MASTER_KEY: 'master-key',
PARSE_MOUNT_PATH: '/',
PARSE_PORT: 1337,
SERVER_URL: 'http://localhost:1337`,
DATABASE_URL: 'postgres://localhost:5432/parse_benchmark',
MONGODB_URI: 'mongodb://localhost:27017/parse_benchmark',
COLLECTION_PREFIX: 'test_',
VERBOSE: false,
CLEAR: false, # If set clears database before each test
```
## Debugging
You can track the progress of your benchmark setting the `DEBUG=1` environment variable.
You can generate detailed server logs by setting `VERBOSE=1`.
## Roadmap
You can track the progress of this project [here][project].
[autocannon]: https://github.com/mcollina/autocannon
[autocannon-options]: https://github.com/mcollina/autocannon#usage
[benchmark]: https://github.com/parse-community/benchmark/tree/master/benchmarks
[project]: https://github.com/parse-community/benchmark/projects
[server]: https://github.com/parse-community/benchmark/tree/master/servers
[parse-server]: https://github.com/parse-community/parse-server
[website]: http://benchmark.parseplatform.org
[npm-permissions]: https://docs.npmjs.com/getting-started/fixing-npm-permissions
[postgres]: https://www.postgresql.org/download/
[postgres-app]: https://postgresapp.com