Jan Kiszka wrote:
> Gilles Chanteperdrix wrote:
>> Hi,
>>
>> here is a repost of the rtnet-hash-port.diff patch. Only, without the
>> "receiving" bit, and with the INADDR_ANY bit fixed.
> 
> OK, almost ready for merge.
> 
> BTW, did you also happen to measure the performance gain (and for how
> many sockets)?

I have just done a quick test: with 200 sockets, the worst case (i.e.
the last socket) takes 30us to search the sockets table. Due to the
linear search, the average case is half the worst case.

200 sockets is what happens when 50 phones trying to phone outside at
the same time, each conversation results in 4 sockets being opened by
the NAT helper for each conversation (1 RTP outbound, 1 RTCP inbound, 1
RTP inbound, 1 RTP). An RTP stream takes 50 packets by second. an RTCP
stream 0.2 packet by second. So, the total is 100 * 50 + 100 * 0.2 =
5020 packets by second, and the overhead of the socket search is 5020 *
15 us = 75300 us, i.e. 75 ms, i.e. 7.5 % CPU.

Now, when using the hash table, the worst case, which is the same as the
average case is 2 us, that is precisely 7.5 times less, so the overhead
is 1%.

Needless to say, that on a machine where just searching a socket in a
hash table consumes 1% of the CPU, we simply can not run 50 external
phone calls at the same time.

But there is a gain.

-- 
                                                 Gilles.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
RTnet-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rtnet-developers

Reply via email to