Hello,
Here is a patch to add duration option (-T) to pgbench instead of
number of transactions (-t). -t and -T are mutually exclusive.
$ pgbench -n -S -c10 -T10
transaction type: SELECT only
scaling factor: 1
query mode: simple
number of clients: 10
number of transactions actually processed: 22522 in 10 s
tps = 2248.686427 (including connections establishing)
tps = 2298.896332 (excluding connections establishing)
I have some experiences where duration-based tests are better than
num-of-xacts-based. For example, testing checkpoints with pgbench
(checkpoints occurs periodically) or endurance test over a weekend
(it should run through 48 hours).
BTW, we have the following notes in the documentation:
| F.18.5. Good Practices
| In the first place, never believe any test that runs for only a few seconds.
| Increase the -t setting enough to make the run last at least a few minutes,
| so as to average out noise.
If there were -T option, we could rewrite it as
"Increate the -T setting to 300 (5 minutes) or larger" or something.
Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center