Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1waJQa-001gdm-0i for pgsql-admin@arkaria.postgresql.org; Thu, 18 Jun 2026 20:33:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1waJQY-00DSJH-0T for pgsql-admin@arkaria.postgresql.org; Thu, 18 Jun 2026 20:33:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1waJQX-00DSJ8-1j for pgsql-admin@lists.postgresql.org; Thu, 18 Jun 2026 20:33:29 +0000 Received: from forward501b.mail.yandex.net ([178.154.239.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1waJQT-000000011xp-3wHQ for pgsql-admin@lists.postgresql.org; Thu, 18 Jun 2026 20:33:28 +0000 Received: from mail-nwsmtp-smtp-production-main-67.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-67.sas.yp-c.yandex.net [IPv6:2a02:6b8:c24:221f:0:640:b03f:0]) by forward501b.mail.yandex.net (Yandex) with ESMTPS id 8AAB08158E; Thu, 18 Jun 2026 23:33:21 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-67.sas.yp-c.yandex.net (smtp) with ESMTPSA id KXZKJIEdMKo0-BociER0M; Thu, 18 Jun 2026 23:33:21 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1781814801; bh=HtTPiZKB37AQx4Cs4x+uuol8Vid4b0lOEx88oCyystU=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=TytOKjspvFBkaGQgXFHhiaK3BC2kz1aiqGlgGY1DvNZKivfqBucA5NpxP7o3cwTgS Se4k+Sn/SS7e1Ru0Ph+rY1APpAOdaUKT6KxFl5xWOt2u1DWNNl5sjyuOD5Xtzd96Qs BvnzUIZxuogV3J7mC1TTfr5k4agf408btEdyPmt8= Authentication-Results: mail-nwsmtp-smtp-production-main-67.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <4d25050c-2690-4683-bebf-7da5301cb44a@yandex.ru> Date: Thu, 18 Jun 2026 23:33:20 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: AW: Size of /pgdata To: "William Sescu (Suva)" , Raj Cc: Laurenz Albe , Pgsql-admin References: <3a2c4d549587beb3528f6ce09b3d4c448d32f8ee.camel@cybertec.at> Content-Language: en-US, ru From: Aleksey M Boltenkov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/18/26 07:59, William Sescu (Suva) wrote: > By setting XFS allocsize, you switch off the dynamic behavior, and it > becomes more predictable. > > Another fix might be a switch to a different filesystem. E.g. ext4 > > While this XFS feature is a quite old one, I have seen it the first time > kicking in quite heavily only on Red Hat 9, with PostgreSQL 18 and > > only on the standby. Some times double the size for some files. > > *Von:*Raj > *Gesendet:* Mittwoch, 17. Juni 2026 20:46 > *An:* Sescu William (SW0) > *Cc:* Laurenz Albe ; Pgsql-admin admin@lists.postgresql.org> > *Betreff:* Re: Size of /pgdata > > Yes, this is what I have been asking. I also mentioned/asked earlier > whether it's Abt XFS file system. > > I checked bitmaps and under flags I could find 'unwritten preallocated > extent'. --apparent-size says shows correct size. > > Is the fix - setting up allocsize? > > On Wed, 17 Jun 2026, 19:29 William Sescu (Suva), > wrote: > > In case you are using XFS, this might be related to the "Speculative > preallocation" feature. > We saw the same behavior on Redhat 9, with PostgreSQL 18 and XFS. > > https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/ > html/storage_administration_guide/migrating-ext4-xfs docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/ > storage_administration_guide/migrating-ext4-xfs> > > Speculative preallocation > > XFS uses speculative preallocation to allocate blocks past EOF as > files are written. This avoids file fragmentation due to concurrent > streaming write workloads on NFS servers. By default, this > preallocation increases with the size of the file and will be > apparent in "du" output. If a file with speculative preallocation is > not dirtied for five minutes the preallocation will be discarded. If > the inode is cycled out of cache before that time, then the > preallocation will be discarded when the inode is reclaimed. > If premature ENOSPC problems are seen due to speculative > preallocation, a fixed preallocation amount may be specified with > the -o allocsize=amount mount option. > > See also "man xfs" > > allocsize=size > Sets  the  buffered  I/O end-of-file preallocation size when doing > delayed allocation writeout. Valid values for this option are page > size (typically 4KiB) through to > 1GiB, inclusive, in power-of-2 increments. > > The default behavior is for dynamic end-of-file preallocation size, > which uses a set of heuristics to optimise the preallocation size > based on the current  allocation > patterns within the file and the access patterns to the file. > Specifying a fixed allocsize value turns off the dynamic behavior. > > > Cheers > William > > > -----Ursprüngliche Nachricht----- > Von: Laurenz Albe > > Gesendet: Mittwoch, 17. Juni 2026 13:34 > An: Raj > > Cc: Pgsql-admin admin@lists.postgresql.org>> > Betreff: Re: Size of /pgdata > > > >   ACHTUNG: Diese Nachricht kommt von extern. Seien Sie kritisch > beim Öffnen von Links und Anhängen. > > > > > On Wed, 2026-06-17 at 11:47 +0530, Raj wrote: > > The file count is same between them..but the file size varies. > > > > For example, assume node1 has issue and node2 is clean. > > > > 1. On both nodes file count is 76 > > 2. File size varies for some of them > > > > Each files are either 1GB or 2GB and some or them are 1.2gb or > 1.5gb or between 1-2gb ....by looking at files.. > >  In the problematic node, some of the 1gb files in node2  shows > 2GB in node1...and also file size differences. making the difference. > > That is highly suspicious. > > What do you get if you run > >   SHOW segment_size; > > Unless you built PostgreSQL yourself after changing the segment > size, it should be 1GB.  But then it would be impossible for some > segment to be bigger than 1GB. > > Are you using some weird file system that reports file sizes wrongly? > > What does "ls -l" on one of these big files show? > > Yours, > Laurenz Albe > > > > ________________________________ > > Disclaimer: > > Diese Nachricht und ihr eventuell angehängte Dateien sind nur für > den Adressaten bestimmt. Sie kann vertrauliche oder gesetzlich > geschützte Daten oder Informationen beinhalten. Falls Sie diese > Nachricht irrtümlich erreicht hat, bitten wir Sie höflich, diese > unter Ausschluss jeglicher Reproduktion zu löschen und die > absendende Person zu benachrichtigen. Danke für Ihre Hilfe. > > This message and any attached files are for the sole use of the > recipient named above. It may contain confidential or legally > protected data or information. If you have received this message in > error, please delete it without making any copies whatsoever and > notify the sender. Thank you for your assistance. > R U joking? Preallocation is around kilobytes, some time megabytes.