Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I tried difference setting in Jmeter and Tomcat.

If the Threads number in JMeter is 1~200, Then tomcat is okay.

If It is 300, Then after serving few requests, tomcat starts to output errors.

Here is the error show in JMeter

java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:483)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1018)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1004)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:411)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:297)
at java.lang.Thread.run(Unknown Source)

My tomcat server.xml in eclipse

<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-" 
    maxThreads="2000" minSpareThreads="250"
    acceptCount="2000"/>

<Connector executor="tomcatThreadPool" URIEncoding="UTF-8" connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" />

Any idea why this is happening ? How do i check the server.xml is correctly used?

It is a JSF2 application if it helps.

Thanks in advance.

share|improve this question
    
Any logs on the tomcat side? –  Kyle Smith Jan 30 '12 at 2:31
    
@KyleSmith No, sometimes It has out of bound index problem, but it is not the case here. –  Tommy Jan 30 '12 at 2:44
    
Please post the errors Tomcat is outputting –  prunge Jan 30 '12 at 6:09
    
@prunge: No error is in the tomcat log. sorry for the misleading comment. OS is windows XP SP3, is it related? –  Tommy Jan 30 '12 at 10:34
    
Check your windows event logs -- there is some sort of TCP connection limiting in Windows XP, IIRC. Oops, @mbonaci's answer speaks to this. –  Kyle Smith Jan 30 '12 at 13:35
add comment

1 Answer 1

I had the same problem, which turned out to be the limit of half-open socket connections in XP.
I used this tool to solve the problem:

http://www.megaleecher.net/Tcpip.sys_Patch_To_Increase_Windows_XP_Connection_Limit

share|improve this answer
    
this is fix already, thanks for pointing out. But there is no effect. May be simply the tomcat cannot handle too much connection at the same time ? –  Tommy Jan 31 '12 at 2:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.