Poor boost.ASIO performance

后端 未结 2 1656
北荒
北荒 2021-01-30 11:45

I have a very simple server/client performance test using boost::asio on Windows and it seems to be performing really poorly. I\'m hoping that I\'m just using the library incor

相关标签:
2条回答
  • 2021-01-30 11:56

    For my purposes, sending really really small messages and wanting virtual real time replies, disabling Nagle's algorithm turned out to be the cause of the poor performance.

    0 讨论(0)
  • 2021-01-30 12:06

    You must turn off the Nagle algorithm. Call:

    m_socket.set_option(tcp::no_delay(true));
    

    Where appropriate for your code.

    0 讨论(0)
提交回复
热议问题