tomcat配置性能调优1----server.xml文件详解
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<!--全局命名资源,来定义一些外部访问资源,其作用是为所有引擎应用程序所引用的外部资源的定义--!>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="800" //tomcat起动的最大线程数,即同时处理的任务个数,默认值为200。
minSpareThreads="30" //Tomcat初始化时创建的线程数。
maxSpareThreads="75" //一旦创建的线程超过这个值,Tomcat就会关闭不再需要的socket线程。
maxIdleTime="60000"/>
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector executor="tomcatThreadPool"
port="8080" //连接器的端口
acceptCount="200" //指定当所有可以使用的处理请求的线程数都被使用时,可以放到处理队列中的请求数,超过这个数的请求将不予处理
protocol="org.apache.coyote.http11.Http11NioProtocol" //连接器使用的传输方式(使用NIO在服务器端会有更好的性能,加强服务器端对并发处理的性能。)
acceptorThreadCount="2"
enableLookups="false" //是否反查域名,取值为:true或false。(为了提高处理能力,应设置为false)
connectionTimeout="60000" //网络连接超时,单位:毫秒。设置为0表示永不超时,这样设置有隐患的。通常可设置为30000毫秒。
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the BIO implementation that requires the JSSE
style configuration. When using the APR/native implementation, the
OpenSSL style configuration is required as described in the APR/native
documentation -->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%{X-Real-IP}i %h %l %u %t "%r" %s %b" />
<Context path="" docBase="/home/ecsc" debug="0" reloadable="true" sessionCookieName="ECSCSessionID"/>
</Host>
</Engine>
</Service>
</Server>
tomcat配置性能调优1----server.xml文件详解的更多相关文章
- Tomcat 的 server.xml 文件详解
文件内容解读 <?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apac ...
- jvm 性能调优工具之 jps 命令详解
JPS名称:jps - Java Virtual Machine Process Status Tool命令用法:jps [options] [hostid] options:命令选项,用来对输出格式 ...
- server.xml文件详解
一.server.xml文件介绍 1.server.xml作用 Server.xml配置文件用于对整个容器进行相关的配置. 2.server.xml文件的配置元素列表 <Server&g ...
- Tomcat学习笔记【4】--- Server.xml配置文件详解
本文主要讲如何配置Tomcat服务器. 首先展示一个BS结构图: 1 server 一个server就表示一个Tomcat实例. 1)port 指定一个端口,这个端口负责监听关闭tomcat的请求: ...
- jvm 性能调优工具之 jstat 命令详解
Jstat名称:Java Virtual Machine statistics monitoring tool 官方文档:https://docs.oracle.com/javase/1.5.0/do ...
- jvm 性能调优工具之 jmap 命令详解
jmap名称:Java Memory Map(内存映射) 官方文档:https://docs.oracle.com/javase/1.5.0/docs/tooldocs/share/jmap.html ...
- tomcat 加载顺序 web.xml文件详解
一. 1.启动一个WEB项目的时候,WEB容器会去读取它的配置文件web.xml,读取<listener>和<context-param>两个结点. 2.紧急着,容创建一个Se ...
- web.xml文件详解
web.xml文件详解 Table of Contents 1 listener. filter.servlet 加载顺序 2 web.xml文件详解 3 相应元素配置 1 listener. f ...
- javaweb web.xml文件详解
web.xml文件详解 前言:一般的web工程中都会用到web.xml,web.xml主要用来配置,可以方便的开发web工程.web.xml主要用来配置Filter.Listener.Servlet等 ...
随机推荐
- 如何用Jupyter Notebook打开Spark
电脑已经装了anaconda python,然后下载了spark2.1.0.因为版本太新,所以网上和书上的一些内容已经不再适用.比如关于如何使用IPython和Jupyter,教程给出的方法是用如下语 ...
- email
#region 邮件帮助类 //+-------------------------------------------------------------------+ //+ FileName: ...
- 改写jquery.validate.unobtrusive.js实现气泡提示mvc错误
个人对于这个js.css不是很擅长,所以这个气泡提醒的样式网上找了下,用了这个http://www.cnblogs.com/wifi/articles/2918950.html当中的第一种写法. 对于 ...
- Python IDE PyCharm的基本快捷键和配置简介
快捷键 1.编辑(Editing)Ctrl + Space 基本的代码完成(类.方法.属性)Ctrl + Alt + Space 快速导入任意类Ctrl + Shift + Enter 语句完成Ctr ...
- java class的property的get和set方法生成规则
package rh.intellicareAppServer.dao; public class test { String aA; String aa; public String getaA() ...
- nyoj 881 小M的区间公约数
点击打开链接 首先给的范围很大,是10^9.暴力解肯定超时(单用for循环到10^9都大约要2s-3s),首先写了个程序暴力的把两个数所有的约数都打印出来,最后发现所有的公约数都是最大公约数的约数,并 ...
- [DFNews] Cellebrite UFED Physical Analyzer 3.8
Cellebrite 两周前正式发布了UFED设备所附带的Physical Analyzer和Logical Analyzer软件,更新后版本为3.8 下载地址已更新至置顶资源下载页面. 主要更新如下 ...
- Redis 配置文件
# Redis configuration file example. # # Note that in order to read the configuration file, Redis mus ...
- 《JS高程》中的正则的复杂模式的总结
复杂模式: *分组: var reDogDog=/dogdog/g;---------------var reDogDog=/(dog){2}/g; *引用:(注意带括号和不带括号) var sMat ...
- IE8 jq focus BUG
jq的 .focus() 在IE8下面会有一些意想不到的BUG,下面是解决办法: 一.我做的项目中有些场景需要用到键盘的回车作为触发事件,然后把focus移到其他功能或者按钮上面,刚刚好这个按钮或者功 ...