tomcat性能调整的几点:
1. enableLookups: Set to true
if you want calls to request.getRemoteHost()
to perform DNS lookups in order to return the actual host name of the remote client. Set to false
to skip the DNS lookup and return the IP address in String form instead (thereby improving performance). By default, DNS lookups are enabled 。
2. maxPostSzie:
The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes).
3. acceptCount:
The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. The default value is 100.
4. connectionTimeout:
The number of milliseconds this Connector will wait, after accepting a connection, for the request URI line to be presented. The default value is 60000 (i.e. 60 seconds).
5. disableUploadTimeout:
This flag allows the servlet container to use a different, longer connection timeout while a servlet is being executed, which in the end allows either the servlet a longer amount of time to complete its execution, or a longer timeout during data upload. If not specified, this attribute is set to "true".
6. maxSpareThreads:
The maximum number of unused request processing threads that will be allowed to exist until the thread pool starts stopping the unnecessary threads. The default value is 50.
7. maxThreads :
The maximum number of request processing threads to be created by this Connector, which therefore determines the maximum number of simultaneous requests that can be handled. If not specified, this attribute is set to 200.
8. minSpareThreads :
The number of request processing threads that will be created when this Connector is first started. The connector will also make sure it has the specified number of idle processing threads available. This attribute should be set to a value smaller than that set for maxThreads
. The default value is 4.
9. bufferSize :
The size (in bytes) of the buffer to be provided for input streams created by this connector. By default, buffers of 2048 bytes will be provided.
借鉴:
web server允许的最大连接数还受制于操作系统的内核参数设置,通常Windows是2000个左右,Linux是1000个左右。
1. 禁用DNS:
enabledLookups=false
当web应用程序向要记录客户端的信息时,它也会记录客户端的IP地址或者通过域名服务器查找机器名转换为IP地址。DNS查询需要占用网络,并且包括可能从很多很远的服务器或者不起作用的服务器上去获取对应的IP的过程,这样会消耗一定的时间
分享到:
相关推荐
9. **性能优化**:Tomcat可以通过调整线程池大小、内存分配、连接超时等参数来优化性能。这些参数通常在`conf/server.xml`中进行配置。 10. **集成开发环境(IDE)**:MyEclipse是一款集成开发环境,特别适合用于...
Tomcat8是该系列的一个版本,提供了更高的性能和稳定性。 5. **JDK8**: - JDK(Java Development Kit)是Java编程语言的软件开发工具包,包含了编译器、调试器和Java运行环境。JDK8引入了Lambda表达式、Stream ...
MyBatis是一个优秀的持久层框架,它支持定制化SQL、存储过程以及高级映射,避免了几乎所有的JDBC代码和手动设置参数以及获取结果集。 在数据库方面,该项目使用了MySQL数据库,它是目前最流行的开源数据库系统之一...
部署则包括在Windows服务器上安装必要的软件环境(如Tomcat服务器、MySQL数据库)、配置服务器参数、发布项目等。 7. **系统测试**:测试阶段包括单元测试、集成测试和系统测试,确保所有功能正常工作,没有bug,...
7. **调试与优化**:在实际开发过程中,SSM框架的调试和优化是必不可少的,这包括性能优化(如使用PageHelper分页插件,减少数据库查询次数)、异常处理、日志记录等方面。 8. **持续集成与部署**:SSM项目通常会...