Sever performance problems when a certain model is present in the index

Skip to first unread message

Salvatore Iovene

Nov 3, 2017, 5:55:28 PM11/3/17
to django-haystack
I'm kind of at the end of my rope about a performance problem that renders my website useless, so I would really appreciate some help.

I'm running Django 1.9, django-haystack 1.6, Elasticsearch 1.7, on Ubuntu Server 16.04 LTS.

I have 3 indexes:
 - Users, about 20,000 entries
 - Gear, about 50,000 entries
 - Images, about 200,000 entries

If I index Users and Gear, everything is fine.

As soon as I index a few hundred Images, the whole website comes down to a crawl (pages needing minutes to open) even on pages that are not making any Haystack queries.
If I delete all Images from Elasticsearch, the website returns to being snappy instantly.

Say I was waiting for a page to load, and 10 seconds in I just delete all Images from Elasticsearch, suddenly my page will load before my eyes.

I have no idea how to debug this, can somebody offer some advice?

Thank you!

Justin Caratzas

Nov 3, 2017, 10:18:11 PM11/3/17

I have a couple questions, mostly predicated on the assumption that you have everything running on one machine.

1. How much RAM does this particular instance possess? 

2. Have you profiled available memory before/during indexing?

3. What does your Image SearchIndex look like?

4. Is anything else running on this box (rabbitmq, memcache, etc)?



You received this message because you are subscribed to the Google Groups "django-haystack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Salvatore Iovene

Nov 4, 2017, 2:30:30 AM11/4/17
to django-haystack
Never mind everyone, sorry about the false alarm: I discovered a haystack query that was running hundreds of times per second! Somehow with the older stack pre-upgrade, that query was not running (?) so I never realised. I removed that and the problem went away :-)
Reply all
Reply to author
0 new messages