Configuring a Benchmark Tool to Replay Queries

You can configure a benchmark tool to replay queries from a set of search.csv files.

  1. Go to your <DATADIR> directory.
  2. Create a new bench subdirectory at the root level of the <DATADIR> directory.

    For example, cv/data/bench if the <DATADIR> is cv/data.

  3. Put search.csv files in the bench directory.
  4. Optional: The benchmark will replay all queries found in this set of search.csv files. It is a good practice to filter out the period to exclude from the benchmark and focus on a given time period only.

    For example, you can use grep to retrieve only the interesting queries of your search.csv files.

  5. From the <DATADIR> directory, run the following command:

    ./bin/java com.exalead.index.tools.bench.TransformCSV

    The command processes the search.csv files to generate the matching sorted.csv files.
  6. Merge the sorted.csv files into a single merged.csv file using the following command:

    cat bench/sorted.csv* | sort -T /tmp -t ';' -k 1 > bench/merged.csv

  7. From the <DATADIR> directory, run the benchmark tool with the following command:

    ./bin/java com.exalead.index.tools.bench.RunSortedCSV 
                --server localhost:190 
                --speed 1.0 
                --threads 16 
                --build-enabled true 
                --wait-enabled true
                --gateway <primary server name>:190
                --conso sxiconsolidation1
            
    Where:
    Option Description
    threads Defines the maximum number of threads used by the benchmark tool.
    wait-enabled If true, this option allows the benchmark tool to replay the queries with the same timing for which they were recorded.
    speed If wait-enabled is true, this option allows you to control the speed of the replay scenario. For example, it can be twice faster with a speed of 2.0, or twice slower with a speed of 0.5.
    build-enabled If true, this option simulates indexing activities without impacting the index content.

    If false, the benchmark tool does not build the data, and simulates searching activities only.

    gateway In high availability deployments, if build-enabled is true, you must precise the name of the primary server gateway.
    conso Indicates the name of the consolidation server corresponding to the search that you want to replay.