Re: Database for greylisting plugin.

Bruce Guenter <[email protected]> Thu, 7 Dec 2006 22:33:16 -0600
Newsgroups gmane.comp.sysutils.bgware
Message-ID <[email protected]>
On Fri, Dec 08, 2006 at 02:23:34PM +1100, Graham Miller wrote:
> On another hand, simpler systems I have seen use Berkeley style file system
> DBs. These are more prevalent on unix/linux hosts, but lack simple add hock
> query ability and detailed record structures.

One con to using the Berkeley/SleepyCat db libraries is that they change
their file format every other release, and you can't even read the old
databases with new libraries.  On the other hand, they work, and they
work well.

> Another option is DJBs cdb, but that seems to be tuned for read only
> applications rather than write intensive ones like a greylisting program.

No, as you say, CDBs are only appropriate for data that changes rarely.

> The current greylistd C program I am using in a beta test server on one
> domain that gets lots of spam, is using the filesystem and files named after
> their IP address. This seems to be working ok so far, but I have concerns
> about the number of files that end up being cached by the OS and robbing
> server RAM.

If you can arrange to have either completely empty files or small
numbers of files with larger contents, then I wouldn't worry about the
caching hit.  Either using the filesystem as the database or adding a
database layer, the OS is going to have to cache the data, and the file
names themselves are not any more expensive than putting it in a
database.  The OS will want to cache an inode to provide timestamp
information, which starts to get a bit bigger, but still not a huge
issue.

Using the filesystem is vastly simpler for debugging and emergency
maintenance, as standard file tools work.
-- 
Bruce Guenter <[email protected]>                http://untroubled.org/
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFeOsM6W+y3GmZgOgRAti+AJ9Zx/Mgj6Zwq7FwQmc7A6J1Pb3STQCfZQFJ
bdFyET23HNoi+xp0Y0mDVhg=
=BG/n
-----END PGP SIGNATURE-----