0

My application has 2 sections mainly,

  1. User interface written in angular which uses a Django python back end.
  2. Heavy map reduce kind of process.

Both uses postgres for look up, so my doubt is if I use same connection pool for both, at the time when my map reduce is runnning due to heavy lookup my other application won't work because of no connection available. Is there any work around this.(Avoiding the postgres itself is in the backlog)

PS: I am using pgbouncer for pooling

Cœur
  • 37,241
  • 25
  • 195
  • 267
najeeb
  • 813
  • 12
  • 25

1 Answers1

1

Simplest approach would be separating the two sections. At least with respect to the connection resources. (Whether e.g. memory consumption and gc would benefit from restructuring is not asked for)

You may achieve this using one of the following approaches:

  1. use two separate pools, one for each section.
    This way, you may setup the pools according to the connection requirements per section.

  2. change your code to maintain sufficient "free" resources for the other section.
    This is quite tedious and only useful as soon as the resource requirements need fine grain control depending on internal state of the algorithms.

Usually you'd want to go with suggestion 1.

rpy
  • 3,953
  • 2
  • 20
  • 31