🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #87181

Re: About compression with NNTP

#87181
From: Michael Baeuerle
Date: Sat, 07 Nov 2015 18:36
71 lines
3853 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > 
> > I have configured the compressor part of zlib like this:
> > |
> > | deflateInit2(strm, Z_BEST_COMPRESSION, Z_DEFLATED, -15, 9, Z_DEFAULT_STRATEGY);
> >                                                      ^^^
> > The negative sign should give a raw data stream without zlib container
> > (header, dictionary and checksum).
> 
> I was planing to use for INN:
> 
> #define MEM_LEVEL 8
> #define WINDOW_BITS (-15)      /* Raw deflate. */
> 
> deflateInit2(zstream_out, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
>              WINDOW_BITS, MEM_LEVEL, Z_DEFAULT_STRATEGY);
> 
> 
> As 8 is the default value for MEM_LEVEL, I kept it.  Do you think 9 
> would be better to use?
> [...]
>      memLevel=9 uses maximum memory for optimal speed.

I have used 9 because of the "optimal speed". Because flnews can handle
only one connection at a time, I expect no memory problems.

> Also, I see that you use Z_BEST_COMPRESSION (9).
> [...]
> 
> Do you plan on changing the compression level depending on the commands 
> you send?

I plan to add at least an API call to the compression module for this.
But I'm not sure whether it would be worth the work using it from the
NNTP module.

> It is configurable by the user?

I plan to only make config options for disabling compression completely
in 3 ways:
- No zlib installed (detected by build system)
  zlib should be an optional dependency
- Disabled at compile time (manually by user)
  flnews was originally written for historic, very slow machines (down
  to 100MHz CPU clock or less). On such machines, things will likely
  work better without compression
- Disabled at runtime
  If somebody will find a security vulnerablity in zlib in the future,
  there should be a quick way to disable usage of zlib immediately
  (until it is patched). Maybe a checkbox in the GUI like this:
  [X] Use compression if available

> I wonder whether INN should also use 9.  It may consume too many 
> resources if hundreds of users are connected.  Or be a parameter for 
> news administrators?  (this way, they could deactivate compression if 
> wanted, with the 0 value)

If INN choose a lower level like 6, it still gets the decompressor CPU
load from communication partners that have chosen 9. Looks like this
can't be configured completely in one place.
If high compression levels really will create problems for servers,
maybe forbid them in the update of the RFC draft?
Or a bit weaker like "not more than level x SHOULD be used"?
-- 
> It works.
Die Beschreibung hört sich aber eher nach "It würgs" an...

                                               Günter Frenz in ger.ct

Technical Details
Message-ID: <AABWPjINJkIAAAOH.A1.flnews@WStation1.micha.freeshell.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
References: <mvjp3s$n0u$1@news.trigofacile.com> <AABWN95ofdEAABgy.A1.flnews@WStation1.micha.freeshell.org> <AABWPOnx3uEAABCC.A1.flnews@WStation3.stz-e.de> <n1l1h4$4bb$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Message-ID: <AABWPjINJkIAAAOH.A1.flnews@WStation1.micha.freeshell.org>
Subject: Re: About compression with NNTP
Date: Sat, 7 Nov 2015 18:36:22 -0000
From: Michael Baeuerle <michael.baeuerle@gmx.net>
References: <mvjp3s$n0u$1@news.trigofacile.com> <AABWN95ofdEAABgy.A1.flnews@WStation1.micha.freeshell.org> <AABWPOnx3uEAABCC.A1.flnews@WStation3.stz-e.de> <n1l1h4$4bb$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
Newsgroups: news.software.nntp
Lines: 69
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=fixed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net MBo2oMTMe/jfNq34RHNxuAkO6oxozr/Lv3MgH8zdfpG3gN4oBW
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:9HGfEiF0qsTNWxNsiMI3neVq69Q= sha1:vJqFOFPjLAdzQ6hVadRXgoj3GvA=
Injection-Date: Sat, 7 Nov 2015 18:36:22 -0000
User-Agent: flnews/0.12 (for GNU/Linux)
X-Received-Body-CRC: 3906968340
X-Received-Bytes: 3794