# Elasticsearch System Parameter for ASYNC IO

**URL:** <https://discuss.elastic.co/t/elasticsearch-system-parameter-for-async-io/284750>\
**Category:** Elasticsearch\
**Created:** [September 21, 2021, 4:31pm UTC](https://discuss.elastic.co/t/elasticsearch-system-parameter-for-async-io/284750 "2021-09-21T16:31:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [September 21, 2021, 4:31pm UTC](https://discuss.elastic.co/t/elasticsearch-system-parameter-for-async-io/284750/1 "2021-09-21T16:31:20Z")

</div>

Hello Team

I am using Elasticsearch version 7.8.0.

I understand that Elasticsearch uses ASYNC IO to perform document indexing ...

I would like to know in /etc/sysctl.conf minimum values required for ASYNC IO

aio-max-nr  
aio-nr

Parameter values to be set ...

These are not defined in document ... hence I am asking here..

Could you please help me ..

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [September 21, 2021, 7:40pm UTC](https://discuss.elastic.co/t/elasticsearch-system-parameter-for-async-io/284750/2 "2021-09-21T19:40:56Z")

</div>

> [@tusharnemade](#):
>
> I understand that Elasticsearch uses ASYNC IO to perform document indexing ...

Where are you getting this information from? It doesn't sound correct to me.

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [September 22, 2021, 2:59am UTC](https://discuss.elastic.co/t/elasticsearch-system-parameter-for-async-io/284750/3 "2021-09-22T02:59:44Z")

</div>

Hello @DavidTurner

Reference : [ES default - async or sync](https://discuss.elastic.co/t/es-default-async-or-sync/19654)

Comment : 2

```auto
Elastic Team Member
Sep 2014
Hiya

OK I see where the confusion is coming in. I used the word asynchronously
in slightly different contexts there. I will try to reword in the
Definitive Guide.

Replication is sync by default, in other words: the primary waits for
indexing to happen on the replica before it returns to the user. That
said, lots of these processes happen at the same time, so sending the
document to the replica is asynchronous. It doesn't send a change then
wait for the response before sending the next one. This all happens in
parallel.

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 22, 2021, 3:44am UTC](https://discuss.elastic.co/t/elasticsearch-system-parameter-for-async-io/284750/4 "2021-09-22T03:44:37Z")

</div>

This doesn't relate to filesystem operations, it's talking about the logical operation that happens in replication.

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [September 22, 2021, 4:16am UTC](https://discuss.elastic.co/t/elasticsearch-system-parameter-for-async-io/284750/5 "2021-09-22T04:16:31Z")

</div>

Thanks @warkolm for your response....

This logical operation will cause same IO Operations on Disk level too ..

OR

From HEAP to Disk its SYNC IO ?

In our VM / OS .. ASYNC IO is enabled...

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [September 22, 2021, 12:28pm UTC](https://discuss.elastic.co/t/elasticsearch-system-parameter-for-async-io/284750/6 "2021-09-22T12:28:41Z")

</div>

Yeah there's nothing about IO in those docs, which are also very old and may not be accurate any more. Elasticsearch doesn't use asynchronous IO.

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [September 22, 2021, 12:34pm UTC](https://discuss.elastic.co/t/elasticsearch-system-parameter-for-async-io/284750/7 "2021-09-22T12:34:29Z")

</div>

Okay @DavidTurner

For my Understanding could you please correct me ...

1. 100 of Documents are getting pushed to Elasticsearch per seconds ..

Are these documents processed into INDEX Named "my-index" serially one by one ?

1. If Processing of Index in HEAP is done serially ... How does translogs are getting updated SYNC wise only ?

2. Does writing to ACTUAL File on OS mount point from HEAP memory is done Serially SYNC wise or ASYNC wise ?

OR It's completely depend on OS IO Operations from JAVA HEAP to Index file on disk ?

Could you please spare some time and respond to me for my understanding ...

It will help me a lot for configuration and to proceed further in my setup ...

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [September 22, 2021, 5:50pm UTC](https://discuss.elastic.co/t/elasticsearch-system-parameter-for-async-io/284750/8 "2021-09-22T17:50:15Z")

</div>

> [@tusharnemade](#):
>
> Are these documents processed into INDEX Named "my-index" serially one by one ?

It depends. Each bulk is processed one-by-one on each shard, but parallel bulks are processed in parallel. This has nothing to do with async vs sync IO.

> [@tusharnemade](#):
>
> How does translogs are getting updated SYNC wise only ?

The translog is written using synchronous IO.

> [@tusharnemade](#):
>
> Does writing to ACTUAL File on OS mount point from HEAP memory is done Serially SYNC wise or ASYNC wise ?

All files (including translogs) are written using synchronous IO.

---

<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:** [October 20, 2021, 5:51pm UTC](https://discuss.elastic.co/t/elasticsearch-system-parameter-for-async-io/284750/9 "2021-10-20T17:51:05Z")

</div>

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