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 1kIoWF-0006tQ-V9 for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Sep 2020 07:39:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kIoWD-0002BH-R4 for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Sep 2020 07:39:49 +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 1kIoWD-0002BA-F6 for pgsql-bugs@lists.postgresql.org; Thu, 17 Sep 2020 07:39:49 +0000 Received: from mail.dalibo.com ([212.85.157.172]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIoWB-0008Ti-9Z for pgsql-bugs@lists.postgresql.org; Thu, 17 Sep 2020 07:39:49 +0000 Received: from firost (larco.ioguix.net [82.66.0.6]) by mail.dalibo.com (Postfix) with ESMTPSA id 7B7571FC59; Thu, 17 Sep 2020 09:39:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1600328385; bh=eETncXOK2X694YepVM40Xcdelckj8TUtwPU0p+N2xxE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=asN4Ezs33d5LBAPXye9JTv+hn333VEcMenDCPl05puBrx2UPuOknBblSjC6UwRSxY Ep+Q22dO3l2kUh7WHnjsZ5MYiK8+b6+8hz6CHK+ZkY5MBTeWVJflC6EokH54pTZ3XG qUC21xKjOKbP4SHCF+fxsgUqmF/TORNKZ626ps9A= Date: Thu, 17 Sep 2020 09:39:44 +0200 From: Jehan-Guillaume de Rorthais To: =?UTF-8?B?UkVDSFTDiQ==?= Marc Cc: pgsql-bugs@lists.postgresql.org Subject: Re: Inconsitancies in pg_stat_bgwriter and pg_stat_database returned values Message-ID: <20200917093944.528c26a3@firost> In-Reply-To: <746448376.8762238.1600324690698.JavaMail.zimbra@meteo.fr> References: <721986302.8509039.1600268805471.JavaMail.zimbra@meteo.fr> <20200916173124.297baa41@firost> <746448376.8762238.1600324690698.JavaMail.zimbra@meteo.fr> Organization: Dalibo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 17 Sep 2020 08:38:10 +0200 (CEST) RECHT=C3=89 Marc wrote: [...] > The full row are different in your example, not just a few fields. It loo= ks > like mixed values from different instance. >=20 > Could you share some more informations about the context and how to repro= duce > it? >=20 > Regards, >=20 > Hello=20 >=20 > Thanks a lot, you got it right: there are 2 instances on this machine and > they are both configured with: >=20 > stats_temp_directory =3D '/dev/shm' >=20 > We some time ago tried, stats_temp_directory =3D '/dev/shm/instance', but > PostgreSQL ignored the subdirectory part and kept creating the temp file = at > the FS root. As this is a temporary FS, one cannot in advance create the > instance subdirectory as it is wiped out between reboots. Use "/var/run/postgresql/instance_name" and setup systemd tmpfiles to create the folder automatically. Eg.: cat < /etc/tmpfiles.d/postgresql-stats.conf # Directory for PostgreSQL temp stat files d /var/run/postgresql/stats-instance_name 0700 postgres postgres - - EOF You can add as many folders as you need. To take this file in consideration immediately without rebooting the server, run the following command: systemd-tmpfiles --create /etc/tmpfiles.d/postgresql-stats.conf Regards,