netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] icmp: add a global rate limitation
Date: Tue, 23 Sep 2014 12:48:07 -0400 (EDT)	[thread overview]
Message-ID: <20140923.124807.784868084262929714.davem@davemloft.net> (raw)
In-Reply-To: <1411137520.26859.13.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 19 Sep 2014 07:38:40 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> Current ICMP rate limiting uses inetpeer cache, which is an RBL tree
> protected by a lock, meaning that hosts can be stuck hard if all cpus
> want to check ICMP limits.
> 
> When say a DNS or NTP server process is restarted, inetpeer tree grows
> quick and machine comes to its knees.
> 
> iptables can not help because the bottleneck happens before ICMP
> messages are even cooked and sent.
> 
> This patch adds a new global limitation, using a token bucket filter,
> controlled by two new sysctl :
> 
> icmp_msgs_per_sec - INTEGER
>     Limit maximal number of ICMP packets sent per second from this host.
>     Only messages whose type matches icmp_ratemask are
>     controlled by this limit.
>     Default: 1000
> 
> icmp_msgs_burst - INTEGER
>     icmp_msgs_per_sec controls number of ICMP packets sent per second,
>     while icmp_msgs_burst controls the burst size of these packets.
>     Default: 50
> 
> Note that if we really want to send millions of ICMP messages per
> second, we might extend idea and infra added in commit 04ca6973f7c1a
> ("ip: make IP identifiers less predictable") :
> add a token bucket in the ip_idents hash and no longer rely on inetpeer.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied.

      parent reply	other threads:[~2014-09-23 16:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 14:38 [PATCH net-next] icmp: add a global rate limitation Eric Dumazet
2014-09-19 14:56 ` Joe Perches
2014-09-19 15:11   ` Eric Dumazet
2014-09-22 20:09 ` David Miller
2014-09-22 20:25   ` Eric Dumazet
2014-09-23 16:48 ` David Miller [this message]

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=20140923.124807.784868084262929714.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).