How do I guarantee consistent endpoint performance with list filters?

My app's endpoint performance is great across the board when there is less traffic. 'Endpoint A' will take less than 1 second to run consistently.

However, when traffic increases for a 6 hour period, 'Endpoint A' begins to take 40+ seconds to run.



The 2 biggest culprits contain list filtering on a table Query.

Example:
Post's list of Tags โ€” OVERLAPS โ€” User's list of Tags

Both lists have a maximum of 10 Tags.

Indexes don't seem to be a problem and the GIN INDEX doesn't seem to work for my use case. Pagination is enabled. We don't want to cache responses.

Any ideas?


Typical performance:

Performance during increased traffic:

4 replies