[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1264627088.2892.7.camel@edumazet-laptop>
Date: Wed, 27 Jan 2010 22:18:08 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: cold cold <nedkonedev@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: 0% cpu usasge after fresh boot or net restart but 10% CPU if
kernel flush route cache
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists