-
Notifications
You must be signed in to change notification settings - Fork 33
PERF-7326 add sharded support #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
09296ee
add sharded support
blagoev ff8184c
fix bugs, python3 syntax and load code
blagoev 05aab04
Update README.md
blagoev ad1dade
fix readme.md and driver
blagoev c3a80fd
don't reset if sharded
blagoev 9aadec6
add support to reset the sharded database and remove command line scr…
blagoev cc58a06
fix driver and readme
blagoev a733f94
fix driver and readme
blagoev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,94 @@ The structure of the repo is: | |
| All the tests were run using [MongoDB Atlas](https://www.mongodb.com/cloud/atlas?jmp=VLDB2019). | ||
| Use code `VLDB2019` to get $150 credit to get started with MongoDB Atlas. | ||
|
|
||
| ## Sharded MongoDB Driver | ||
|
|
||
| 1. Create ana activate a python env. | ||
|
|
||
| ```bash | ||
| mkdir ~/python_envs | ||
| cd ~/python_envs | ||
| ~/python_envs$ python -m venv py-tpcc-env | ||
| source ~/python_envs/py-tpcc-env/bin/activate | ||
| ``` | ||
| 2. Install pymongo | ||
|
|
||
| ```bash | ||
| pip install pymongo | ||
| ``` | ||
|
|
||
| 3. Print your config. | ||
|
|
||
| ```bash | ||
| cd ~/py-tpcc/pytpcc | ||
| ~/py-tpcc/pytpcc$ python ./tpcc.py --print-config mongodb > mongodb.config | ||
| ``` | ||
|
|
||
| 4. Edit the configuraiton for Postgres in the mongodb.config. | ||
| * Change shards to the number of `shards` | ||
| * Change the mongodb connection `uri` string | ||
| * Change the database `name` | ||
|
|
||
| ```bash | ||
| # MongodbDriver Configuration File | ||
| # Created 2025-10-08 14:18:24.378446 | ||
| [mongodb] | ||
|
|
||
| # The mongodb connection string or URI | ||
| uri = mongodb://user:[email protected]:27017/admin?ssl=true&tlsAllowInvalidHostnames=true&tlsAllowInvalidCertificates=true | ||
|
|
||
| # Database name | ||
| name = tpcc | ||
|
|
||
| # If true, data will be denormalized using MongoDB schema design best practices | ||
| denormalize = True | ||
|
|
||
| # If true, transactions will not be used (benchmarking only) | ||
| notransactions = | ||
|
|
||
| # If true, all things to update will be fetched via findAndModify | ||
| findandmodify = True | ||
|
|
||
| # If true, aggregation queries will be used | ||
| agg = | ||
|
|
||
| # If true, we will allow secondary reads | ||
| secondary_reads = True | ||
|
|
||
| # If true, we will enable retryable writes | ||
| retry_writes = True | ||
|
|
||
| # If true, we will perform causal reads | ||
| causal_consistency = True | ||
|
|
||
| # If true, we will have use only one 'unsharded' items collection | ||
| no_global_items = | ||
|
|
||
| # If > 0 then sharded | ||
| shards = 3 | ||
| ``` | ||
|
|
||
| 4. Run pytpcc using --warehouses=XXX | ||
|
|
||
| * Reset the database and load the data | ||
| ```bash | ||
| python ./tpcc.py --reset --no-execute --clients=100 --duration=10 --warehouses=21 --config=mongodb.config mongodb --stop-on-error | ||
| ``` | ||
|
|
||
| * Only load the data | ||
| ```bash | ||
| python ./tpcc.py --no-execute --clients=100 --duration=10 --warehouses=21 --config=mongodb.config mongodb --stop-on-error | ||
| ``` | ||
|
|
||
| * Execute the tests without loading data. | ||
| ```bash | ||
| python ./tpcc.py --no-load --clients=100 --duration=10 --warehouses=21 --config=mongodb.config mongodb --stop-on-error | ||
| ``` | ||
|
|
||
| * Execute the tests with loading | ||
| ```bash | ||
| python ./tpcc.py --clients=100 --duration=10 --warehouses=21 --config=mongodb.config mongodb --stop-on-error | ||
| ``` | ||
|
|
||
| ## Postgres JSONB Driver | ||
|
|
||
|
|
@@ -88,4 +176,4 @@ postgres=# \l+ | |
|
|
||
| # For any SQL command first use the database | ||
| \c tpcc; | ||
| ``` | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.