Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi guys,

After reading C10K problem, I came to an idea to test it. I got two home deskop PCs to test on home network, two different dynamic IPs. Both PC is under cheap routers as well.

Server Side:
I built a very simple blocking server program in Java, 'the One thread One client idea.
It accept() clients in a loop and once accept()ed it'll create a service thread. Then the service thread is passed to the thread pool. The service threads only recv()/send() 10 bytes from/to clients.

Client Side:
I built the client in C++ that creates 100 threads and each thread sends 10 bytes to the server every 10ms, so the math is like 10k requests per sec if I'm right.

Tcp Setting:
On both PCs, max port number is set to 60000+, and tcptimewaitdelay is 30s.

Symtoms:
But the server side network keeps dying. I have to reset the modem and router.
And client can't connect or receive response from the server like 1/100.


My questions are... (assuming the code is not to blame..)
'Is this a OK approach to test it? or is it the network capacity? or the hardware apec?'

Thank you,

looking forward to reading your opinions.
Posted

1 solution

My humble opinion is, that this approach is a bit wrong, especially in home environment.
10 bytes of useful data is really little amount and this causes a huge tcp/ip overhead, so I'm not amazed that a SOHO router needs to be restarted.
Confi-K wrote:
or the hardware apec?
My guess is, that the router can't handle so many connections.

I doubt that the code has errors,since it works and the router seems to be the bottleneck.

I hope, I helped a little :).
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900