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 1noUOg-00060X-DO for pgsql-performance@arkaria.postgresql.org; Tue, 10 May 2022 18:15:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1noUOf-0007RG-8c for pgsql-performance@arkaria.postgresql.org; Tue, 10 May 2022 18:15:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1noUOe-0007R7-Qq for pgsql-performance@lists.postgresql.org; Tue, 10 May 2022 18:15:44 +0000 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1noUOc-0001ap-9v for pgsql-performance@postgresql.org; Tue, 10 May 2022 18:15:43 +0000 Received: by mail-qk1-x72e.google.com with SMTP id bs17so16539qkb.0 for ; Tue, 10 May 2022 11:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XII8jkHIloM8rD4YRoCJMqcMP7wHgvIv89t8mxdhwoY=; b=jVCyEJefpgQlQCKgfZV1V3zZCV+F6Aiyn+OD6fnnzQvOB2Ti2O8MIwjpw4nvTmiB6H hmkTQ63JVmjMcvvl7i2E+Y+zLd/v9/0fdpMusBa2iNlNmZXQiOigBsQanxRmk1gB3K/m kfcVnZcpenSFoVZtLTJrbLtYqONq391UUtLq+6lcPwwkfEDr6X61HoET/TTsl9z7xkKM 6LnYSU+7uktWVv/vquf0ZeeC+XeUw5BeyyDvZutpWVmU5dTOq6QqNrtI64BKHrc3QC/S Revw2nMbdN/kuGpoB3PKO9eLJ+h/81hKVqFqvyByCtSVf555FRCTPYqQ6SIboBFau3g0 n0/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XII8jkHIloM8rD4YRoCJMqcMP7wHgvIv89t8mxdhwoY=; b=PQP6XKpeP1df3UOqZ8S8DkPj2JWaJavT+EX6xOHA6KqKD9UA4TcO6LbHWVkFS4aTsP sQc49jshup4LYvUAHl8sFT9ZOZcMyaRateMhiyn3zMKiV+FCX6iKm6CY+ETgTEKKvMLA WNK3wu7jswYvkoaeRqGJzN83TTZ/s0ybp4RNw+fZc4g0kLfLGc1pEG9AghGrLUP1yyDu Q5/iUJqSRllFE9+zJUZX++70101clMhN5lTuvignWSFYt1WqI56YMQyA831ct8qt6hsS pnoulsqm+8+x2m6SDlds5R0ZaYps/gVUBLionJS358CwR2ZVcJ63H8U8tLyzvrCcu3IV pdyw== X-Gm-Message-State: AOAM530OlEozQj2Zkri0dxLZPIdnj6rOfRSbiGztkO3+XzPj+F6f8akh LXDqcsCgQ6ARV3ZhRvAzK5ejTA== X-Google-Smtp-Source: ABdhPJzWQgUDGPux2+/+8WXFNGzwjzWydOG4qgzLjuVjeHIxz9c2XzNTVbpK0ZnwEKjTSg3wNMqzCQ== X-Received: by 2002:a05:620a:270c:b0:6a0:92b9:8196 with SMTP id b12-20020a05620a270c00b006a092b98196mr7981550qkp.417.1652206541450; Tue, 10 May 2022 11:15:41 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id h3-20020ac85483000000b002f39b99f6c7sm9294865qtq.97.2022.05.10.11.15.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 May 2022 11:15:41 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 4BC89800990; Tue, 10 May 2022 13:15:40 -0500 (CDT) Date: Tue, 10 May 2022 13:15:40 -0500 From: Justin Pryzby To: Sudhir Guna Cc: pgsql-performance@postgresql.org Subject: Re: DB connection issue suggestions Message-ID: <20220510181540.GC19626@telsasoft.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, May 11, 2022 at 12:59:01AM +0800, Sudhir Guna wrote: > Dear All, > > We have recently upgraded Postgresql 9.4 standalone server to Postgresql > 11.2 with High Availability (2 servers : Master and Standby). > > While trying to test using ETL applications and reports, we observe that > the ETL jobs fails with below error, > > 2022/05/06 16:27:36 - Error occurred while trying to connect to the database > 2022/05/06 16:27:36 - Error connecting to database: (using class > org.postgresql.Driver) > 2022/05/06 16:27:36 - FATAL: Sorry, too many clients already > > We have increased the max_connections = 1000 in postgresql.conf file. > > It worked ok for a day and later we get the same error message. > > Please help to advise on any additional settings required. The prior > Postgresql 9.4 had the default max_connections = 100 and the applications > worked fine. It sounds like at least one thing is still running, perhaps running very slowly. You should monitor the number of connections to figure out what. If you expect to be able to run with only 100 connections, then when connections>200, there's already over 100 connections which shouldn't still be there. You could query pg_stat_activity to determine what they're doing - trying to run a slow query ? Are all/most of them stuck doing the same thing ? You should try to provide the information here for the slow query, and for the rest of your environment. https://wiki.postgresql.org/wiki/Slow_Query_Questions -- Justin