-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Андрей,

On 3/14/12 2:17 PM, Андрей Беликов wrote:
> Hi... I am running Apache Tomcat Version 7.0.26 with SOLR 3.5 on 
> jdk1.7.0_03
> 
> The problem is that i cannot limit count of connections. I never
> get connection refused (only timeouts). For example:
> maxThreads="150" and acceptCount="100", as i think i will have
> 150+100=250 connections in ESTABLISHED state, and all others will
> be refused.
> 
> But in realy: #netstat -na | grep 8080 | awk '{print $6}' | sort |
> uniq -c | sort -rn 3899 FIN_WAIT2 3385 ESTABLISHED 243 TIME_WAIT 9
> CLOSE_WAIT 3 FIN_WAIT1 1 SYN_SENT 1 LISTEN
> 
> Probe (http://localhost:8080/probe/connectors.htm) return me
> Connectors Count: 150
> 
> http://localhost:8080/probe/threadpools.htm Threads count Name
> Current Busy    Max     Spare1  Spare2 "ajp-apr-8009"  0       0
> 4096    0       0 "http-apr-8080" 150     150     150     0
> 0 AJPThreadPool   0       0       4096    0       200 
> HTTPThreadPool  150     150     150     150     20
> 
> As I think: connections comes to some buffer (may be JVM) and
> slowly transferres to TOMCAT... It is not good for my task, the
> best way is to recieve 250 connections and all other to refuse. How
> I can do this?
> 
> /data/servers/solr_tomcat/conf/server.xml:
> 
> <?xml version='1.0' encoding='utf-8'?> <Server port="8005"
> shutdown="SHUTDOWN">
> 
> [snip]
> 
> <Executor name="AJPThreadPool" namePrefix="AJPThread-" 
> maxThreads="4096" minSpareThreads="150"/>
> 
> <Executor name="HTTPThreadPool" namePrefix="HTTPThread-" 
> maxThreads="150" minSpareThreads="20"/>
> 
> <Connector executor="HTTPThreadPool" port="8080"
> protocol="org.apache.coyote.http11.Http11AprProtocol"
> redirectPort="8443" URIEncoding="UTF-8" 
> maxHttpHeaderSize="8388608"

OMG that header size is HUGE. Do you really expect 8MiB of headers?
Are people sending SOLR documents in cookies or something?

> maxThreads="150" maxKeepAliveRequests="1" enableLookups="false" 
> acceptCount="100" connectionTimeout="3000" />

Note that you aren't limiting the number of connections. Note that you
are specifying "maxThreads" which is irrelevant when you are using an
executor.

Read the docs for <Connector>:
http://tomcat.apache.org/tomcat-7.0-doc/config/http.html

Specifically, read the part about "maxConnections".

Also, since you are using AJP on one of those <Connectors>, your web
server should probably be taking care of connection-limiting at that end.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9hEaAACgkQ9CaO5/Lv0PAfoQCfT33TdW5Fg8WBtGOZVJou1pc0
omQAnA4HibZgKZ3XM9X2GISW1fLx6Mcm
=J5pR
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to