Search code examples
memgraphdb

How can I run mgbench without re-importing dataset?


I am running the mgbench multiple times. I notice that it needs to create database every time in a temp directory when I re-run a benchmark.

If I have already a database in a data directory, how can I allocate my data directory to avoid importing queries to create a database?


Solution

  • Running the benchgraph (old mgbench) was created for benchmarking. This means removing the dataset after each workload, BCS if the workload contains any type of write queries, the dataset is being compromised, and benchmark results also. Hence, we made everything to have a clean start, there is no support for this. But I guess this can be a bit frustrating, waiting for a dataset to import could take some time.

    There is a possibility just to inject a snapshot file and restart Memgraph. The same initial snapshot is being reused during the running of different tests in one workload, so you could inject that snapshot into the Memgraph, at the start of the benchmark. https://memgraph.com/docs/memgraph/next/reference-guide/backup