# Rally create-track limit document count

**URL:** <https://discuss.elastic.co/t/rally-create-track-limit-document-count/279916>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [July 28, 2021, 9:16pm UTC](https://discuss.elastic.co/t/rally-create-track-limit-document-count/279916 "2021-07-28T21:16:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mots](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mots](https://discuss.elastic.co/u/mots)\
**Post date:** [July 28, 2021, 9:16pm UTC](https://discuss.elastic.co/t/rally-create-track-limit-document-count/279916/1 "2021-07-28T21:16:23Z")

</div>

I am able to create a custom track following these [instructions.](https://esrally.readthedocs.io/en/stable/adding_tracks.html)

But the target index I am using has over 5 mil documents. It's taking too long to create the custom track and I don't even need that many documents to run my test. I would like to restrict the number of documents added to the custom track to say 5k.

How can I achieve this ?

---

<div class="post-metadata">

**Author:** ![Evgenia\_Badiyanova](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/evgenia_badiyanova/32/84068_2.png) [@Evgenia\_Badiyanova](https://discuss.elastic.co/u/Evgenia_Badiyanova)\
**Post date:** [July 29, 2021, 2:06pm UTC](https://discuss.elastic.co/t/rally-create-track-limit-document-count/279916/2 "2021-07-29T14:06:14Z")

</div>

Hello,

If you are using bulk operation to index those documents, you can use optional bulk operation property [ingest-percentage](https://esrally.readthedocs.io/en/stable/track.html?highlight=ingest#bulk) in your track.

Thanks,  
Evgenia

---

<div class="post-metadata">

**Author:** ![mots](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mots](https://discuss.elastic.co/u/mots)\
**Post date:** [July 29, 2021, 3:49pm UTC](https://discuss.elastic.co/t/rally-create-track-limit-document-count/279916/3 "2021-07-29T15:49:31Z")

</div>

Thanks for replying back.

But my issue is related to creating the custom track.

```auto
esrally create-track --track=acme --target-hosts=abcdef123.us-central-1.gcp.cloud.es.io:9243 --client-options="timeout:60,use_ssl:true,verify_certs:true,basic_auth_user:'elastic',basic_auth_password:'secret-password'" --indices="products,companies" --output-path=~/tracks

```

I am using the above command, just changing the args to point to my target index. This target index has over 5 mil documents. The above command tries to create the custom track with all the 5 mill documents. I would like to limit it to only 5000 documents or % of my choosing.

Is this possible ?

---

<div class="post-metadata">

**Author:** ![mots](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mots](https://discuss.elastic.co/u/mots)\
**Post date:** [August 2, 2021, 6:19pm UTC](https://discuss.elastic.co/t/rally-create-track-limit-document-count/279916/4 "2021-08-02T18:19:02Z")

</div>

I am getting around this use case by doing the following -

```auto
POST _reindex?wait_for_completion=false
{
  "max_docs": 5000,
  "source": {
    "index": "esrally-documents",
    "query": {
      "function_score" : {
        "random_score" : {},
        "min_score" : 0.9    
      }
    }
  },
  "dest": {
    "index": "esrally-5k-documents"
  }
}

```

`esrally-documents` index has 5 million documents. I am using the reindex api to create a new index `esrally-5k-documents` with 5000 documents. Then running the create-track on this new index.

@danielmitterdorfer @Evgenia_Badiyanova Any feedback ?

---

<div class="post-metadata">

**Author:** ![RickBoyd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rickboyd/32/80022_2.png) [@RickBoyd](https://discuss.elastic.co/u/RickBoyd)\
**Post date:** [August 3, 2021, 4:10pm UTC](https://discuss.elastic.co/t/rally-create-track-limit-document-count/279916/5 "2021-08-03T16:10:59Z")

</div>

This is currently your best option, in my opinion. Note that 5k documents may not be enough to reliably reproduce benchmark results, but as you already know you can get more later with this same method.

---

<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:** [August 31, 2021, 4:11pm UTC](https://discuss.elastic.co/t/rally-create-track-limit-document-count/279916/6 "2021-08-31T16:11:30Z")

</div>

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