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 1oEcgE-00016c-Kc for pgsql-performance@arkaria.postgresql.org; Thu, 21 Jul 2022 20:21:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oEcgD-0003gK-Hh for pgsql-performance@arkaria.postgresql.org; Thu, 21 Jul 2022 20:21:53 +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 1oEcgD-0003bg-7K for pgsql-performance@lists.postgresql.org; Thu, 21 Jul 2022 20:21:53 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oEcgA-0007Q3-2O for pgsql-performance@lists.postgresql.org; Thu, 21 Jul 2022 20:21:52 +0000 Received: by mail-qk1-x734.google.com with SMTP id l3so2219245qkl.3 for ; Thu, 21 Jul 2022 13:21:49 -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:mime-version:content-disposition :in-reply-to:user-agent; bh=4+uzEl7xXQI1/a7SXxX4UFTCodoHIeQIbYzz2ocsrFE=; b=Gbfewd1o6uID4MZIn0XhaCcT5zeQXpaMzjvitzYZBAG1A9NsCQwS8A5IKyWacNbwX2 YqIoLzdIG26f9nmxsInDa0WwXDgZ24XiGMT/IhhhLRlWsvGDWiGmxzfnbUZEHgaib0FV A+1mbGIGfUWWFgkKgSDbHe0XP6HHzaAkQhbeyA9MPC0U7g3VKWAIe+FZauXrMfwCj3ak tFQql+t+i6P54vgJCa+PAeP+z8ZPsyW168Z3Ohc26ksInaOENZg2yMHXXE06Yq8BWdhs +Kw3XLtODjsPqkQ9l80KkU8Cho9aCXP+hcxvoaGZ4cAan5oeBvLOgKo7Qf8FU9gJtImY whdQ== 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:mime-version :content-disposition:in-reply-to:user-agent; bh=4+uzEl7xXQI1/a7SXxX4UFTCodoHIeQIbYzz2ocsrFE=; b=YzMu1E9dLHH81kgyupcd23owN9eC0o1gT8SJ2S8YnN8cAwuoWOC4YRc8hyJc2fqs2i L2QsSnjmY+UwzXG4KJljiDSjs5hSf+dFHaFjH5qpetVv2F1b5TqECl4ygQJoVprULYTL FtzMnuMcJ16L1Vhu9ZO2zhdT06tGcI/l55lOQRLet/ZawbJrhGIxLrdWxx49lfh+khRS KDs81BsmsFnMegWO6uYXN3I+nVOAp/feWeKwgfWz/eRwhJNr5fPbaQ7NchBOGOzFuV37 ZCj8dMiNoh+3AcSodaVhVNdwAzkjA0xBNBLgVYGNRFdD3zUYA7JPzBHN1ZydaPpzM2YW u4bg== X-Gm-Message-State: AJIora+K2MbhOGLbA8CmGB8n1W/CGFMVajZFCEsZL7p49hmT1Tzb8IfD NrnqJkDNNVq4iFWp7ifkOpxwcw== X-Google-Smtp-Source: AGRyM1uFJ+DOjg4iYpnlo0VpGzY5KRN65pYfTgjtZ5GGm69o58i2OT+UhddZkGFJ3Hp3CFDUEYjutg== X-Received: by 2002:a05:620a:f:b0:6b5:e246:b6f with SMTP id j15-20020a05620a000f00b006b5e2460b6fmr160729qki.728.1658434908269; Thu, 21 Jul 2022 13:21:48 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id bj26-20020a05620a191a00b006af50b6f10csm2033876qkb.61.2022.07.21.13.21.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jul 2022 13:21:47 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 0577A8008DE; Thu, 21 Jul 2022 15:21:46 -0500 (CDT) Date: Thu, 21 Jul 2022 15:21:46 -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: <20220721202146.GR12702@telsasoft.com> 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 03:59:30PM -0400, bruno da silva wrote: > OS/version: CentOS release 6.9 (Final) How are these set ? tail /sys/kernel/mm/ksm/run /sys/kernel/mm/transparent_hugepage/{defrag,enabled,khugepaged/defrag} /proc/sys/vm/zone_reclaim_mode I suspect you may be suffering from issues with transparent huge pages. I suggest to disable KSM and THP, or upgrade to a newer OS. I've written before about these: https://www.postgresql.org/message-id/20170524155855.GH31097@telsasoft.com https://www.postgresql.org/message-id/20190625162338.GF18602@telsasoft.com https://www.postgresql.org/message-id/20170718180152.GE17566@telsasoft.com https://www.postgresql.org/message-id/20191004060300.GA11241@telsasoft.com https://www.postgresql.org/message-id/20200413144254.GS2228@telsasoft.com https://www.postgresql.org/message-id/20220329182453.GA28503@telsasoft.com On Thu, Jul 21, 2022 at 04:01:10PM -0400, bruno da silva wrote: > The issue started a month ago. Ok .. but how long has the DB been running under this environment ? -- Justin