Skip to content

Thundering herd problem in PostgREST cluster on AWS ECS #4642

@steve-chavez

Description

@steve-chavez

Problem

In a setup where:

  • There's a master database and several replicas
  • The master and the replicas each have their own ECS task with a postgREST instance (which can scale and multiply according to demand, this can reach up to 100 instances connecting to the same db), all of them have a LISTEN channel
  • A migration occurs and event trigger for reloading is setup, since master + all the replicas LISTEN channel are connected to the master (ref), the schema cache process for each one is triggered at the same time.
  • All the schema cache queries fire at the same time, causing thundering herd -- which makes the schema cache take longer than usual

Proposal

Having a way to read the schema cache from a file and sharing across instances could potentially mitigate this, also discussed before on #2918

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions