🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #90868

Re: CNFS buffer consuming more disk space than the file size?

#90868
From: Jesse Rehmer
Date: Thu, 05 Oct 2023 21:42
184 lines
7279 bytes
On Oct 5, 2023 at 4:39:32 PM CDT, ""Billy G." <go-while)" <no-reply@no.spam>
wrote:

> On 05.10.23 16:25, Jesse Rehmer wrote:
>> This could be a ZFS/FreeBSD issue, but figure I'd start here to see if anyone
>> has seen this behavior before... I started to run tight on disk space on one
>> of my servers and noticed that the CNFS buffers were using an amount of disk
>> space that is larger than the 'actual' file size of the buffer.
>> 
>> I have this cycbuff.conf entry:
>> 
>>     cycbuff:SBIN2:/usr/local/news/spool/bin1:102400000
>> 
>> Looking at this file with 'ls' the size lines up:
>> 
>>     -rw-r--r--    1 news  news  104857600000 Oct  4 15:14 bin1
>> 
>> However, when I check actual disk space used with du it is much greater:
>> 
>>     # du -h bin1
>>     129G    bin1
>> 
>>     # du bin1
>>     135118061    bin1
>> 
>> This buffer contained 'junk' so I decided to remove it, and did reclaim 129GB
>> of space on the filesystem. How is this possible?
> 
> you have compression enabled?
> how did you create the cycbuf?
> as sparse via fallocate or filled via dd from /dev/zero?
> 
> i have zfs with compression lz4 and as you see 'ls -l' reports this size
> but 'du -h' reports real used spaced from file.
> 
> ls -l
> total 717894363
> -rw-r--r-- 1 news news 107374182400 Oct 25  2022 BIG1.cyc
> -rw-rw---- 1 news news 107374182400 Oct 27  2022 BIG2.cyc
> -rw-rw---- 1 news news 107374182400 Dec 10  2022 BIG3.cyc
> -rw-r--r-- 1 news news 107374182400 May 21 03:27 BIG4.cyc
> -rw-r--r-- 1 news news 107374182400 Nov  1  2022 BIG5.cyc
> -rw-r--r-- 1 news news 107374182400 Nov  1  2022 BIG6.cyc
> -rw-rw---- 1 news news 107374182400 Oct 27  2022 LOW10.cyc
> -rw-rw---- 1 news news 107374182400 Oct 27  2022 LOW11.cyc
> -rw-rw---- 1 news news 107374182400 Oct 27  2022 LOW12.cyc
> -rw-rw---- 1 news news 107374182400 Oct 27  2022 LOW13.cyc
> -rw-rw---- 1 news news 107374182400 Oct 28  2022 LOW14.cyc
> -rw-rw---- 1 news news 107374182400 Nov  4  2022 LOW15.cyc
> -rw-rw---- 1 news news 107374182400 Apr 10 18:08 LOW16.cyc
> -rw-rw---- 1 news news 107374182400 May 21 03:27 LOW17.cyc
> -rw-rw---- 1 news news 107374182400 Nov  6  2022 LOW18.cyc
> -rw-rw---- 1 news news 107374182400 Nov  6  2022 LOW19.cyc
> -rw-r--r-- 1 news news 107374182400 Oct 23  2022 LOW1.cyc
> -rw-rw---- 1 news news 107374182400 Nov  6  2022 LOW20.cyc
> -rw-r--r-- 1 news news 107374182400 Oct 23  2022 LOW2.cyc
> -rw-rw---- 1 news news 107374182400 Oct 24  2022 LOW3.cyc
> -rw-rw---- 1 news news 107374182400 Oct 24  2022 LOW4.cyc
> -rw-rw---- 1 news news 107374182400 Oct 25  2022 LOW5.cyc
> -rw-rw---- 1 news news 107374182400 Oct 25  2022 LOW6.cyc
> -rw-rw---- 1 news news 107374182400 Oct 26  2022 LOW7.cyc
> -rw-rw---- 1 news news 107374182400 Oct 26  2022 LOW8.cyc
> -rw-rw---- 1 news news 107374182400 Oct 26  2022 LOW9.cyc
> -rw-r--r-- 1 news news 107374182400 May 21 03:26 MID1.cyc
> -rw-rw---- 1 news news 107374182400 Oct 15  2022 MID2.cyc
> -rw-rw---- 1 news news 107374182400 Oct 15  2022 MID3.cyc
> -rw-rw---- 1 news news 107374182400 Oct 15  2022 MID4.cyc
> -rw-rw---- 1 news news 107374182400 Oct 15  2022 MID5.cyc
> -rw-rw---- 1 news news 107374182400 Oct 15  2022 MID6.cyc
> 
> 
> du -h *
> 59G     BIG1.cyc
> 50G     BIG2.cyc
> 52G     BIG3.cyc
> 4.2G    BIG4.cyc
> 33K     BIG5.cyc
> 33K     BIG6.cyc
> 34G     LOW10.cyc
> 34G     LOW11.cyc
> 35G     LOW12.cyc
> 36G     LOW13.cyc
> 36G     LOW14.cyc
> 29G     LOW15.cyc
> 29G     LOW16.cyc
> 4.7G    LOW17.cyc
> 11K     LOW18.cyc
> 11K     LOW19.cyc
> 22G     LOW1.cyc
> 11K     LOW20.cyc
> 25G     LOW2.cyc
> 21G     LOW3.cyc
> 25G     LOW4.cyc
> 33G     LOW5.cyc
> 30G     LOW6.cyc
> 31G     LOW7.cyc
> 34G     LOW8.cyc
> 36G     LOW9.cyc
> 35G     MID1.cyc
> 11K     MID2.cyc
> 11K     MID3.cyc
> 11K     MID4.cyc
> 11K     MID5.cyc
> 11K     MID6.cyc
> 
> and 'du -b' reports other size...
> 
> du -b *
> 107374182400    BIG1.cyc
> 107374182400    BIG2.cyc
> 107374182400    BIG3.cyc
> 107374182400    BIG4.cyc
> 107374182400    BIG5.cyc
> 107374182400    BIG6.cyc
> 107374182400    LOW10.cyc
> 107374182400    LOW11.cyc
> 107374182400    LOW12.cyc
> 107374182400    LOW13.cyc
> 107374182400    LOW14.cyc
> 107374182400    LOW15.cyc
> 107374182400    LOW16.cyc
> 107374182400    LOW17.cyc
> 107374182400    LOW18.cyc
> 107374182400    LOW19.cyc
> 107374182400    LOW1.cyc
> 107374182400    LOW20.cyc
> 107374182400    LOW2.cyc
> 107374182400    LOW3.cyc
> 107374182400    LOW4.cyc
> 107374182400    LOW5.cyc
> 107374182400    LOW6.cyc
> 107374182400    LOW7.cyc
> 107374182400    LOW8.cyc
> 107374182400    LOW9.cyc
> 107374182400    MID1.cyc
> 107374182400    MID2.cyc
> 107374182400    MID3.cyc
> 107374182400    MID4.cyc
> 107374182400    MID5.cyc
> 107374182400    MID6.cyc
> 
> and finaly du *
> 
> du *
> 61314603        BIG1.cyc
> 51517375        BIG2.cyc
> 53918660        BIG3.cyc
> 4385048 BIG4.cyc
> 33      BIG5.cyc
> 33      BIG6.cyc
> 35449737        LOW10.cyc
> 35492501        LOW11.cyc
> 36521650        LOW12.cyc
> 37057675        LOW13.cyc
> 36731237        LOW14.cyc
> 30020730        LOW15.cyc
> 29718199        LOW16.cyc
> 4829014 LOW17.cyc
> 11      LOW18.cyc
> 11      LOW19.cyc
> 22134082        LOW1.cyc
> 11      LOW20.cyc
> 26145542        LOW2.cyc
> 21492682        LOW3.cyc
> 25516461        LOW4.cyc
> 33670575        LOW5.cyc
> 31290129        LOW6.cyc
> 31834280        LOW7.cyc
> 35086535        LOW8.cyc
> 37314320        LOW9.cyc
> 36453183        MID1.cyc
> 11      MID2.cyc
> 11      MID3.cyc
> 11      MID4.cyc
> 11      MID5.cyc
> 11      MID6.cyc
> 
> the size of the cycbuf directory 'du -hs' is 685G, this also reports
> 'zfs list' for the dataset. with compressratio 2.97x there :)

