JAVA_OPTS="-Xms2G -Xmx2G -Xmn512m -XX:MetaspaceSize=512M -XX:MaxMetaspaceSize=512M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError 电脑-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xloggc:/appl/gc.log -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly"
修改 server.xml 文件
<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" connectionTimeout="20000" maxHttpHeaderSize="20000" maxThreads="1000" 电脑 minSpareThreads="100" acceptCount="1500" disableUploadTimeout="true" URIEncoding="UTF-8" compression="on" enableLookups="false" compressionMinSize="1024" useSendfile="false" noCompressionUserAgents=电脑34;gozilla, traviata" redirectPort="8443" compressibleMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript" />
参数说明
org.apache.coyote.http11.Http11NioProtocol:调整工作模式为NiomaxThreads:最大线程数,默认150。增大值避免队列请求过多,导致响应缓慢。minSpareThreads:最小空闲线程数。acceptCount:当处理请求超过此值时,将后来请求放到队列中等待。disableUploadTimeout:禁用上传超时时间connectionTimeout:连接超时,单位毫秒,0代表不限制URIEncoding:电脑 URI地址编码使用UTF-8enableLookups:关闭dns解析,提高响应时间compression:启用压缩功能compressionMinSize:最小压缩大小,单位BytecompressibleMimeType :压缩的文件类型
访问项目时不加项目名修改 server.xml 文件,在 Host 标签下新增以下配置即可
<Context path="" docBase="/usr/local/tomcat/webapps/bolo" reloadable="false" />
电脑