Boost logo

Boost Users :

Subject: Re: [Boost-users] Asio and software interrupts
From: Joseph Sulewski (joemacher_at_[hidden])
Date: 2012-12-02 22:26:02


Andreas,

Thank you for your response and I apologize for the delayed reply.

The top application in Linux shows how much time is spent handling software
interrupts. Is there a more efficient way of listening to the sockets in
boost? Can we create a socket that registers for more than one multicast
address? Would that even help?

If not, perhaps there is some kernel or driver tuning that can reduce the
number of interrupts.

Thanks for any help or pointers,

On Thu, Nov 29, 2012 at 3:57 AM, Andreas Wehrmann <
a.wehrmann_at_[hidden]> wrote:

> Hi,
>
> I don't think the softirqs can be avoided, since the network
> driver dispatches each packet it receives to the network layer
> (which causes a software interrupt).
> Now if you listen to 500+ multicast addresses and given the limited
> resources available on the embedded platform
> (What platform is it actually? And what performance does it offer?)
> I would certainly expect a lot of time to be spent simply for handling the
> network packets in the kernel.
>
> How did you determine the 51% spent in softirqs?
> Did you watch the ksoftirq process?
>
>
> Regards,
>
> Andreas
>
>
>
> On 11/28/2012 10:34 PM, Joseph Sulewski wrote:
>
>> Hello,
>>
>> I’m use the Boost::Asio libraries to read data from multicast sockets.
>> This is a high rate application that needs to listen to data coming on a
>> large number of multicast addresses (up to 500 different addresses). I
>> would like to funnel all the multicast traffic to a single class where
>> the data can get handled very quickly.
>>
>> I have the code working now using the socket->async_receive_from()
>> method but the system is getting bogged down handling a large number of
>> software interrupts. 51% of the CPU time is spent handling software
>> interrupts.
>>
>> I create each multicast socket (up to 500 of them) like so:
>>
>> socket = new udp::socket(io_service);
>>
>> socket->open(listenEndPoint.**protocol());
>>
>> socket->set_option(boost::**asio::ip::udp::socket::resuse_**
>> address(true));
>>
>> socket->bind(listenEndPoint);
>>
>> socket->set_option(boost::**asio::ip::multicast::join_**
>> group(multicastAddress.to_v4()**));
>>
>> Slightly after that I register for data like so:
>>
>> socket->async_receive_from(**buffer,senderEndPoint,boost::**
>> bind(&EthernetCapture::**receiveData,this,boost::asio::**
>> placeholders::bytes_**transferred));
>>
>> Is there a more efficient way to receive multicast data without
>> incurring so many software interrupts?
>>
>> By the way this is for an application to run on 32 bit Linux for an
>> embedded application.
>>
>> Thanks
>>
>>
>>
>> ______________________________**_________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/**mailman/listinfo.cgi/boost-**users>
>>
>>
>
> --
> Mit freundlichen Grüßen / Best regards
>
> Andreas Wehrmann
>
>
> CENTER COMMUNICATION SYSTEMS GMBH
>
> Ein Unternehmen der STRABAG AG
>
>
> Software Development
>
> Ignaz-Köck-Str. 19
> A-1210 Wien, Österreich
>
> Tel.: +43 (0) 190 199 - 3616
> Fax: +43 (0) 190 199 - 2110
> Mobil: +43 (0) 664 884 75916
>
> a.wehrmann_at_[hidden]
>
>
> FN 796 88p, Sitz in Wien
> Firmenbuchgericht Wien
>
> <
http://www.centersystems.com/**> www.centersystems.com
>
> Geschäftsführung: Ing. Gerhard Jelinek, Josef-Eduard Burger
> ______________________________**_________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/**mailman/listinfo.cgi/boost-**users>
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net