CPU usage with UDP sockets - Networking
This is a discussion on CPU usage with UDP sockets - Networking ; I have written an application that streams UDP video data to multiple
clients. Compared to other comparable aystems, my CPU usage is pretty
high...sending data to around 60 clients consumes around 18-20 % of
the cpu in the (very powerful) ...
-
CPU usage with UDP sockets
I have written an application that streams UDP video data to multiple
clients. Compared to other comparable aystems, my CPU usage is pretty
high...sending data to around 60 clients consumes around 18-20 % of
the cpu in the (very powerful) machine. I have two (boost library) UDP
sockets that sends audio and video to the clients. My question is
this: Which is generally best when sending UDP data to multiple/many
clients? One or many sockets??
TIA
-
Re: CPU usage with UDP sockets
yoddeb@gmail.com wrote:
> I have written an application that streams UDP video data to
> multiple clients. Compared to other comparable aystems, my CPU usage
> is pretty high...sending data to around 60 clients consumes around
> 18-20 % of the cpu in the (very powerful) machine. I have two (boost
> library) UDP sockets that sends audio and video to the clients. My
> question is this: Which is generally best when sending UDP data to
> multiple/many clients? One or many sockets??
Probably one of those "it depends" answers... do you have multiple
processors in the server? If so, you might want multiple sockets, one
per processor. Either with multiple threads, or multiple processes,
so you can take advantage of the available CPU resources.
Similarly, even if you have only one processor/core/whatever in the
box, if you have a socket per destination, you can connect() that
socket to the destination and IIRC avoid things like route lookups on
each send.
rick jones
--
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway... 
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...