[systemd-devel] journal: How to limit the file size of runtime system.journal
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Fri Dec 13 05:18:19 PST 2013
On Fri, Dec 13, 2013 at 01:49:51PM +0800, WANG Chao wrote:
> On 12/13/13 at 06:42am, Zbigniew Jędrzejewski-Szmek wrote:
> > On Fri, Dec 13, 2013 at 01:33:17PM +0800, WANG Chao wrote:
> > > Hi,
> > >
> > > In kdump environment, memory resource is quite limited. I find that the
> > > runtime journal file (/run/log/journal/$id/system.journal) is 4 MB and I
> > > think that is too much for a initramfs context.
> > >
> > > After tuning both RuntimeMaxUse=1% or RuntimeMaxFileSiz=100K, I find
> > > system.journal is still 4 MB in size. So here comes my questions:
> > >
> > > 1. Did miss use of these two config options? Because regarding the
> > > journald.conf(5), it seems I was totally doing it right.
> > 4MB is the minimum. Those settings are ignored if you set anything
> > lower.
>
> Is there any particular reason? I think thresold for runtime journal
> size can lower much because in initramfs it's not supposed to have much
> logs.
First, there are some data strcutures which are allocated when the file
is created, and if the file was very small, relatively more space would
wasted. Second, repeated fields are not stored, just referenced, so things
become more efficient when the file is not too small. But neither is
fundamental reason, and with some tweaking the journal could be made
to work much smaller files.
Zbyszek
More information about the systemd-devel
mailing list