Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izz7h-0006iz-4m for pgsql-general@arkaria.postgresql.org; Fri, 07 Feb 2020 08:36:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1izz7f-0001Hd-TQ for pgsql-general@arkaria.postgresql.org; Fri, 07 Feb 2020 08:36:23 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1izz7f-0001HW-EQ for pgsql-general@lists.postgresql.org; Fri, 07 Feb 2020 08:36:23 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1izz7c-0003Ql-W2 for pgsql-general@lists.postgresql.org; Fri, 07 Feb 2020 08:36:23 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 28B3422008 for ; Fri, 7 Feb 2020 03:36:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 07 Feb 2020 03:36:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=withers.org; h= to:from:subject:message-id:date:mime-version:content-type :content-transfer-encoding; s=mesmtp; bh=Aax0K/f5gYzdIG2ZLlbi2zO I+1Qz2SHCtGb2Fda3UCw=; b=1MUA3QWlS6dtkBnsKh4iFpf7XatDvaAJnU98X/R wavNE7hlcUTBs/YOjcMG912jiJvtzyVR01DC/uArr3WlTkC0532QBOCuFjFDykMA Vh5PnucYMQnr+8Lvf6nVh3zls6VMGMzYsBTs8TfmEp1Apn4HkOggGl8gw+U+zw3n 7XbU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Aax0K/ f5gYzdIG2ZLlbi2zOI+1Qz2SHCtGb2Fda3UCw=; b=GOpqdP5VL0v2qQtY2Xaxsu AsHEXitfNCvRHSI8Ycgewumc/koTh1Of7Ca4bDap0kmgrRUJlJwgcIqxMFunnuSq X63l75xRVS5O3O3pgqHCtOrssEP5Sgqrn5dNOen016DYfP9OthMBqh1V05SAQK1d QVxyq5AVJIRblM74Dxpx7oIiNWc9C9T8Q2tYDEF17s04u/gOcRQxkapyy5yWi2Tz kzPcV10U97ooVzIjNZjcNcl0RZXQwWLNaIHkfeQYEeW5ZGBCtmF7lJMLXhQif8ao voGV7TYdKrASPmSATMuYxRMrFRF6ceeO33AbEge8BdZc2yUXvMm9wee0Tb8iLSSw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrheeggdduvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefvhffukffffgggtgfgsehtkeertd dtfeejnecuhfhrohhmpeevhhhrihhsucghihhthhgvrhhsuceotghhrhhishesfihithhh vghrshdrohhrgheqnecukfhppedujeeirdefhedrheefrdefkeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegthhhrihhsseifihhthhgvrhhs rdhorhhg X-ME-Proxy: Received: from [192.168.168.89] (176-35-53-38.xdsl.murphx.net [176.35.53.38]) by mail.messagingengine.com (Postfix) with ESMTPA id C754C3280060 for ; Fri, 7 Feb 2020 03:36:06 -0500 (EST) To: pgsql-general@lists.postgresql.org From: Chris Withers Subject: sensible configuration of max_connections Message-ID: Date: Fri, 7 Feb 2020 08:35:45 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:73.0) Gecko/20100101 Thunderbird/73.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi All, What's a sensible way to pick the number to use for max_connections? I'm looking after a reasonable size multi-tenant cluster, where the master handles all the load and there's a slave in case of hardware failure in the master. The machine is used to host what I suspect are mainly django applications, so lots of short web requests, not sure how much, if any, django's orm does connection pooling. I arbitrarily picked 1000 for max_connections and haven't had any problems, but onboarding another app that handles a few million requests per day  on Monday and thinking about potential problems related to the number of available connections. What's "too much" for max_connections? What happens when you set it to high? What factors affect that number? cheers, Chris