Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLrtB-0000Ds-3q for pgsql-general@arkaria.postgresql.org; Tue, 07 Apr 2020 17:19:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jLrtA-0002c3-03 for pgsql-general@arkaria.postgresql.org; Tue, 07 Apr 2020 17:19:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLrt9-0002bv-LB for pgsql-general@lists.postgresql.org; Tue, 07 Apr 2020 17:19:51 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jLrt6-0007TR-Uz for pgsql-general@postgresql.org; Tue, 07 Apr 2020 17:19:51 +0000 Received: by mail-wr1-x430.google.com with SMTP id k1so4832861wrm.3 for ; Tue, 07 Apr 2020 10:19:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=+3ksO2WnywQynSSB1MPGQxJGfMbEn9OnOQCChgBeHcQ=; b=sOkAy9Ss2fOw4GtDFWm758siyS34WkY+4VfMdJTRjbcIzQ7Ud4AICSEB9XZwBvDtog JQc5teD6Q2T+lcDZoM5jLXhdL0rbhZXPFioPA/Euu2HXXQJgPmHuaKhm7dnRcil53vPy HdHGgkLLBLfZPeSQ6+43idF9U657KtmWBz2+lZtcpuzzHpEpgXrfmP/wu3IppF2k0tpc Rth65gNNCSN67wNws1VdeAw/MEDGfRk4yEha+q+2NL6y8bRnVJS/D05DkLU0I2kxAsJz 1oopqxAigCVhhTihJcfWe8GceXJyjcDdJSvT1kzRWotgEgFhSH0YutRwhSysBP+f83cl wnsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=+3ksO2WnywQynSSB1MPGQxJGfMbEn9OnOQCChgBeHcQ=; b=Kjr8X+PcugkIe+x7FjZNnOln5c8UuOD5SzBByiom8y34JlYTy3M34EkFoduqu6kn4G Vaq4Vnd8lLGcqSRk/5bMOl2G40/xnvPTNS6W3G/VVnm8q7G1HGKo4jMJDaHTolGs5woV A+om4zzl+jK3DrDmhbRR4/TgKvxYxefsp9wVV7M0XpFteuwYvUEyoYfm7bXwMs7fWSLX 1aFQBvk62tbc3yw38WPhRPv11VXutkzwUb3itMjwuhsqRy6xcjxzUtoJrD6/JVq77N69 XQM6TekwuLjJ/wyHm7l1Kl/dKguGNgnYLGX+OjNa7FZtPcoK0y0wiWyWipnuzAs7T9vF GdPQ== X-Gm-Message-State: AGi0PuYNokBPf+2ter0WB/VLMRRJaA1lsBphLfQT23NXcNSb/kjAoaXs 0Ra6HbyNaLXV0IvPVhEtB7Tl2g== X-Google-Smtp-Source: APiQypIBYI6Q7csSACb93mE8rTMettbwlxUUhZC12G9nH6gNbnFpkr1l5iuiEa0bEYOECacot6wZAw== X-Received: by 2002:adf:db41:: with SMTP id f1mr4022071wrj.247.1586279987885; Tue, 07 Apr 2020 10:19:47 -0700 (PDT) Received: from dynamic-eo9lc8043u2qr9u6l-pd01.res.v6.highway.a1.net (dynamic-eo9lc8043u2qr9u6l-pd01.res.v6.highway.a1.net. [2001:871:60:9a62:6597:76d3:1e4c:440d]) by smtp.gmail.com with ESMTPSA id b11sm31685828wrq.26.2020.04.07.10.19.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2020 10:19:47 -0700 (PDT) Message-ID: <3fd51f3222a35e227484afae34796d3f4f667567.camel@cybertec.at> Subject: Re: Estimated resources for a 500 connections instance (VM) From: Laurenz Albe To: David Gauthier , Postgres General Date: Tue, 07 Apr 2020 19:19:46 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 2020-04-07 at 12:24 -0400, David Gauthier wrote: > psql (9.6.0, server 11.3) on linux > > We've ramped up usage on a PG server (a VM, I have no choice about this) and are approaching the > 100 connections limit. We could increase the limit, but I've read that this can lead to a > degradation in performance. If we bump it up to 500, what kind of compute resources would that > require (mem/cpu)? Any estimates ? You should upgrade to the latest minor release. Don't increase max_connections. The main problem is that the more connections there are, the greater the likelihood that too many of them will be active, overloading the database machine. This can for example happen if a DDL statement has to wait behind a lock. Then other queries will "pile up" behind it, and as soon as the DDL is done or canceled, the avalance will break loose. The better solution is to use a connection pool. If your application doesn't have one, use pgBouncer. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com