🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #90867

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

#90867
From: Billy G. (go-while)
Date: Thu, 05 Oct 2023 21:39
176 lines
6386 bytes
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 :)
Technical Details
Message-ID: <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
References: <ufmh0l$2bau$1@nnrp.usenet.blueworldhosting.com>

Show Full Headers
Complete Article Headers
Message-ID: <XSFTM.7805$4rg.2638@fx09.ams4>
Subject: Re: CNFS buffer consuming more disk space than the file size?
Date: Thu, 5 Oct 2023 23:39:32 +0200
From: "Billy G. (go-while)" <no-reply@no.spam>
References: <ufmh0l$2bau$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
Mime-Version: 1.0
User-Agent: NoZilla/3.11 (Hackint; Unicorn; rv:0.8.15) go-while/19720229 NewsRW/4.2.0
Newsgroups: news.software.nntp
Content-Language: en-US
Organization: github.com/go-while
In-Reply-To: <ufmh0l$2bau$1@nnrp.usenet.blueworldhosting.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 176
X-Complaints-To: abuse@blocknews.net
Nntp-Posting-Date: Thu, 05 Oct 2023 21:27:19 UTC