Some configuration instructions in Tomcat (transfer)

xiaoxiao2021-03-06  45

Some configuration instructions in Tomcat (transfer)

1. How to increase the number of Tomcat connections

In the configuration in Tomcat Profile Server.xml, the parameters related to the number of connections are: minProcessors: Minimum idle connection thread, used to improve system processing performance, default is 10maxProcessors: maximum connection thread Number, that is, the maximum number of concurrent processes, the default value is 75AcceptCount: Allowed maximum queue connections, this value is not too large Enablelookups: whether the domain name is reversed, and the value is: True or FALSE. In order to improve processing power, it should be set to falseConnectionTimeout: Network connection timeout, unit: milliseconds. Set to 0 indicates that never timeout, this is set to have hidden dangers. It is usually set to 30000 milliseconds. The parameters related to the maximum number of connections are MaxProcessors and AcceptCount. If you want to increase the number of concurrent connections, you should increase these two parameters.

The maximum number of web services allowed is also subject to the operating system's kernel parameter setting, usually Windows is about 2,000, Linux is about 1000. How to set these parameters in UNIX, see the configuration example in the UNIX common monitoring and management command Tomcat4:

Port = "8080" MINPROCESSORS = "10" maxprocessors = "1024"

Enablelookups = "false" redirectport = "8443"

Acceptcount = "1024" debug = "0" connectionTIMEOUT = "30000" />

Listening to other ports is pushed.

2. How to disable files in column directory in Tomcat

In {Tomcat_Home} /conf/web.xml, set the listings parameter to false, as follows:

...

Listings

false

...

3. How to increase the memory you can use by Tomcat

Tomcat can be used by default to 128MB, in larger application items, this memory is not enough, it needs to be protected. Under UNIX, in front of the file {tomcat_home} /bin/catalina.sh, add the following settings: java_opts = '- XMS [Initialization Memory Size] -XMX [The maximum memory you can use] "Need to turn this two parameter values . For example: java_opts = '- XMS256M -XMX512M' indicates that the initialization memory is 256MB, and the maximum memory that can be used is 512MB.

转载请注明原文地址:https://www.9cbs.com/read-57047.html

New Post(0)