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 1oEbvU-0007Pe-OA for pgsql-performance@arkaria.postgresql.org; Thu, 21 Jul 2022 19:33:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oEbvT-0002UN-Hy for pgsql-performance@arkaria.postgresql.org; Thu, 21 Jul 2022 19:33:35 +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 1oEbvT-0002OJ-3P for pgsql-performance@lists.postgresql.org; Thu, 21 Jul 2022 19:33:35 +0000 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oEbvO-0003pr-3q for pgsql-performance@lists.postgresql.org; Thu, 21 Jul 2022 19:33:34 +0000 Received: by mail-qk1-x732.google.com with SMTP id o1so2089367qkg.9 for ; Thu, 21 Jul 2022 12:33:29 -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=moAFaZfbGbjwOMV9vVqPkZlhwEipAO9a5h0VBoLtp4o=; b=v91pIE49jnrY+sMVrILs8qbnc8WCzmEl3BgBmZNEpVZiM0NezbzsoYU82UQNkAEfAr n56I42npsPZS1mjv5o6Y98vAuVjKJR98lVwa2sszGLyYGrL7heRYxk6vuiL7FCVwLZSw iRR1xOnxzVfaHaCXYDfbrkfh8+CbQGojr85WwgN1mRcEbPhh8DO7h/cHz+PZqelZl4QP 4FaT6/4FSN0iDoZNFbm2YM7zOZwvLPQswWtRtSg/PQtnxjFRpU/uJCnJnOAngirGxrn6 9QFb1qmOTe8QJJa4fsAJGy2+uZSZH1gI1nS8I8xMwBV3kauMarby8gMZp3H7NPZvJMI0 61qQ== 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=moAFaZfbGbjwOMV9vVqPkZlhwEipAO9a5h0VBoLtp4o=; b=fSqw+UD2IidDntkq4IVuWqPOAc89hhXbR6U3gd0IcbhiUsMr5OT8OeWrM4kvVS31IO QLrpdWhcu0sQV5EOk/R63+olENcdx8ik+63vSCL07nVP7zw4TnxC1+TvJBNLImPMmM+8 ofveJwTDLS+bow0eUoxy+UsEW8ZlhVr/GEMI0OfJk2QXJZGpb8uj/4NIc6xnICyyb3Br /q3M+1s7+yl89enK/1kx9boSq4yXZwnMqNtmnSg+TgTmowxR5HMZxZkA58tYawk+kbVE AkYqgnTL8QdohDNyb67JJx6NzY0ufaCMUURd1A9VY6iYa1fruayCISvcDvUBOqV1MPCF qs2Q== X-Gm-Message-State: AJIora+LS4qCCTDzOAVfVEXxOAJwHpeyMTcKv0swon1RHNWf1GkguSBA u8/nLHwkpE9h3zF5DldCcm8aGQ== X-Google-Smtp-Source: AGRyM1s5XdiriAIifHnSHEG2C+dRIqzFdTuiendwQN9P+XYEkk2Cp0N+5kBtI+mbrRxbvezIt3tB+w== X-Received: by 2002:a37:e305:0:b0:6b5:dbd5:2b64 with SMTP id y5-20020a37e305000000b006b5dbd52b64mr23220qki.272.1658432009091; Thu, 21 Jul 2022 12:33:29 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id cb8-20020a05622a1f8800b0031ece8b6666sm1836956qtb.43.2022.07.21.12.33.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jul 2022 12:33:28 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 97814800665; Thu, 21 Jul 2022 14:33:27 -0500 (CDT) Date: Thu, 21 Jul 2022 14:33:27 -0500 From: Justin Pryzby To: bruno da silva Cc: pgsql-performance@lists.postgresql.org Subject: Re: PostgresSQL 9.5.21 very slow to connect and perform basic queries Message-ID: <20220721193327.GP12702@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 Thu, Jul 21, 2022 at 02:37:35PM -0400, bruno da silva wrote: > I'm investigating an issue on a PostgresSql 9.5.21 installation that > becomes unusable in an intermittent way. Simple queries like "select > now();" could take 20s. commits take 2s. and all gets fixed after an engine > restart. > > I look into the pg logs and no signs of errors. and checkpoints are > always timed. The machine is well provisioned, load isn't too high, and cpu > io wait is under 1%. > > any suggestions on what I should check more? What OS/version is it ? What GUCs have you changed ? Is it a new issue ? https://wiki.postgresql.org/wiki/Slow_Query_Questions Operating system+version What OS / version ? At least for linux, you can get the distribution by running: tail /etc/*release GUC Settings What database configuration settings have you changed? What are their values? (These are things like "shared_buffers", "work_mem", "enable_seq_scan", "effective_io_concurrency", "effective_cache_size", etc). See Server Configuration for a useful query that will show all of your non-default database settings, in an easier to read format than posting pieces of your postgresql.conf file. -- Justin