mysociety / alaveteli

Provide a Freedom of Information request system for your jurisdiction
https://alaveteli.org
Other
389 stars 195 forks source link

review acts_as_xapian code #1247

Open mhl opened 10 years ago

mhl commented 10 years ago

It would be worth carefully going over the code in acts_as_xapian, particularly looking out for anything that might be causing excessive memory usage and garbage collection.

mhl commented 10 years ago

Scheduled for Monday with @crowbot

mhl commented 10 years ago

It's apparent that working on acts_as_xapian in any significant way is likely to be a big task. We've come up with the following rough plan of what we'd like to do if time allows, however, and these tasks could be added to future sprints to gradually pay off the technical debt.

What we're trying to achieve:

Address problems with Alaveteli resource consumption

For example, we're worried about:

What want to address this is performance integration tests in the test suite (not run by default, though).

The suggested plan for this is to write a script that can run in a reasonably short amount of time to generate a large test dataset for performance testing; we'll be able to instrument this more easily than the live site, and can try diagnostic tools that only work with later Ruby version, for example.

Suggested initial experiments for this, with the memcache caching disabled:

  1. Repeatedly hit the front page (monitor for memory)
  2. Repeatedly hit random request pages (monitor for memory)
  3. Run the alert_tracks_loop job (monitor for CPU and memory)

A potentially big benefit of this work is having a reusable test setup for looking at performance problems like these; each time these come up it seems that lots of analysis has to happen from scratch again.

Make acts_as_xapian more maintainable and easier to extend

We're concerned that this course of action wouldn't produce the concrete improvements to the site that we'd like to see through the amount of work involved, but theoretically a good course of action might be: