I am trying the multicast sample of boost::asio document to receive UDP packets. When the packets coming are around 40,000 packet/second, it is fine. If the packets are 100,000 packet/second, I get packets dropped.
I log the time when every time the callback(handle_receive_from) is called. It usually takes 1 microsecond to receive a packet, but every 32 packets, I got a big delay. For example, from packet 1 to 30, it takes 1 microsecond each, but packet No. 31, it takes about 500+ microsecond, and 32 will be like 20.
I check my CPU usage, only one core is used, and it is 100%. I tried to use multiple threads using one io service, it doesn't change anything.
Can Asio handle traffic more than 100,000 packets/second? How can I achieve it?
Thank you very much in advance.