Forums Register Login

The mysterious ConnectException

+Pie Number of slices to send: Send
I've been experimenting with JUnitPerf to load test a server I'm writing using NIO. I've imposed no artifical limits on the number of concurrent connections. I believe Window's doesn't allow you to select() on more than 64 channels simultaniously, but I haven't hit numbers that high.
Here's the general idea. There's a class for testing, SmtpTest. In setUp() and tearDown() it connects and disconnects to the server, and there are a number of testBlahDiBlah() methods that have complete conversions with the server. The load test creates a number of threads which run through the whole sequence of tests 5 times for each thread. So thread one calls setUp(), testBlah1(), tearDown(), setUp(), testBlah2(), tearDown(), setUp(), testBlah1() again, etc. Thus the maximum number of connections at any given time will be the number of threads, although there will be quite a lot of connecting and disconnecting.
If there are only 10 threads, it runs without a hitch. The server will print out how many clients are registered with the Selector once every second.
With 10 threads running, here's the output from one run:

The 0's are when the server has just started or is done, so nothing to worry about there. For 10 clients, having 10 or 9 connected most of the time is pretty much ideal behavior.
If I up the number of threads to 15 there are 0 to 15 cases where connections are refused (interestingly enough they all happen only for the first test in the sequence of tests -- that must mean something...). The precise error is this:

The number of active threads at any given time hovers in the 10-15 range.
By the time I'm up to 25, connections are being refused all over the place (not just the first test in the sequence) and quite regularly. The number of connections at any given time seems to hover around 10-15, which is much lower than it ought to be with 25 clients running around. Here's what the server reports in it's polls every second:

Hardly looks like 25 active clients. If there are 50 client threads, the number of active connections still hovers in the same range.
Is there some obvious explanation that I'm missing? Is it perhaps a problem with the clients and not the server? Has the world gone mad?
+Pie Number of slices to send: Send
I thought certain versions of Windows only allowed for 10 concurrent client connections. After that you had to license (pay for) their TCP/IP stack.
+Pie Number of slices to send: Send
What I have read is that the max number of connections to tcp/ip on NON SERVER editions of windows is 10. And there is no way to change that. At least none that I could find.
Whether or not that has anything to do with your problem I don't know. Because most of the places I read that was dealing with IIS.
Links:
http://www.devhood.com/messages/message_view-2.aspx?thread_id=44401
+Pie Number of slices to send: Send
Gah! I'm developing in XP Pro. *At this point David shakes his fist while cursing in broken Italian*
This applies to connections from a computer to itself? Those evil ********!
And the truely tragic part is that I have a brand new laptop waiting for me with plenty of space to install a happy, industrial strength, open source OS. But alas, I'll have to run the gauntlet past more evil before I can use the hardware.
Thanks for info.
+Pie Number of slices to send: Send
Lasciate ogne speranza, voi ch'intrate.
+Pie Number of slices to send: Send
Javaranch people are funny.
Screaming fools! It's nothing more than a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 905 times.
Similar Threads
jboss test suite errors
HttpUnit-Net Connection Error
Another shutting down problem
Probleme de lancement de test avec StrutsTestCase
HttpUnit Exception stack trace
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 02:36:43.