I do have compression enabled and created the buffers with dd from /dev/zero.

In your examples the actual size is smaller, which is what I would expect, but
my situation is reverse where the actual size used is larger by about 30%.
Technical Details
Message-ID: <ufnakv$14o$1@nnrp.usenet.blueworldhosting.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <ufmh0l$2bau$1@nnrp.usenet.blueworldhosting.com> <XSFTM.7805$4rg.2638@fx09.ams4>

Show Full Headers
Complete Article Headers
Message-ID: <ufnakv$14o$1@nnrp.usenet.blueworldhosting.com>
Subject: Re: CNFS buffer consuming more disk space than the file size?
Date: Thu, 05 Oct 2023 21:42:55 +0000
From: Jesse Rehmer <jesse.rehmer@blueworldhosting.com>
References: <ufmh0l$2bau$1@nnrp.usenet.blueworldhosting.com> <XSFTM.7805$4rg.2638@fx09.ams4>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: BWH Usenet (https://usenet.blueworldhosting.com)
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 5 Oct 2023 21:42:55 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com; logging-data="1176"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Usenapp for MacOS
Cancel-Lock: sha1:P/yB4CrZ8OsDluQsYJBsrKGRgHw= sha256:prh3UIzyDIkpcDoYcs4s8SNSRWeCYbX/p+BFsRN1fd8= sha1:HcYs7bS9LO3uqBJmOfHiz+5Fxwg= sha256:ZVLE+TRK0te9aCB6MI/nX0VRfvI8Jxi2BpybLzEQpKs=
X-Usenapp: v1.27.1/d - Full License