-
Notifications
You must be signed in to change notification settings - Fork 19
Description
As instructed by @sharpener6, I am listing here the works that still need to be done for YMQ beside its Windows support. Since I will be busy working on YMQ's Windows support, it would be nice to have @magniloquency to carry out things listed below.
Tests
Currently, YMQ is able to pass the basic tests when running on localhost and remote machines. These basic tests are echo_{server|client} and pub_server/sub_client. The first set demonstrates how to write an echo server using YMQ, and the second demonstrates the IOSocketType::Unicast and IOSocketType::Multicast usage. However, more tests needs to be done. Here's a few conditions that needs to be tested:
- Client sent abnormally large number as header. Each message in YMQ is prefixed with a header that describes the length of the message. And the server will try to allocate the space described in the header. If the server receives a very large number upon parsing
header, then OOM will occur. So the server should reject headers that are "too large". This is currently not implemented in the core. - Client sent incomplete
Identityto the remote end and then exits. In this case, the server should log the error. This is currently not implemented in the core. - Client sent partial message, sleep for a while, and then sent the rest of it. The server should be able to correctly pick up the rest of the message.
- Client sent partial header, sleep for a while, and then sent the rest of the header, and its payload. The server should be able to correctly pick up the rest of the header and message.
- Client sent partial header, sleep for a while, and then sent the rest of the header, and then sleep for another while, and sent out the rest of the message. The server should be able to correctly pick up the rest of the header and message.
- Client manually close the socket (not killing the program!) at any point of sending messages (typical cases are 3,4, and 5 listed above), and try to reconnect. The server should be able to sent the leftover messages to the client.
Please postpone 1, and 2, until Windows is supported.
Benchmarks
Pingpong test behaves like this: The server implements echo server protocol, and the client implement the reverse echo server protocol. That is, the client will generate a message and sent it to the echo server. Then the server will echo back, and the client will echo back the message that the server echoed back. This makes a message bouncing between the server and the client as a pingpong ball. We can then calculate the total traffics in bytes, and measure the time of bouncing when we bounce the message of X bytes for Y times.
This pingpong test will be used as benchmarking tool for YMQ. YMQ should be benchmark against asio as a baseline, and it is expected to outperform asio by at least 15%. We should benchmark the performance with message of X bytes for Y times using Z threads, where X = 1024, 2048, 4096,...,1024*16, Y = 128, 256,...,1024, and Z being each number from 1 to the total number of threads on the testing machine divide by 2.
Example of writing the pingpong test using YMQ can be found at examples/echo_server.cpp and examples/pingpong.cpp.
docs
YMQ should have docs that explains its architecture and features. Architecture graphs can be found at #168, but a lot of the detail is missing. The features list is completely missing. The doc should expand on the graph at #168 and explain the feature in this library. It would be even better if the doc contains internal detail, but that should be postponed until the library supports Windows.