Subject: Re: UDP(/TCP?) bench/tuning ?
To: None <>
From: Eric Auge <>
List: tech-net
Date: 05/11/2005 18:01:45
Hubert Feyrer wrote:
> On Tue, 10 May 2005, Eric Auge wrote:
>> I have tryed to increase :
>> Is there any other tuning params that I can tweak ?
> Sorry for not having this documented in the proper place 
> (, but you may find the 
> following link useful:

Thanks for the link, after reading these infos, I have been able to
"stabilize" the rate (~ 30 000 UDP datagrams/s) and reduce
"full socket buffer" errors to 0.

sender :
   10 000 000 UDP datagrams sent at ~ 40 000 p/s rate.

the receiver :
   receives (poll/read/quickcheck) all those in 330 seconds,
   which give an average of 30303 UDP p/s.
   I also step each 10 000 packets received to store average
   receiving speed infos of the previous 10 000 packets for plotting
   at the end of the test.

No more errors but I still have these spikes, going down to ~14000 p/s
then coming back to full throughput (~30000 p/s)

Where could these spikes comes from ?

I reached this by increasing a lot more on the following,
as done in the :

kern.sbmax=67108864 (67M)
kern.somaxkva=67108864 (67M)
net.inet.udp.recvspace=4194304 (4M)
(I will prefer setsockopt(SO_RECVBUF) instead of system-wide setup for 
the last one)

What's the relationships between those numbers ?
I wish to not encounter any out of memory problems and do/understand the 
right calculation (w/ vm.*{min|max}, etc..).

net.inet.udp.recvspace :
 From what I've caught there is mbufs pools (NMBCLUSTERS sets their 
numbers right?!) *.{recv|send}space define the default system-wide 
numbers of bytes used in *each* socket's "socket buffer" (which peek 
into mbufs pools) for receive or sending. is that right ?

kern.sbmax :
as the description says :
Maximum socket buffer size (one socket)

kern.somaxkva :
Maximum amount of kernel memory to be used for socket buffers
(all sockets)

net.inet.ip.ifq.maxlen :
Maximum allowed input queue length
(is that the number of mbufs that can be used for input queues ?)

Hope you(or somebody) can enlighten me :)

>  - Hubert