# Index performance when indexing 80M document

**URL:** <https://discuss.elastic.co/t/index-performance-when-indexing-80m-document/12432>\
**Category:** Elasticsearch\
**Created:** [June 15, 2013, 11:28am UTC](https://discuss.elastic.co/t/index-performance-when-indexing-80m-document/12432 "2013-06-15T11:28:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_5](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@Sam\_5](https://discuss.elastic.co/u/Sam_5)\
**Post date:** [June 15, 2013, 11:28am UTC](https://discuss.elastic.co/t/index-performance-when-indexing-80m-document/12432/1 "2013-06-15T11:28:13Z")

</div>

Heya!

I am nearly new to use elasticsearch, and I need to index aprox 80M  
documents using the IndexManyAsync method, I am toward to batch the  
documents, each will have 10000 docs and then add them to the index.  
I read somewhere that I can do the indexing process on more than one  
thread/parallel and even with more than one client, anyone could be able to  
give me a rough idea in how to implement this in C#? I am using the .NET  
API.

Below is a code snippet on what I've done so far, just as a test on  
Adventure DB.

for (var i = 0; i \< noOfBatches; i++)  
{

```
                   noOfItemsToSkip = i * numberOfItemsToTake;

                    var contentToIndex = 

```

contacts.Skip(noOfItemsToSkip).Take(numberOfItemsToTake);

```
                    bulkResponse = 

```

client.IndexManyAsync(contentToIndex, "contactstore", "contact");  
}

await bulkResponse;

I am pretty sure that I am doing something wrong with awaiting only the  
last task, any insight on this one? and how can I use more than one client!

Thanks in advance.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:31am UTC](https://discuss.elastic.co/t/index-performance-when-indexing-80m-document/12432/2 "2017-07-06T02:31:05Z")

</div>


