1. 如何加大tomcat连接数
在tomcat配置文件server.xml中的<Connector ... />配置中,和连接数相关的参数有:
minProcessors:最小空闲连接线程数,用于提高系统处理性能,默认值为10
maxProcessors:最大连接线程数,即:并发处理的最大请求数,默认值为75
acceptCount:允许的最大连接数,应大于等于maxProcessors,默认值为100
enableLookups:是否反查域名,取值为:true或false。为了提高处理能力,应设置为false
connectionTimeout:网络连接超时,单位:毫秒。设置为0表示永不超时,这样设置有隐患的。通常可设置为30000毫秒。
其中和最大连接数相关的参数为maxProcessors和acceptCount。如果要加大并发连接数,应同时加大这两个参数。
web server允许的最大连接数还受制于操作系统的内核参数设置,通常Windows是2000个左右,Linux是1000个左右。Unix中如何设置这些参数,请参阅Unix常用监控和管理命令
tomcat4中的配置示例:
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080" minProcessors="10" maxProcessors="1024"
enableLookups="false" redirectPort="8443"
acceptCount="1024" debug="0" connectionTimeout="30000" />
对于其他端口的侦听配置,以此类推。
2. tomcat中如何禁止列目录下的文件
在{tomcat_home}/conf/web.xml中,把listings参数设置成false即可,如下:
<servlet>
...
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
...
</servlet>
3. 如何加大tomcat可以使用的内存
tomcat默认可以使用的内存为128MB,在较大型的应用项目中,这点内存是不够的,需要调大。
Unix下,在文件{tomcat_home}/bin/catalina.sh的前面,增加如下设置:
JAVA_OPTS='-Xms【初始化内存大小】 -Xmx【可以使用的最大内存】'
需要把这个两个参数值调大。例如:
JAVA_OPTS='-Xms256m -Xmx512m'
表示初始化内存为256MB,可以使用的最大内存为512MB
分享到:
相关推荐
赠送jar包:jboss-threads-3.1.0.Final.jar; 赠送原API文档:jboss-threads-3.1.0.Final-javadoc.jar; 赠送源代码:jboss-threads-3.1.0.Final-sources.jar; 赠送Maven依赖信息文件:jboss-threads-3.1.0.Final....
Java.Threads.3rd.Edition.txtJava.Threads.3Java.Threads.3rd.Edition.txtrd.Edition.txtJava.Threads.3rd.Edition.txt
Putting the TVs All Together: Decktastic Creating a MediaRouteProvider Screenshots and Screen Recordings Advanced Permissions Restricted Profiles and UserManager Miscellaneous Security Techniques ...
worker-threads-pool:轻松管理Node.js工作线程池
This concise book empowers all Java developers to master the complexity of the Java thread APIs and concurrency utilities. This knowledge aids the Java developer in writing correct and complex ...
java线程定位脚本
linux实用脚本show-busy-java-threads、show-duplicate-java-classes、find-in-jars
show-busy-java-threads脚本初体验,快速排查Java的CPU性能问题
赠送jar包:jboss-threads-3.1.0.Final.jar; 赠送原API文档:jboss-threads-3.1.0.Final-javadoc.jar; 赠送源代码:jboss-threads-3.1.0.Final-sources.jar; 赠送Maven依赖信息文件:jboss-threads-3.1.0.Final....
用于快速排查Java的CPU性能问题(top us值过高),自动查出运行的Java进程中消耗CPU多的线程,并打印出其线程栈,从而确定导致性能问题的方法调用。 目前只支持Linux。原因是Mac、Windows的ps命令不支持列出进程的线程...
java中 關於 thread的使用和一些範例~
How many threads:blocks should I use,讲述在NVIDIA CUDA编程中如何设置blocks/threads数目。
show-busy-java-threads.sh文件 ,查看JVM运行过程中导致 Linux CPU飙高
rpm安装包,rpm -i example.rpm
Ultimate Bulletin Board Threads v6.3.0.0.zip