Limiting the size of journal (.jnl) files with max-journal-size
  • 25 May 2021
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Limiting the size of journal (.jnl) files with max-journal-size

  • Dark
    Light
  • PDF

I am using BIND to serve information for dynamic zones.  After running for some time the journal files can get quite large. Is there a way to limit their growth within BIND?

Yes, you can use the max-journal-size configuration option to specify a maximum size on a per-zone basis, e.g.:

max-journal-size size_spec;

"size_spec" is defined as one of the following:

A number, the word unlimited, or the word default.

An unlimited size_spec requests unlimited use, or the maximum available amount. A default size_spec uses the limit that was in force when the server was started.

A number can optionally be followed by a scaling factor: K or k for kilobytes, M or m for megabytes, and G or g for gigabytes, which scale by 1024, 1024*1024, and 1024*1024*1024 respectively.

The value must be representable as a 64-bit unsigned integer (0 to 18446744073709551615, inclusive). Using unlimited is the best way to safely set a really large number.
Default Behavior

In versions of BIND older than 9.11, the default value for the max-journal-size parameter is "unlimited". The largest permitted value is 2 gigabytes. So the default ("unlimited") effectively means 2 GB. Therefore, unless you specify a maximum, default behavior is to allow growth without limit up to 2 GB.



From BIND 9.12 and newer,  the maximum size of a zone journal file is twice the size of the zone's contents. This can be overridden by setting max-journal-size to "unlimited" or to an explicit value up to 2 GB.

Note that any limit on the journal file sizes is guidance to the named process but is not a hard limit.  If the update rate is high or there are many zones to write out, this limit will be exceeded, but named will still try to keep within or close to the requested size. More information on choosing a good value for max-journal-size can be found here: Choosing the right value for max-journal-size.