lundi 7 mai 2018

C++ Socket Performance

I have designed Client and Server in normal C++ and boost::asio to send data as fast as possible.

for the testing purpose:

A: BOOST_

1: data size is `10 bytes` in both tests.
2: boost::asio::write and boost::asio::read is used.
3: boost::asio::transfer_exactly(10) is used
4: time between successive is calculated using std::chrono::high_presision::clock is used
5: Nagle's algorithm is turned off using set_options

B: C++ TCP

1: 10 bytes are used to send and recev
2: no_wait is using as flag
3: set_socket option is true (Nagle's algorithm is turned off)
4: time between successive is calculated using std::chrono::high_presision::clock is used

All test are run on same machine: i have two machine (server level machine) named MachineA, MachineB. so test are as follows:

MachineA (boost Server) MachineB(boost Client) SendingTime 1500ns-1650ns ReadingTime 63000ns-65000ns ReadingTime 64000-66000ns SendingTime 1500ns-1600ns

MachineA (C++ TCP server) MachineB(C++ TCP Client) SendingTime 900ns-1050ns ReadingTime 63000ns-65000ns ReadingTime 63000ns-64000ns SendingTime 900ns-1050ns

Now when i bypass the kernal(Running Both program on onload latency profile) boost stats does not get affected but C++ TCP gets little bit faster.

Question 1: does boost::asio uses c++ tcp socket as base or its implementation is something else.

Question 2: Are there some socket option in boost which can be set to make faster transfer.

Question 3: does on machine level are there any settings that should i aware off?

Thanks

Aucun commentaire:

Enregistrer un commentaire