public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Jean Baro <[email protected]>
Cc: PostgreSQL mailing lists <[email protected]>
Subject: Re: Low priority batch insert
Date: Fri, 20 Oct 2017 07:54:16 +0900
Message-ID: <CAB7nPqTJD79=tnTQb+MW2Y3ERKCR9WiShTNLgkrs18bJeTxs9A@mail.gmail.com> (raw)
In-Reply-To: <CA+fQeemNM8s9Y0_WKJ+rKStR9iePV3yfW+Rh6nhPUyGcJf3+hg@mail.gmail.com>
References: <CA+fQeemNM8s9Y0_WKJ+rKStR9iePV3yfW+Rh6nhPUyGcJf3+hg@mail.gmail.com>
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgsql-performance>

On Fri, Oct 20, 2017 at 1:10 AM, Jean Baro <[email protected]> wrote:
> That's my first question in this mailing list! :)

Welcome!

> Is it possible (node.js connecting to PG 9.6 on RDS) to set a lower priority
> to a connection so that that particular process (BATCH INSERT) would have a
> low impact on other running processes on PG, like live queries and single
> inserts/updates?
>
> Is that a good idea? Is this feasible with Node.js + PG?

The server could be changed so as backend processes use setpriority
and getpriority using a GUC parameter, and you could leverage priority
of processes using that. The good news is that this can be done as a
module, see an example from Fujii Masao's pg_cheat_funcs that caught
my attention actually yesterday:
https://github.com/MasaoFujii/pg_cheat_funcs/commit/a39ec1549e2af72bf101da5075c4e12d079f7c5b
The bad news is that you are on RDS, so vendor locking is preventing
you from loading any custom modules.
-- 
Michael


-- 
Sent via pgsql-performance mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance




reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Low priority batch insert
  In-Reply-To: <CAB7nPqTJD79=tnTQb+MW2Y3ERKCR9WiShTNLgkrs18bJeTxs9A@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox