🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #83942

Re: The Numbers Game

#83942
From: John F. Morse
Date: Mon, 28 Mar 2011 03:04
151 lines
5665 bytes
Hi Julien,

>> CNFS buffer status:
>> Buffer Class Size Used %Used Cycles KB/sec Days
>> fstbn01 fastbins 2.0 GB 1010.9 MB 49.4% 1 0.17 142.35
>>
>> If the cycbuff is 2.0 GB in size, then if it is 1010.9 MB full, it
>> should show 50.5 %Used.
>
> No.  Be careful you are not dividing with the same unit.
> 1 GB = 1024 MB
>
> 1010.9/(2.0 * 1024) = 0.4936
> Which is 49.4%.


Not knowing the unit was MiB, I had used 1010.9/2000.

Which was my next guess shown below. ;-)


>> I suspect you could say that when it gets 1024.0 MB full, then it will
>> be 50.0 %Used.
>
> Actually, the size is not the size of the total buffer, but the size 
> of the body of the buffer (where the articles can be written, after 
> the header).
> So if your buffer is exactly 2 GB, the real size is a bit inferior.
>
> 1010,9 MB <-> 49.4 %
> x      <-> 50 %
>
> x = 1023.2 MB
> but of course, with rounding in percentages and sizes, x is not 
> exactly 1023.2 MB.  At least, x < 1024 MB.


ls -l shows:

-rw-r--r--  1 news news 2147482624 Mar 27 17:24 fstbn01

The 2 GB cycbuffs are 2147482624, which I determined to be the maximum I 
could create.

dd if=/dev/zero of=/var/spool/news/cycbuffs/fstbn01 bs=1k count=2097151

2097151 = 0x20000-1


>> But that 1.1% low "error" is reversed in the following line:
>>
>> junk03 junk 2.0 GB 1.0 GB 51.8% 0 1.97 12.30
>>
>> Here the 51.8% error is 1.8% too much.
>
> Here, we have GB for both of these values.
> As the previous computed x may be 1023 MB, the size may be:
> (2 x 1023)/1024 = 1.998 GB
>
> With the round-to-even Perl method, 1.0 GB is up to 1.050 GB and then:
> 1.050/1.998 = 0.526
> 1.030/1.998 = 0.516
>
> I am therefore not surprised to read 51.8%.


OK. So Perl does some rounding.


>> Just what algorithm is used to determine the percent (%Used)
>
> Used/Size.
>
> And please do not forget that the computation is done on the "real" 
> (un-rounded) values.  It is not done on the already rounded values.


Computation is on binary digits, while the Daily Report is generated in 
Perl, therefore some rounding error will exist?


>> and what
>> method of units is used for representing Megabytes and Gigabytes (MB vs
>> MiB and/or GB vs GiB)?
>
> These are real GB (with the 1024 factor) in innreport.


The GiB units and not the GB. Thanks for the verification.


>> Buffer fstbn01, size: 2.00 GBytes, position: 1011 MBytes 1.49 cycles
>
> Length of the writable area:  between 1.995 GB and 2.005 GB.
> 1011/(1.995*1024) = 0.495
> 1011/(2.005*1024) = 0.492
> It corresponds to the 49% of the current cycle.
>
>> Buffer junk03, size: 2.00 GBytes, position: 1.06 GBytes 0.53 cycles
>
> 1.06/2.00 = 0.53
> This one was easy :)


Yes, and thanks for verifying that the IEC definitions were used instead 
of SI definitions.

I've noticed another oddity in the Daily Reports.

If you have time, could you describe what "Days" means and how "Days" is 
computed?

 From two Daily Reports, the first one for March 25, and the second a 
day later for March 26, they illustrate a wide disagreement on the 
"Days" data:

CNFS buffer status:
Buffer        Class              Size      Used   %Used Cycles  KB/sec     Days
fstbn01       fastbins         2.0 GB 1010.1 MB   49.3%      1    0.12   196.69

CNFS buffer status:
Buffer        Class              Size      Used   %Used Cycles  KB/sec     Days
fstbn01       fastbins         2.0 GB 1010.9 MB   49.4%      1    0.17   142.35


Now compare these two with the cnfsstat output showing the oldest 
article was accepted (injected) 86 days ago:

Class fastbins for groups matching "*.bina*,!local.binaries"
 Buffer fstbn01, size:  2.00 GBytes, position:  1011 MBytes  1.49 cycles
  Newest: 2011-03-27 17:24:53,    0 days,  4:08:48 ago
  Oldest: 2010-12-31 14:24:50,   86 days,  6:08:51 ago

Additionally cnfsheadconf -c fstbn01 shows:

 Buffer fstbn01, len: 2048.00 Mbytes, used: 1011.03 Mbytes (49.4%)   1 
cycles
  Meta , order: 0, current: TRUE, blocksize: 4096
  Newest: 2011-03-27 17:24:53,    0 days,  4:26:23 ago

It is the only cycbuff in the metacycbuff.

Three different values are shown. Any idea why?

Thanks Julien.


-- 
John

When a person has -- whether they knew it or not -- already rejected the Truth, by what means do they discern a lie?
Technical Details
Message-ID: <imotso$9ad$1@n102.xanadu-bbs.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news.glorb.com!news2.glorb.com!v102.xanadu-bbs.net!n102.xanadu-bbs.net!.POSTED!not-for-mail
References: <imntim$k8$1@n102.xanadu-bbs.net> <8v9lqiFcmgU1@mid.individual.net>

Show Full Headers
Complete Article Headers
Message-ID: <imotso$9ad$1@n102.xanadu-bbs.net>
Subject: Re: The Numbers Game
Date: Sun, 27 Mar 2011 22:04:56 -0500
From: "John F. Morse" <john@example.invalid>
References: <imntim$k8$1@n102.xanadu-bbs.net> <8v9lqiFcmgU1@mid.individual.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news.glorb.com!news2.glorb.com!v102.xanadu-bbs.net!n102.xanadu-bbs.net!.POSTED!not-for-mail
Newsgroups: news.software.nntp
Organization: Xanadu BBS
Lines: 151
Reply-To: dont.bother
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: n102.xanadu-bbs.net 1301281496 9549 192.168.89.210 (28 Mar 2011
X-Complaints-To: newsmaster@xanadu-bbs.net
NNTP-Posting-Date: Mon, 28 Mar 2011 03:04:56 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.24 (X11/20101027)
In-Reply-To: <8v9lqiFcmgU1@mid.individual.net>
X-Enigmail-Version: 0.96.0
X-Original-Bytes: 5416