flexion / ef-cms

An Electronic Filing / Case Management System.
23 stars 10 forks source link

Spike: Explore ways to make search (adv doc in particular) more performant #8326

Closed JessicaMarine closed 3 years ago

JessicaMarine commented 3 years ago

As a development team, so that search performs well with many users, we need to investigate solutions that allow users to receive results quickly and not get logged out or timed out, and reduce impact to other critical systems that depend on elastic search.

Pre-Conditions:

Acceptance Criteria:

(1) Investigate other alternatives -- they can't negatively impact other part of the system;

(2) Decide on and document approach; and

(3) Make sure stories in backlog are revised to implement that approach. (Jessica to do)

Notes

Tasks

Proposed Solution

Step 1) Add a rate limiter in front of all ElasticSearch queries to limit the number of requests that reach the ElasticSearch cluster. The rate and cluster size could be adjusted to demand based on needs of the users. Instead of throwing a generic error when the searches fail, throw a specific error that informs the user that search is currently unavailable. Set replicas to 2 and shards to 4 for the docketEntry index for performance boosts over the current configuration.

Step 2) Gather metrics from production search usage to identify common searches and statistics.

Step 3) Additional performance tuning

matthopson commented 3 years ago

Services / Features By ES Index

efcms-case-deadline

efcms-case

efcms-docket-entry

efcms-message

efcms-user-case

efcms-user

efcms-work-item

sutt0n commented 3 years ago

Specific tasks via https://github.com/flexion/ef-cms/issues/8072#issuecomment-853359853:

cc: @codyseibert @kkoskelin @matthopson @mmarcotte

ericsorenson commented 3 years ago

image.png

Here's what GitHub does!

ericsorenson commented 3 years ago

Re-indexing Experiment:

Blue/green deploy in ustaxcourt's develop environment including all order and opinion document indexes. Once with 0 replicas, once without modifying replicas.

Success: Takes less than 6 hours, all documents are indexed.

matthopson commented 3 years ago

Roughly documenting needed stories:

Rate Limiter

Search Interstitial Messaging (maybe multiple stories)

Error Handling

Setup a means to gather metrics from prod

JessicaMarine commented 3 years ago

@matthopson Here are the stories that I queued up for ORDER search. Can you please review them with the Search Party and see if this is covers everything:

7372: Concurrent Order searches

7374: Prevent User from being logged out during Order search

7368: Prevent User from being timed out during Order search

7369: Exact match on Order search

7383: Partial matches on Order search

7756: Rate-limiting [Note: This is 1 user abusing the system not the auto-rate limiting to keep ES healthy]

8423: Gather search metrics from prod

Happy to revise/edit as necessary.