On 4/13/2016 1:50 AM, Bastien Latard - MDPI AG wrote: > From this source > <https://tomcat.apache.org/tomcat-7.0-doc/config/http.html>, I read: > "Each incoming request requires a thread [...] If still more > simultaneous requests (more than maxThreads) are received, they are > stacked up inside the server socket" > > I have a couple of generic questions. > > 1) *How would the increase of maxThreads will behave with RAM usage? > e.g.: if I increase by 2, would it be twice more?*
Java threads themselves use a *very* small amount of memory. The memory used will be determined by what those threads are *doing*. > 2) *What's the defaults values of maxThreads and maxConnections?* > This post <http://stackoverflow.com/a/25765451/5165343> says > "maxConnections=10,000 and maxThreads=200" The maxThreads setting defaults to 200 in every container I've looked at. The Jetty that comes with Solr has this setting increased to 10000 -- so that the limit is effectively removed for typical installations. The tomcat documentation says the following about maxConnections: For NIO the default is |10000|. For APR/native, the default is |8192|. > 3) Here is my config (/etc/tomcat7/server.xml): > <Connector port="8080" protocol="HTTP/1.1" > connectionTimeout="20000" > URIEncoding="UTF-8" > redirectPort="8443" /> > *Is there a way to kill the request if someone make a big query (e.g.: > 50 seconds), but either close the connection or get a timeout after 5 > seconds?**(or is it default behavior?) > * We strongly recommend using the Jetty that comes with Solr. This is the only deployment option that has official support starting with Solr 5.0. That Jetty has been properly tuned for Solr -- an out-of-the-box config for Tomcat (or any other container) isn't tuned. For stopping queries that take too long, Solr has this setting: https://cwiki.apache.org/confluence/display/solr/Common+Query+Parameters#CommonQueryParameters-ThetimeAllowedParameter The timeAllowed parameter does not always work -- it depends on which phase of a query is taking too long. You can also configure the soTimeout in your client's TCP settings, and in Tomcat, to kill the connection if it is idle for too long. There may be other options that might work, these are the ones that I know about. Thanks, Shawn