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 1nueDn-0001lq-Tx for pgsql-performance@arkaria.postgresql.org; Fri, 27 May 2022 17:57:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nueCo-00083I-GT for pgsql-performance@arkaria.postgresql.org; Fri, 27 May 2022 17:56:58 +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 1nueCo-000833-2T for pgsql-performance@lists.postgresql.org; Fri, 27 May 2022 17:56:58 +0000 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nueCg-0007kJ-Nn for pgsql-performance@lists.postgresql.org; Fri, 27 May 2022 17:56:56 +0000 Received: by mail-io1-xd2c.google.com with SMTP id e3so5381699ios.6 for ; Fri, 27 May 2022 10:56:50 -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:content-transfer-encoding:in-reply-to :user-agent; bh=MXA4vcK3DSHWWm2QyIhsDQMezR8jEv76yIXrXWPqtyE=; b=FPNFvyyjIe4uCTqouqeGJODqW6CDoW7XJZB0J5F6Iy7LUSbBMZR+97lSbdz9B0lc8H py2DOED83/HnliId4vqTsNxC/vLLSIkBi1/PckhHivSDyAQmIqxLcOsgAth+pplnQef/ 4+CiTUr7y0UwdnoDMr02G/XSjz+6Iget6kNQnjsnRvmRJs2ubjOnpbrDIrP67qc3jWGV oYkmHYWpRKmzwBkoVI82xXhh9ofHuiERln5Rhjbggpwfaf8cEaVTk8hOo2bASAQg3iMM +izloYrdDV5DNztmryr7JArd6O841Nsj7HCiK3b85EIIBSD7YFpCwmNwh/nHu/7S6lgC LikA== 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:content-transfer-encoding :in-reply-to:user-agent; bh=MXA4vcK3DSHWWm2QyIhsDQMezR8jEv76yIXrXWPqtyE=; b=wBfh37HKccSoSX0NlPo3XVC77M6iK2zOfSE9YltFMTziTgDjJHlaRvh/3lsnZ/T1wO TgCmveDTjxMruH7PuX2TGWXTpl1mPlnfaC6V2zV3iUVcufqNUfICL+Lm9GSK1qI5Ngm3 PFBCefUa1OIHK6pJx5Blg+4eaMomqNTQ9gxqjC8DDcvDmW/zcx5GLKr1Z+K//DspqFvq t0kBTKqdCJGaHNYQSZxLcpjBTVq7nCBs+OE3k9uG4oFjyEln2w4TsD2lxjxAysykJjuo 0c1cPQho6Qv0I4AAuXHu/PBmGcfdhAHOFnj2gVSX5HROXvhwOQxiPkPSpYVazLVlcuYH 9crQ== X-Gm-Message-State: AOAM532aWjd4J2lDSE4o+5Xx9T9IJKmvH2ui7JWRpvCbHiJhyP0cbrx+ jdAcZcOxZ+cQWWe+zllBbaFQlZCmRGuIWg== X-Google-Smtp-Source: ABdhPJyPsqthAq4LUw8CkupOjJE/K0Bo9qT409wj2Fj6Gndw5ZBP78Ut77miea9p/lLiQGiP/uDD0Q== X-Received: by 2002:a05:6602:490:b0:65d:cfc5:9221 with SMTP id y16-20020a056602049000b0065dcfc59221mr19139918iov.0.1653674209690; Fri, 27 May 2022 10:56:49 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id g14-20020a92d7ce000000b002d1a16ef24dsm1470346ilq.82.2022.05.27.10.56.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 May 2022 10:56:49 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id E7FBC800760; Fri, 27 May 2022 12:56:47 -0500 (CDT) Date: Fri, 27 May 2022 12:56:47 -0500 From: Justin Pryzby To: =?utf-8?B?5b6Q5b+X5a6H5b6Q?= Cc: pgsql-performance@lists.postgresql.org Subject: Re: How to monitor Postgres real memory usage Message-ID: <20220527175647.GG19626@telsasoft.com> References: <20220524174050.GI19626@telsasoft.com> <20220526160519.GB19626@telsasoft.com> <20220526233528.GD19626@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 Sat, May 28, 2022 at 01:40:14AM +0800, 徐志宇徐 wrote: > vm.swappiness=0 I think this is related to the problem. swappiness=0 means to *never* use swap, even if that means that processes are killed. If you really wanted that, you should remove the swap space. Swap is extremely slow and worth avoiding, but this doesn't let you use it at all. You can't even look at your swap usage as a diagnostic measure to tell if things had been paged out at some point. I *suspect* the problem will go away if you set swappiness=1 in /proc (and in sysctl.conf). -- Justin