# How to simulate small frequent updates parallel to constant queries

**URL:** <https://discuss.elastic.co/t/how-to-simulate-small-frequent-updates-parallel-to-constant-queries/303918>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [May 4, 2022, 9:01am UTC](https://discuss.elastic.co/t/how-to-simulate-small-frequent-updates-parallel-to-constant-queries/303918 "2022-05-04T09:01:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmlucjav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jmlucjav/32/5870_2.png) [@jmlucjav](https://discuss.elastic.co/u/jmlucjav)\
**Post date:** [May 4, 2022, 9:01am UTC](https://discuss.elastic.co/t/how-to-simulate-small-frequent-updates-parallel-to-constant-queries/303918/1 "2022-05-04T09:01:03Z")

</div>

Hi,

when I am benchmarking my querying with Rally, I would like to simulate also the fact that I get some frequent but small updates. Not sure what would be the best way to achieve this?

Say I want to have a throughput of 100 queries with a sparkling of some very small (handful of docs) updates every 20 to 30 seconds (with some randomization if possible)

How would you go about it? For now I am thinking of something like:

```auto
{
    "name": "search_all",
    "default": true,
    "schedule": [
       //delete, bulk index etc...
  
      {
          "parallel": {
            "warmup-iterations": 10,
            "iterations": 1000,
            "completed-by": "delta-bulk",
            "tasks": [
                {
                  "name": "delta-bulk",
                  "operation": {
                      "operation-type": "bulk",
                      "bulk-size": 2,
                      "target-throughput": 0.1
                  },
                  "clients": 1
                },
                {
                    "operation": "randomized-query",
                    "clients": 4,
                    "iterations": 1000,
                    "target-throughput": 1
                }
            ]
          }
        }

    ]
}

```

but my guess this can be improved? Not sure if I should be using conflicts (and how) etc

thanks

---

<div class="post-metadata">

**Author:** ![dliappis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dliappis/32/56174_2.png) [@dliappis](https://discuss.elastic.co/u/dliappis)\
**Post date:** [May 5, 2022, 11:59am UTC](https://discuss.elastic.co/t/how-to-simulate-small-frequent-updates-parallel-to-constant-queries/303918/2 "2022-05-05T11:59:35Z")

</div>

Hello,

You can use the [conflicts](https://esrally.readthedocs.io/en/latest/track.html#properties) property of the bulk operation.

You can control the frequency of updates with [conflict-probability](https://esrally.readthedocs.io/en/latest/track.html#properties) in propotion to the target-throughput you've set for `bulk`. Additional properties that you can leverage are for what to do on conflict (index or update) via `on-conflict` and, finally, whether conflicts should be biased towards more recent or older ids (see `recency`).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 2, 2022, 12:00pm UTC](https://discuss.elastic.co/t/how-to-simulate-small-frequent-updates-parallel-to-constant-queries/303918/3 "2022-06-02T12:00:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
