public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: cold cold <nedkonedev@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: 0% cpu usasge after fresh boot or net restart but 10% CPU if kernel flush route cache
Date: Wed, 27 Jan 2010 22:18:08 +0100	[thread overview]
Message-ID: <1264627088.2892.7.camel@edumazet-laptop> (raw)
In-Reply-To: <41ac0f9e1001271153u333a5e2aq6f473ccc6e6d1e23@mail.gmail.com>

Le mercredi 27 janvier 2010 à 21:53 +0200, cold cold a écrit :

> 
> btw atm i have 1k ip on that router but plan to put 10k so route cache
> will grow 10 time fast.
> i try to keep low  rhash_entries but garbage collector  is non stop
> running and eat CPU
> atm i have around 7k  entries per second for second for first minute.
> 
> i think it will be better if i flush cache on secret interval instead
> of giving work to gc.
> i test with 512MB cache and CPU is 0% and flushing entire hash dont take a lot,
> I'm not sure is there some side effects from flushing.

Flush is immediate, it only marks entries as invalid and they are
cleaned up later.

512 MB cache is quite small for your needs, each entry uses 384 bytes
(assuming you use a 64bit kernel)

In my experiments, I found using gc (and no flushing) was the most
reliable way to have an equilibrium.

WHen setting gc_interval to 1,  the garbage collector is fired every
second and handles 1/300 of entries, from a work queue (thus doesnt stop
packets to be handled by irqs), in a smooth way.

You can post "perf top" results to check where cpu is consumed.



  reply	other threads:[~2010-01-27 21:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-26 16:58 0% cpu usasge after fresh boot or net restart but 10% CPU if kernel flush route cache cold cold
2010-01-27 15:26 ` Eric Dumazet
2010-01-27 19:53   ` cold cold
2010-01-27 21:18     ` Eric Dumazet [this message]
2010-01-28  9:14       ` cold cold
2010-01-28 16:09         ` Eric Dumazet
2010-01-28 16:26           ` cold cold
2010-01-28 17:06             ` Eric Dumazet
2010-01-28 18:49               ` cold cold
2010-01-28 21:16                 ` Eric Dumazet
2010-01-29  7:38                   ` cold cold
2010-01-29  9:06                     ` Eric Dumazet

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=1264627088.2892.7.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=nedkonedev@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