# Elasticsearch on aws ec2 index very slow

**URL:** <https://discuss.elastic.co/t/elasticsearch-on-aws-ec2-index-very-slow/38120>\
**Category:** Elasticsearch\
**Created:** [December 29, 2015, 6:58pm UTC](https://discuss.elastic.co/t/elasticsearch-on-aws-ec2-index-very-slow/38120 "2015-12-29T18:58:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdaYang](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@AdaYang](https://discuss.elastic.co/u/AdaYang)\
**Post date:** [December 29, 2015, 6:58pm UTC](https://discuss.elastic.co/t/elasticsearch-on-aws-ec2-index-very-slow/38120/1 "2015-12-29T18:58:52Z")

</div>

Set up elasticsearch 2.1 3 nodes 5 shards cluster in ec2 aws using m4.large (8G) instance. I am bulk indexing using java transport client . The same index run in my local mac takes about 6 minutes to index 500K documents but in aws ec2, it takes about 40 minutes. I checked cpu, jvm, threadpool, gc, merge, all looks all good on the ec2 instance.

I don't have a ton of knowledge about the storage in ec2. I am using gp2 with 120 iops. I timed the app, the time is mainly spending on writing in index server. Is this gp2 too slow?

So the issue is either on networking from my appserver to elasticsearch server or the inside of the elasticsearch. I set the replicas to 0 now to simple the issue. refresh\_interval": "30s", translog.durablity is async. Flush.interval is 30s.

Anybody has the same issue before? I was wondering if this is the provision issue or my configuration on elasticsearch side.

host ip heap.percent ram.percent load node.role master name  
10.40.38.111 10.40.38.111 45 65 0.00 d m ip-10-40-38-111  
10.40.37.36 10.40.37.36 9 67 0.00 d \* ip-10-40-37-36  
10.40.38.213 10.40.38.213 65 67 0.01 d m ip-10-40-38-213

---

<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:** [December 29, 2015, 8:02pm UTC](https://discuss.elastic.co/t/elasticsearch-on-aws-ec2-index-very-slow/38120/2 "2015-12-29T20:02:47Z")

</div>

> [@AdaYang](#):
>
> gp2 with 120 iops

That seems pretty slow to me.

---

<div class="post-metadata">

**Author:** ![AdaYang](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@AdaYang](https://discuss.elastic.co/u/AdaYang)\
**Post date:** [December 29, 2015, 9:07pm UTC](https://discuss.elastic.co/t/elasticsearch-on-aws-ec2-index-very-slow/38120/3 "2015-12-29T21:07:45Z")

</div>

thanks. Based on the limit aws doc I have read, the iops is based on the size of the storage. I set up a 40G gp2, and it shows:  
vol-6f381592 40 GiB gp2 **_120_** / 3000 snap-4e3c6d2b December 28, 2015 at 2:18:06 PM UTC-8 us-east-1b. I am not sure if there is a statistics on this.

---

<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 5, 2017, 11:28pm UTC](https://discuss.elastic.co/t/elasticsearch-on-aws-ec2-index-very-slow/38120/4 "2017-07-05T23:28:00Z")

</div>


