django-councilmatic icon indicating copy to clipboard operation
django-councilmatic copied to clipboard

SOLR fails silently and does not restart

Open fgregg opened this issue 7 years ago • 5 comments

This causes our councilmatics to stop functioning. We need to address this this week.

fgregg avatar Dec 03 '17 17:12 fgregg

Related to: https://github.com/datamade/la-metro-councilmatic/issues/232

reginafcompton avatar Dec 04 '17 15:12 reginafcompton

It looks like a conventional strategy for restarting failed processes on Ubuntu entails the use of a config file (e.g. etc/init/solr.conf/) and Upstart.

reginafcompton avatar Dec 07 '17 21:12 reginafcompton

N.B. To prevent Solr crashes, we might also think about limiting the query results (since that tends to be what sucks up server memory and brings down solr). However, this may involve removing the Haystack dependency. @jeancochrane has a solution for limiting query results in SFM, which is worth considering.

reginafcompton avatar Dec 07 '17 21:12 reginafcompton

@evz and I did some work on this. Next steps:

  • [x] we can limit the Jetty heap memory by passing in arguments to JETTY_OPTIONS in jetty.conf. I'll add such args and put this file under version control in the Metro repo.

  • [x] subscriptions via the RSS feed cause the solr outages, i.e., if someone subscribes to a search that returns thousands of bills, the feed iterates over every bill to build out the RSS (likely here). This process requires a fair amount of memory. Reducing the object size in django-councilmatic resolves this memory problem. Happily, the city-specific repos do not complicate feeds: nyc, chi, metro.

  • [ ] if we want to restart jetty, then it seems like we'd need to provide a directive in the jetty upstart file (/etc/init.d/jetty).

I will prioritize these tasks in the order above.

reginafcompton avatar Dec 08 '17 20:12 reginafcompton

Haystack defaults to silent failures. It can easily be configured to raise these exceptions (and use a certain default batch size, plus other options here). See: https://github.com/datamade/la-metro-councilmatic/pull/641

hancush avatar Sep 01 '20 15:09 hancush