I developed a TCP network application using boost :: asio with an asynchronous approach. The application sends about 1 GB of data as follows:
- Send command 5 bytes (using async_write ())
- Sends 1024 bytes of data (using another async_write ())
- Repeat until all 1 GB data has been sent.
When I use the synchronous approach, results are expected (about 9 seconds for TX 1GB data using 1Gb ethernet), but when I use asynchronous calls, performance degradation and 20 seconds are needed for TX the same amount of data.
I tried to deactivate the Nagle algorithm, but it does not solve the problem.
Did you know that using multiple async_write () calls with small amounts of data can adversely affect performance?
Thank!
source
share