# Scroll API taking long time and using a lot of memory

**URL:** <https://discuss.elastic.co/t/scroll-api-taking-long-time-and-using-a-lot-of-memory/119687>\
**Category:** Elasticsearch\
**Created:** [February 13, 2018, 6:12pm UTC](https://discuss.elastic.co/t/scroll-api-taking-long-time-and-using-a-lot-of-memory/119687 "2018-02-13T18:12:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raj\_Kiran](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Raj\_Kiran](https://discuss.elastic.co/u/Raj_Kiran)\
**Post date:** [February 13, 2018, 6:12pm UTC](https://discuss.elastic.co/t/scroll-api-taking-long-time-and-using-a-lot-of-memory/119687/1 "2018-02-13T18:12:53Z")

</div>

Hi,

I have a single machine with following configs  
RAM: 32 GB (allocated 12 gb to ES)  
HDD  
I have indexed 17 million rows x 3000 columns (200 gb) data with 5 shards and no replicas  
I want to retrieve a subset of data 1 million x 3000 (10gb) and store it in csv file.  
I have tried various ways and it takes 9 hours to complete.  
I came across the scroll api, but it is using a lot of memory and my process slows down eventually.  
i am using the following query:

result\_dict = es.search(index="genes",doc\_type="test",scroll='1m',size=5000, body={  
"query": {  
"terms": {  
"Cadd\_GeneName.keyword": arr  
}  
},  
"sort":"\_doc"  
}

Any help would be greatly appreciated.

Thanks,  
-Raj

---

<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:** [March 13, 2018, 6:13pm UTC](https://discuss.elastic.co/t/scroll-api-taking-long-time-and-using-a-lot-of-memory/119687/2 "2018-03-13T18:13:17Z")

</div>

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