Question regarding netgraph and threading

Julian Elischer julian at elischer.org
Wed Dec 2 00:08:06 UTC 2009


Brett Glass wrote:
> At 01:47 PM 12/1/2009, Julian Elischer wrote:
> 
>> well, not all work is done by that thread. It is the
>> backup-doer-of-things, but many netgraph operations are done in the
>> context of a caller such as teh user of a socket.
> 
> In the case of a PPTP session, the data (ignoring the control session
> for the moment) flows from the interface (as GRE packets) through PPP
> (also implemented in netgraph) to an "ng" pseudo-interface, where it
> enters the ordinary FreeBSD IP stack. There isn't a user process listening
> on a socket anywhere in that path, so I assume that the netgraph
> kernel thread has to handle all of the work of encryption, decryption,
> handshaking, etc. Am I incorrect about this? I am concerned that the
> performance of a single core will be the bottleneck.
> 



in the netgraph code I see:

                /* Autoconfigure number of threads. */
                 if (numthreads <= 0)
                         numthreads = mp_ncpus;

and the default value of numthreads (it's a tunable) is 0
so you should have one netgraph thread per cpu.

try top -HS



More information about the freebsd-net mailing list