Scalable UDP Server

I need to create a server that will listen and respond to UDP packets, It will listen to 10 ports.

Packets are very small, no more than 20 bytes. Each packet will modify or search in a huge hash table.

But it has to process 15 thousand packets per second.

I can develop in c, C ++ or qt.

Are there any specific recommendations that should meet these requirements? What is the main design? Do you need a cut?

+3
source share
2 answers

For this kind of performance, I would consider a switching cycle select():

  • Open UDP listening sockets
  • Call select()to define readable data sockets
  • ( )
  • , ( , )

, select().

, . , .

, , , . , , N 10 , - .

, (, ..). .

+5

Boost.Asio - UDP-. API- :

  • , select, poll, epoll, , .
  • int , asio , boost::asio::ip::tcp::socket boost::asio::ip::udp::socket.
  • .
  • .
+4

Source: https://habr.com/ru/post/1791621/


All Articles