{"id":20265013,"url":"https://github.com/domodwyer/mpjbt","last_synced_at":"2025-04-11T02:32:00.604Z","repository":{"id":57525821,"uuid":"105001635","full_name":"domodwyer/mpjbt","owner":"domodwyer","description":"MongoDB/PostgreSQL JSON benchmark tool (and slides) for Percona EU 2017","archived":false,"fork":false,"pushed_at":"2024-02-14T18:04:53.000Z","size":884,"stargazers_count":26,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T23:51:30.434Z","etag":null,"topics":["benchmark","mongodb","percona","postgres"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/domodwyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-27T09:51:27.000Z","updated_at":"2023-11-01T18:24:50.000Z","dependencies_parsed_at":"2024-02-14T19:58:31.789Z","dependency_job_id":"aac3c402-cf47-41e1-ab19-eac6a56608ed","html_url":"https://github.com/domodwyer/mpjbt","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domodwyer%2Fmpjbt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domodwyer%2Fmpjbt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domodwyer%2Fmpjbt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domodwyer%2Fmpjbt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/domodwyer","download_url":"https://codeload.github.com/domodwyer/mpjbt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248329633,"owners_count":21085571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","mongodb","percona","postgres"],"created_at":"2024-11-14T11:45:43.485Z","updated_at":"2025-04-11T02:32:00.584Z","avatar_url":"https://github.com/domodwyer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!NOTE]\n\u003e This was put together in 2017! That's a long time ago, things have definitely changed since :)\n\n## MongoDB / PostgreSQL JSONB Benchmarking Tool\n\n\nMPJBT was wrote to gather data for our Percona Live EU 2017 talk - you can see our slides [here](https://docs.google.com/presentation/d/1c2RihL5G3teT0sxcngzjIs8ni6aSeAcL8Nzmvy3nj8Y/edit?usp=sharing). \n\nWe found some *interesting* things.\n\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://assets.itsallbroken.com/github/mpjbt.png\" /\u003e\n\u003c/p\u003e\n\n\n## What's here?\n* `mpjbt` - benchmark tool source code (see releases for pre-built binaries)\n* `scripts/run-tests.sh` - bash script to run all workloads and push to a git remote\n* `scripts/run-suite.sh` - bash script to run `run-tests.sh` with a variety of different parameters\n* `scripts/vfs.d` - dtrace script to measure VFS call latency (`./vfs.d \u003cexecname\u003e`, for example `./vfs.d mongod`)\n\nThe bash scripts were developed to let us run long unattended tests over night - you'll probably have to tweak them for your use.\n\n## Features\n* Pluggable drivers - supports PostgreSQL and MongoDB now, but should be easy to add others\n* Randomised records\n* Pads records out to test larger documents (1kb, 1mb, etc)\n* Supports high numbers of concurrent workers\n\t* Care has been taken to avoid locks/contention outside of the drivers\n* Two different random distributions supported\n\t* Uniform - good at cache busting\n\t* Zipfian - good at hitting the cache\n* Support for configuring the behaviour of the underlying driver\n\t* Request different write concerns, set timeouts, etc\n* Builds a histogram for request durations - don't just use the average throughput!\n\t* Breaks results down for each operation\n\t* Dump histogram data as a CSV \n\n## Workloads\n* **insert**: insert records with a monotonically increasing ID\n* **insert-update**: same as \"insert' but immediately updates the record\n* **insert-select**: same as insert, but immediately reads the record\n* **insert5-select95**: insert a record 5% of the time, and read the most recent record the other 95%\n* **select-uniform**: read a totally random record\n* **select-zipfian**: read a random record heavily weighted towards the most recent\n* **select-update-uniform**: same as select-uniform, but the record is immediately updated\n* **select-update-zipfian**: same as select-zipfian, but the record is immediately updated\n* **update-zipfian**: update a record, weighted towards the highest IDs\n* **update-uniform**: update a random record\n* **read-range**: perform a range query on the age field (`age \u003e 45 AND age \u003c 75`)\n\n### Notes\n* We've seen a significant speed improvement using `binary_parameters=yes` when connecting to Postgres\n* Take into account the drivers used ([pq](https://github.com/lib/pq) and GlobalSign's fork of [mgo](https://github.com/globalsign/mgo)) will have differing performance\n* This was built fairly quickly so we could grab data - be kind!\n* Feel free to open PR's - I'll actively maintain this after the conference if it's useful to someone\n* If you do open a PR, please maintain the lockless behaviour (outside of the drivers obviously)\n* Multiple operation workloads are run sequentially per worker - this could be changed in the future (or just run two copies)\n* I really hate releasing something without unit tests - I just ran out of time!\n* Also I admit, we're not the best at coming up with names\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomodwyer%2Fmpjbt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdomodwyer%2Fmpjbt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomodwyer%2Fmpjbt/lists"}