Repository navigation
Conversation
A terminal is assigned a warehouse and stays on it for the whole run, as the specification requires. A side effect is that the data a run touches is bounded by the number of terminals rather than by the scale factor: thirty-two terminals against a two thousand warehouse database address thirty-two warehouses, so a database built to exceed memory is measured entirely out of cache. Measured on a 243 GB database with 32 GB of shared buffers and 125 GB of RAM, 32 terminals, six minute runs from a cold page cache, the last three minutes of each: useAllWarehouses=false 18,496 tps 0.33 buffer misses per commit useAllWarehouses=true 10,577 tps 4.86 buffer misses per commit The first run reads 34 MB/s and is a cached workload whatever the scale factor says. The second reads 403 MB/s and is the storage test the scale factor was chosen for. With <useAllWarehouses>true</useAllWarehouses> a terminal draws a warehouse, and a district within it, for every transaction. Nothing else changes: the transaction mix, the remote warehouse rates and the consistency conditions are as before. Runs made this way are not specification compliant and their tpmC is not comparable with compliant results, which the option documents. The option is off by default.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add an option to spread the TPC-C terminals over every warehouse
By default, a TPC-C terminal is bound to a warehouse for the whole run, as the specification requires. A side effect is that the data a run touches is bounded by the terminal count rather than the scale factor: covering every warehouse needs at least one terminal per warehouse, so the working set cannot be chosen independently of the concurrency point, and a database built to exceed memory ends up measured out of cache. This commit adds the
useAllWarehousesoption, which makes a terminal pick a random warehouse, and a district within it, for every transaction. HammerDB offers the same aspg_allwarehouse; go-tpc does it unconditionally. Runs made this way are not specification-compliant, and their tpmC is not comparable with compliant results. Claude generated the code and the rest of the description.Why
A TPC-C terminal is assigned a warehouse and stays on it for the whole run, as
the specification requires. A side effect of that rule is easy to miss when
sizing an experiment: the data a run actually touches is bounded by the number of
terminals, not by the scale factor. Thirty-two terminals against a two thousand
warehouse database address thirty-two warehouses — about 4 GB of a 243 GB
database — so a dataset built specifically to exceed memory is measured entirely
out of cache, and the scale factor in the report says otherwise.
Measured on a 243 GB database, PostgreSQL 18 with 32 GB of shared buffers on a
host with 125 GB of RAM, 32 terminals, six minute runs each started from a
dropped page cache, statistics taken over the last three minutes:
useAllWarehouses=falseuseAllWarehouses=trueThe first row is a cached workload whatever its scale factor says. The second is
the storage test that scale factor was chosen for. Fifteen times the buffer
misses per transaction is the difference between measuring a buffer pool and
measuring a storage engine.
Other TPC-C harnesses expose the same switch — HammerDB calls it "all
warehouses" — precisely because a database larger than memory is a common thing
to want to measure.
What this adds
Each terminal draws a warehouse, and a district within it, for every transaction
instead of using the one it was assigned. Nothing else changes: the transaction
mix, the remote warehouse rates in New-Order and Payment, and the amount of work
per transaction are the same, and the procedures themselves are untouched.
Runs made this way are not specification compliant — a terminal belongs to a
warehouse for the duration of a compliant run — and their tpmC is not comparable
with compliant results. Both the README and the option's javadoc say so.
The option is off by default; existing configurations behave exactly as before.
Testing
mvn test— 247 tests, all passing.the warehouses whose highest order id advanced during the run:
false: 8 warehouses of 50true: 50 of 50neither produced an SQL error:
w_ytd = sum(d_ytd)per warehoused_next_o_id - 1 = max(o_id)per districtnew_orderids of a district are contiguoussum(o_ol_cnt) = count(order_line)per districtNote
This is independent of the stored procedure PR; the two branches both start from
the same upstream commit and touch different code, apart from both adding a field
to
TPCCBenchmark.