Database maintenance

Why ?^

Many modules store data which is only relevant / of interest for a certain amount of time. For example: you probably don’t want to store a greylisting allowance, created one year ago and which has never been used again. Another example:  If you use the HoneyPot, you might want to clean your blacklist database of old IP addresses – especially attacks from huge dynamic IP ranges could fill your database up.

So, it is kind of a core task to clear your database from time to time. Therefore it is implemented in the core.

How ?^

Very simple, run the server.pl script with ‘--maintenance‘ parameter:

# content filter
/opt/decency/bin/server.pl -a content-filter -c /etc/decency/content-filter.yml --maintenance

# policy
/opt/decency/bin/server.pl -a policy -c /etc/decency/policy.yml --maintenance

# log-parser
/opt/decency/bin/server.pl -a log-parser -c /etc/decency/log-parser.yml --maintenance

You should probably put this in a cron job and run it every week or so (depending on the speed of data growth).

Tuning^

Because not anybody has the same requirements, you can tune most of the TTLs (time to live) in each module and the core for your needs. This is done by setting the “maintenance_ttl” parameter in the module config. It can either contain an integer (seconds) or an period string (eg 14d for 14 days).

Currently the following modules support maintenance:

  • Policy
    • *Core* (stats)
    • Greylist
    • Honeypot
  • ContentFilter
    • *Core* (stats)
  • LogParser
    • *Core* (stats)
    • Aggregator
    • GeoSource

Leave a Reply

CAPTCHA image