mfussenegger / cr8

CLI collection of utilities for working with CrateDB or PostgreSQL. Benchmark queries, insert data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide a way to determine a good number of iterations for a query

mfussenegger opened this issue · comments

I'm toying around with a calibrate command which tries to find a good number of iterations by brute-force.
It keeps increasing number of iterations until 10 runs are all within ~1%:

See https://github.com/mfussenegger/cr8/compare/calibrate

API looks currently like this:

def calibrate(statement,
              hosts='localhost:4200',
              start_warmup=1,
              start_iterations=10,
              match_size=10,
              within_perc=1):

@chaudum @mikethebeer any suggestions to the API or approach?

For example, using this approach I ended up with -r 655360 -w 1000 for select name

Not going to do this for now