# Performance issue django/haystack + elasticsearch on ec2's

**URL:** <https://discuss.elastic.co/t/performance-issue-django-haystack-elasticsearch-on-ec2s/24578>\
**Category:** Elasticsearch\
**Created:** [June 29, 2015, 9:51pm UTC](https://discuss.elastic.co/t/performance-issue-django-haystack-elasticsearch-on-ec2s/24578 "2015-06-29T21:51:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Bormans](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@Paul\_Bormans](https://discuss.elastic.co/u/Paul_Bormans)\
**Post date:** [June 29, 2015, 9:51pm UTC](https://discuss.elastic.co/t/performance-issue-django-haystack-elasticsearch-on-ec2s/24578/1 "2015-06-29T21:51:26Z")

</div>

For a new website i'm setting up i deploy nginx/gunicorn/django/haystack on a webserver instance; currently a t2.small. ES is running on a seperate instance which is currently a t2.micro. (I think this should for now not be a problem since i'm only having 17K documents; the head plugin tells me the index is currently 663Mi). Now a query on it's own is fast enough (ms's) but getting the results to haystack takes seconds.

My question is as follows:

- How can i best measure/proof where the performance issue really is?
- Can i return only a subset of documents; e.g. there are translated fields, obviously i only need one.
- What is the best practice of deployment of es on ec2? Seperate node or deploy on webserver instance?

Thanks for any tips,  
Paul

---

<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:** [June 29, 2015, 10:00pm UTC](https://discuss.elastic.co/t/performance-issue-django-haystack-elasticsearch-on-ec2s/24578/2 "2015-06-29T22:00:49Z")

</div>

Well, it's a t2.micro 😛

How do you know the query takes ms? If you are confident that is the case then it's likely not to be ES.

---

<div class="post-metadata">

**Author:** ![Paul\_Bormans](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@Paul\_Bormans](https://discuss.elastic.co/u/Paul_Bormans)\
**Post date:** [June 30, 2015, 5:07pm UTC](https://discuss.elastic.co/t/performance-issue-django-haystack-elasticsearch-on-ec2s/24578/3 "2015-06-30T17:07:24Z")

</div>

Mark,

From the logging i got the full query statement, with facets and all. I just entered that in a sense-session. In the response a 'took' attribute is mentioned which i assume is the spend time to run the query by ES, it's on 11(ms).

I actually do not think the issue is within ES, but then still i have many candidates; the t2-micro performance obviously is a candidate. But also the I/O between the instances, haystack, size of documents, etc...

I'm posting on this forum to see from ES perspective what i can do to investigate this further?

Paul

---

<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, 12:04am UTC](https://discuss.elastic.co/t/performance-issue-django-haystack-elasticsearch-on-ec2s/24578/4 "2017-07-06T00:04:29Z")

</div>


