Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: kostja@tarantool.org
Cc: tarantool-patches@freelists.org
Subject: [PATCH 0/2] Rate limit certain warining messages
Date: Tue, 11 Dec 2018 19:31:16 +0300	[thread overview]
Message-ID: <cover.1544544474.git.vdavydov.dev@gmail.com> (raw)

Certain warning messages can be printed quite often, e.g. "too long WAL
write" is printed by each fiber stalled on the WAL. If there are
hundreds of fibers and the IO subsystem becomes unresponsive from time
to time, the log may grow to the scale of gigabytes pretty quickly,
which complicates investigation of real problems.

Also, say() (the function used for logging) is quite CPU consuming.
E.g. in certain cases when readahead or net_msg_max is misconfigured,
"stopping input" messages may easily eat all available CPU time and
make the instance unresponsive.

To overcome those problems, this patch set introduces say_ratelimited()
helper, which is just like say() except it suppresses a messages if too
many messages of the same kind have already been printed in the last few
seconds. The new helper is used for all kinds of messages that may spam
the log.

https://github.com/tarantool/tarantool/issues/2218
https://github.com/tarantool/tarantool/commits/dv/gh-2218-rate-limit-certain-log-messages

Vladimir Davydov (2):
  Introduce basic rate limiter
  Rate limit certain warning messages

 src/box/iproto.cc          |  10 +++--
 src/box/txn.c              |   5 ++-
 src/box/vy_point_lookup.c  |   7 +--
 src/box/vy_quota.c         |   5 ++-
 src/box/vy_read_iterator.c |   9 ++--
 src/ratelimit.h            | 104 +++++++++++++++++++++++++++++++++++++++++++++
 src/say.h                  |  38 +++++++++++++++++
 test/unit/CMakeLists.txt   |   2 +
 test/unit/ratelimit.c      |  78 ++++++++++++++++++++++++++++++++++
 test/unit/ratelimit.result |  13 ++++++
 10 files changed, 256 insertions(+), 15 deletions(-)
 create mode 100644 src/ratelimit.h
 create mode 100644 test/unit/ratelimit.c
 create mode 100644 test/unit/ratelimit.result

-- 
2.11.0

             reply	other threads:[~2018-12-11 16:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 16:31 Vladimir Davydov [this message]
2018-12-11 16:31 ` [PATCH 1/2] Introduce basic rate limiter Vladimir Davydov
2018-12-11 16:31 ` [PATCH 2/2] Rate limit certain warning messages Vladimir Davydov
2018-12-11 21:48 ` [PATCH 0/2] Rate limit certain warining messages Konstantin Osipov
2018-12-12  8:48   ` Vladimir Davydov

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

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

  git send-email \
    --in-reply-to=cover.1544544474.git.vdavydov.dev@gmail.com \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH 0/2] Rate limit certain warining messages' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox