Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5Jhu-0006fk-Im for pgsql-performance@arkaria.postgresql.org; Thu, 19 Oct 2017 22:54:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e5Jht-0003Us-8R for pgsql-performance@arkaria.postgresql.org; Thu, 19 Oct 2017 22:54:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e5Jhq-0003TE-PN for pgsql-performance@postgresql.org; Thu, 19 Oct 2017 22:54:26 +0000 Received: from mail-wr0-x22b.google.com ([2a00:1450:400c:c0c::22b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1e5Jhi-0005OZ-TJ for pgsql-performance@postgresql.org; Thu, 19 Oct 2017 22:54:26 +0000 Received: by mail-wr0-x22b.google.com with SMTP id g90so9789932wrd.6 for ; Thu, 19 Oct 2017 15:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HJFnpwDj01FFEvsNOIqCLNGzKrsjTzUlF57YRJxsZGo=; b=TuJHvjbiVHJBYoiuhxVhUZ7fsSmiFTnsvtsYmKR80nnoZZwsc1/HTPPuDDyTheQJRt 1HDgc1l5xqyLXa3OK7WKPBEn3mI/Q1SCjcb3swZ/agyZP7dDwasN2qawX3e6KBMjFNez g4y/w3LjJ+SVoQh8mW5xeZu3yTdVNjrC0QhFh6g+Q0nKVaTjMY84ZLq6ddxw5O0aQbez 3sPHZlFxrSd5aJnJQEdgsifFvTRK/FMDmYJBzh3HLcxC647cc74vgRLnSl/XxUt8tVIR cW9J8qs7jkvEwfhU/pkIRgmLGdqOvKo059o+0djt+gJKe6/WS1uBjiv4Wcr+0qYkn3FZ SMPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HJFnpwDj01FFEvsNOIqCLNGzKrsjTzUlF57YRJxsZGo=; b=keWn1JoRLPvl2ftlWXKpkhG0WKD2kkbYq7m51f6HbPDXb6iQYlvcz9XqKIOlMkOebp 8yHy8KmFXVHihFJecdhc7qSSslI+dHhjwADyVyIIaQ7u7zz/BinkMTh3Uq7PvfCTPZCQ 1pAjTxMwOPcTDUD0A1QQmKji7rJUm0uv4qFr/KVeUpy2HMhGPZR80T1WrfhefpyzQn/0 KHZ+po2/KnoZGdEtIVxDERhkdpTNcyup0jzcCeWbTcvE/gI6vgDMlY41MolrssYqKsBQ o9CBdaoGcsvgBHd4NxSSmSTb3qW29N2xhL5QIO9HCBVz37DLnoOhY8/4r5tEoeHbPIaH pE9g== X-Gm-Message-State: AMCzsaX1E2YnZqPucGJSGVUwHFTZiirL0hPV1JIhMB21yr678kDfhX+J IbaDH616MM6k4+WZLOOmt4BRe1faQjIB87iFIcs= X-Google-Smtp-Source: ABhQp+RpQkJEHPt68xLGiIhhZY5Fi8xxXlVTSz+KBjM2x+3//JomgnJzvfEpVAYlbiE/WMmINyZ1ODCR6r13MtpERH0= X-Received: by 10.223.186.140 with SMTP id p12mr2756587wrg.235.1508453656724; Thu, 19 Oct 2017 15:54:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.188.2 with HTTP; Thu, 19 Oct 2017 15:54:16 -0700 (PDT) In-Reply-To: References: From: Michael Paquier Date: Fri, 20 Oct 2017 07:54:16 +0900 Message-ID: Subject: Re: Low priority batch insert To: Jean Baro Cc: PostgreSQL mailing lists Content-Type: text/plain; charset="UTF-8" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On Fri, Oct 20, 2017 at 1:10 AM, Jean Baro 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 (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance