c++ - Linux socket programming testing -


I am new to socket programming and I have written a code for the server using Apollo. Actually, it will wait for any customer to accept the connection and if the data is available from other sources it will send the data to the customers.

I need to check that when there are many requests for connection and when the server is sending data to many customers, then how is the server performing? I have a question about how can I simulate a concurrent request for multiple clients for the server? Do I create multiple threads to request or to test with multiple processes or some other way?

Thank you.

I usually simulate a session from the server, create client programs, find several Linux boxes nearby and Spin thousands of them on each machine from the command line:

 for  i {0..1000}; ./myprogram serverip & amp; In some cases the protocol is text based and the interaction or test is simple, so I do not want to write  myprogram , but just use it as the  nc serverip & lt; Input & gt; / Dev / null  

If you need all your clients to test the streaming data, I will start with Netat and work from there in my own way.

This approach is fine for my needs, I do not usually need to test more concurrency than thousands of handful clients. If you need more scalability, then you have to write the client simulator using IO multiplexing (Apollo), as well as simultaneously you will be able to simulate as much as you can in each example - and you have more control to find the boundaries. You must test your customer

However do not mix performance tests with functional testing. When you can perform odd performance in a test environment, a lively atmosphere can be very different as customers will be abused, they will disconnect from the most unavailability of time. They can send malicious data to you, they can be slow, move on to build internal queues on the server, or you find thousands of useless connections ( killall -STOP nc along with You can interrupt things in between sending data to the client's investigation)


Comments