From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] ipv4: Remove unnecessary code from rt_check_expire().
Date: Tue, 26 Jun 2012 10:23:04 +0200 [thread overview]
Message-ID: <1340698984.10893.248.camel@edumazet-glaptop> (raw)
In-Reply-To: <20120626.004658.2123525722448546355.davem@davemloft.net>
On Tue, 2012-06-26 at 00:46 -0700, David Miller wrote:
> And for legitimate traffic it's completely the wrong thing to do.
>
> There is absolutely zero reason to pure valid entries when hash chains
> average length of one.
>
> I've been monitoring routing cache activity, and it's the height of
> stupidity. Every 5 minutes we pure, and then they all get regenerated
> again.
>
Thats because gc_interval (60) is big compared to ip_rt_gc_timeout
(300)
So each time rt_check_expire() triggers, we handle a big part of the
cache. On big servers I had to lower gc_interval to smooth things.
Garbage collect is needed to not waste kernel memory, even on legitimate
traffic on a typical web server.
Taken from my 8GB machine :
# cat /proc/sys/net/ipv4/route/gc_thresh
262144
320 bytes per dst : 262144*320 = 83886080 bytes to store one dst per hash chain.
Also, why keeping a dst in cache if no traffic uses it in a 5 minutes period ?
next prev parent reply other threads:[~2012-06-26 8:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-26 7:21 [PATCH] ipv4: Remove unnecessary code from rt_check_expire() David Miller
2012-06-26 7:39 ` Eric Dumazet
2012-06-26 7:46 ` David Miller
2012-06-26 7:58 ` Eric Dumazet
2012-06-26 8:23 ` Eric Dumazet [this message]
2012-06-26 8:37 ` David Miller
2012-06-26 8:46 ` Eric Dumazet
2012-06-26 8:56 ` David Miller
2012-06-26 9:11 ` Eric Dumazet
2012-06-26 9:43 ` David Miller
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=1340698984.10893.248.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--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