unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Luis Felipe <luis.felipe.la@protonmail.com>
Cc: 55707@debbugs.gnu.org, 55488@debbugs.gnu.org
Subject: bug#55488: bug#55707: syslogd logging kernel messages slowly?
Date: Sat, 04 Jun 2022 21:30:24 +0200	[thread overview]
Message-ID: <87sfokdy5r.fsf_-_@gnu.org> (raw)
In-Reply-To: <878rqcfjcn.fsf@gnu.org> ("Ludovic Courtès"'s message of "Sat, 04 Jun 2022 19:07:20 +0200")

Ludovic Courtès <ludo@gnu.org> skribis:

>   2. Explicitly disable syncing for some of the log files by prepending
>      a hyphen right before the file name in syslogd.conf (info
>      "(inetutils) syslogd invocation").

Tried this (in addition to ‘fdatasync’):

--8<---------------cut here---------------start------------->8---
(define %default-syslog.conf
  (plain-file "syslog.conf" "
     # Log all error messages, authentication messages of
     # level notice or higher and anything of level err or
     # higher to the console.
     # Don't log private authentication messages!
     *.alert;auth.notice;authpriv.none      -/dev/console

     # Log anything (except mail) of level info or higher.
     # Don't log private authentication messages!
     *.info;mail.none;authpriv.none          /var/log/messages

     *.=debug                               -/var/log/debug

     # Same, in a different place.
     *.info;mail.none;authpriv.none         -/dev/tty12

     # The authpriv file has restricted access.
     authpriv.*                              /var/log/secure

     # Log all the mail messages in one place.
     mail.*                                 -/var/log/maillog
"))
--8<---------------cut here---------------end--------------->8---

In addition to the hyphens, notice that now only debugging info goes to
/var/log/debug (previously everything going to /var/log/messages would
also go to /var/log/debug, which is kinda silly).

This halves the number of ‘fdatasync’ calls and thus doubles the
throughput, but we’re still spending ~0.1s on ‘fdatasync’ for each line,
which is slow.

So the next solution is to not ‘fdatasync’ on /var/log/messages either:

--8<---------------cut here---------------start------------->8---
(define %default-syslog.conf
  (plain-file "syslog.conf" "
     # Log all error messages, authentication messages of
     # level notice or higher and anything of level err or
     # higher to the console.
     # Don't log private authentication messages!
     *.alert;auth.notice;authpriv.none      -/dev/console

     # Log anything (except mail) of level info or higher.
     # Don't log private authentication messages!
     *.info;mail.none;authpriv.none         -/var/log/messages

     # Log \"debug\"-level entries and nothing else.
     *.=debug                               -/var/log/debug

     # Same, in a different place.
     *.info;mail.none;authpriv.none         -/dev/tty12

     # The authpriv file has restricted access.
     # 'fsync' the file after each line.
     authpriv.*                              /var/log/secure

     # Log all the mail messages in one place.
     mail.*                                 -/var/log/maillog
"))
--8<---------------cut here---------------end--------------->8---

With this, the system boots much more quickly.

I’m tempted to commit the above syslog.conf.  From a look at the code
and doc, it seems that neither rsyslog nor systemd-journald does
anything like “fsync after each logged line”, so the config above sounds
like a reasonable default (at any rate, the current default is
definitely unreasonable on slow spinning disks).

I’m curious to see if it fixes your other boot-up issues, timeouts and
all, Luis.

Ludo’.




  parent reply	other threads:[~2022-06-04 19:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 18:49 bug#55488: GDM, GNOME: Can't start desktop session after upgrade Luis Felipe via Bug reports for GNU Guix
2022-05-18  8:44 ` Ludovic Courtès
2022-05-18 14:33   ` Luis Felipe via Bug reports for GNU Guix
2022-05-31  9:29     ` Ludovic Courtès
2022-05-31 20:50       ` Luis Felipe via Bug reports for GNU Guix
2022-06-01 19:55         ` Ludovic Courtès
2022-06-02 19:44           ` Luis Felipe via Bug reports for GNU Guix
2022-06-02 21:02             ` Ludovic Courtès
2022-06-02 23:51               ` bug#55707: " Luis Felipe via Bug reports for GNU Guix
2022-06-03 22:54                 ` Ludovic Courtès
2022-06-04 17:07                   ` Ludovic Courtès
2022-06-04 17:35                     ` bug#55488: bug#55707: syslogd logging kernel messages slowly? Ludovic Courtès
2022-06-04 19:30                     ` Ludovic Courtès [this message]
2022-06-05 15:25                       ` Luis Felipe via Bug reports for GNU Guix
2022-06-06 10:00                         ` Ludovic Courtès
2022-06-06 16:31                           ` Luis Felipe via Bug reports for GNU Guix
2022-06-06 20:46                             ` Ludovic Courtès
2022-06-05 13:19                   ` bug#55488: GDM, GNOME: Can't start desktop session after upgrade Luis Felipe via Bug reports for GNU Guix
2022-06-06 18:11                     ` Luis Felipe via Bug reports for GNU Guix
2022-06-06 20:50                       ` bug#55488: bug#55707: syslogd logging kernel messages slowly? Ludovic Courtès
2022-06-06 23:09 ` bug#55488: GDM, GNOME: Can't start desktop session after upgrade Luis Felipe via Bug reports for GNU Guix
2022-06-06 23:11 ` Luis Felipe via Bug reports for GNU Guix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfokdy5r.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=55488@debbugs.gnu.org \
    --cc=55707@debbugs.gnu.org \
    --cc=luis.felipe.la@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).