Configuration instructions in Tomcat

Source: Internet
Author: User
1. How to Increase Tomcat connections

In the <connector.../> configuration in the tomcat configuration file server. XML, the parameters related to the number of connections include:
Minprocessors: Minimum number of idle connection threads to improve system processing performance. The default value is 10.
Maxprocessors: Maximum number of connection threads, that is, the maximum number of concurrent requests. The default value is 75.
Acceptcount: Maximum number of connections allowed. It must be greater than or equal to maxprocessors. The default value is 100.
Enablelookups: whether to check the domain name. The value is true or false. Set to false to improve processing capability.
Connectiontimeout: the network connection times out. Unit: milliseconds. If it is set to 0, it indicates that the request Never times out. This setting has potential risks. Generally, it can be set to 30000 ms.

The parameters related to the maximum number of connections are maxprocessors and acceptcount. To increase the number of concurrent connections, increase these two parameters at the same time.

The maximum number of connections allowed by the Web server is also subject to the kernel parameter settings of the operating system. Generally, Windows has about 2000 connections, and Linux has about 1000 connections. For more information about how to set these parameters in UNIX, see Common Unix monitoring and management commands.

Tomcat4 configuration example:
<Connector classname = "org. Apache. Coyote. tomcat4.coyoteconnector"
Port = "8080" minprocessors = "10" maxprocessors = "1024"
Enablelookups = "false" redirectport = "8443"
Acceptcount = "1024" DEBUG = "0" connectiontimeout = "30000"/>

Configure listening for other ports, and so on.

2. How to disable files in the column directory in Tomcat
In {tomcat_home}/CONF/Web. XML, set the listings parameter to false, as shown below:
<Servlet>
...
<Init-param>
<Param-Name> listings </param-Name>
<Param-value> false </param-value>
</Init-param>
...
</Servlet>

3. How to Increase the memory available for Tomcat

By default, Tomcat can use 128 MB of memory. In large application projects, this memory is insufficient and needs to be increased.

In UNIX, add the following settings before the file {tomcat_home}/bin/Catalina. sh:
Java_opts = '-XMS [initial memory size]-xmx [maximum memory available ]'
You need to increase the value of these two parameters. For example:
Java_opts = '-xms256m-xmx512m'
Indicates that the initial memory is 256 MB, and the maximum memory available is 512 MB.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.