[workaround] Help! Is anyone using pgBouncer?

Hi guys,

I’m hitting my first load issues with Supabase and they are asking if I am using pgBouncer – so I’m very interested in this right now as customers are seeing red errors…

Thanks
Al;

well now I’m just embarrassed :slight_smile:

Whelp, that didn’t help. Made it worse. I need to learn more.

No time, no time, no time !

I the process in question was being driven from the front end so I put a throttle on it by building a container that delays rendering [the cell that calls the database]

export const xPerSecond = (x, ndx) => (ndx / x) * 1000
const DelayedRender = ({ renderDelay, children }) => {
  const [waiting, setWaiting] = React.useState(true)
  React.useEffect(() => {
    setTimeout(() => {
      setWaiting(false)
    }, renderDelay)
  })
  if (waiting) {
    return (
      <span>Pending...</span>
    )
  }
  return children
}
export default DelayedRender

and used it

  const uploadingCells = uploadData.map((aRecord, ndx) => (
    <DelayedRender key={aRecord.id} renderDelay={xPerSecond(HOW_MANY_PER_SECOND, ndx)}>
      <UploadingAttendeeCell key={aRecord.id} eventId={eventId} input={aRecord} exfiltrate={() => anotherUploadDone(aRecord)} />
    </DelayedRender>
  ))
1 Like