🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #92819

Re: inn scalability improvements

#92819
From: Kevin Bowling
Date: Fri, 22 May 2026 06:56
55 lines
4085 bytes
On 5/21/26 22:17, Russ Allbery wrote:
> Kevin Bowling <kevin.bowling@kev009.com> writes:
> 
>> How big is your history dbz? I suspect the answer to all this is what
>> Russ was hinting at, and maybe use sqlite for history so it can do in
>> place maintenance.
> 
> I would be very curious to see if that would work. The dbz code is fairly
> optimized, but it's also very old. I'm sure there are better algorithms,
> but I don't know if a general-purpose database can go as fast. If it can,
> that would offload a lot of complexity.

They occupy two extremes in a sense; DBZ is eventually a perfect hashing 
CDB.  SQLite is a B-tree storage engine with an expressive (and 
relatively expensive) query language on top.

DBZ:
Fast lookup
Optimal disk footprint (modulo compression and encoding schemes)
Good write performance (fwrite, fflush then batched dbz maintenance)
Most expensive maintenance (entire file rewrite)
Not crash safe, fragile

SQLite:
Slower lookup (probably about a magnitude, microsecond to 10s of 
microseconds)
Less dense disk footprint (probably 3-5x, still negligible compared to 
spool)
Good write performance (WAL may greatly outperform DBZ on chaotic 
working sets even though DBZ is in theory more efficient)
Extremely fast maintenance (N expires turn into N row deletes, VACUUM 
eventually or scheduled for compaction)
One of the most robust code bases ever against known failures

The biggest justification is probably operational, all the quirks and 
oddities of history basically turn into simple SQL statements (remember, 
expire, etc).

I'm not certain how a hissqlite would interact with my recent patch:  in 
particular being able to efficiently read the whole history enchilada 
into a bloom filter with custom hash function is perfection for 
expireover.  I think sqlite has a bloom filter function internally so 
there may be a way to hook in and do something similar but it'll 
probably need to progress to a prototype to figure out all the details.

> History is one of those cases where there's probably some better algorithm
> that would be optimized for that specific purpose, but figuring out those
> algorithms is only fun for a particular set of people and then it's hard
> to find people to maintain them. :)
It strikes me that LMDB would probably be a more direct fit for this, 
and if you squint OpenLDAP and inn aren't that different (although inn 
eventually leafs down to the file server load that sendfile would 
naturally fit where LDAP is more of a key/value store).  But sqlite is 
already well integrated, basically maintenance free, and there is a cost 
to bringing in more dependencies.
Technical Details
Message-ID: <10uounf$28g7$1@csiph.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!spool1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!weretis.net!feeder9.news.weretis.net!csiph.com!.POSTED.172.83.103.228!not-for-mail
References: <10tofqn$edc$1@csiph.com> <10ujjio$23pi$1@csiph.com> <10uo9o1$1im8$1@nnrp.usenet.blueworldhosting.com> <10uod8q$1jhn$1@csiph.com> <10uoe80$n9p$1@nnrp.usenet.blueworldhosting.com> <10uof36$1ljb$1@csiph.com> <87mrxskopj.fsf@hope.eyrie.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!spool1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!weretis.net!feeder9.news.weretis.net!csiph.com!.POSTED.172.83.103.228!not-for-mail
From: Kevin Bowling <kevin.bowling@kev009.com>
Newsgroups: news.software.nntp
Subject: Re: inn scalability improvements
Date: Thu, 21 May 2026 23:56:47 -0700
Organization: csiph.com Internet News Service
Message-ID: <10uounf$28g7$1@csiph.com>
References: <10tofqn$edc$1@csiph.com> <10ujjio$23pi$1@csiph.com>
 <10uo9o1$1im8$1@nnrp.usenet.blueworldhosting.com> <10uod8q$1jhn$1@csiph.com>
 <10uoe80$n9p$1@nnrp.usenet.blueworldhosting.com> <10uof36$1ljb$1@csiph.com>
 <87mrxskopj.fsf@hope.eyrie.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 22 May 2026 06:56:47 -0000 (UTC)
Injection-Info: csiph.com; posting-host="172.83.103.228";
	logging-data="74247"; mail-complaints-to="admin@kev009.com"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:FpP7mJulQ5Akum5geK4wUoSQI98= sha256:RicKvbIGJsdDdhFTu0E2bM8lDgvp0W8/rj+UPC6+Vbk=
	sha1:3b2OPoAcgzWEbM6fc25dowulcCw= sha256:ciZMjACtmP2DoF+xB2fXX8Mj7sh0xP3jGs5VwXiSOk4=
Content-Language: en-US
In-Reply-To: <87mrxskopj.fsf@hope.eyrie.org>