`
gutou9
  • 浏览: 144639 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

Tomcat 调优

    博客分类:
  • Web
 
阅读更多

查看tomcat 线程数

ps -efL |grep java|wc -l

 

-----------------------------------------------------------------

 

<?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">

  <!-- 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="150" minSpareThreads="4"/>

    -->

 

 

    <!-- 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 80

    -->

    <Connector port="80" protocol="HTTP/1.1"

               connectionTimeout="20000"

               redirectPort="8443" URIEncoding="UTF-8" 

 minSpareThreads="25" maxSpareThreads="75"

enableLookups="false" disableUploadTimeout="true"

acceptCount="300"  maxThreads="300" 

maxProcessors="1000" minProcessors="5"

useURIValidationHack="false"

compression="on" 

compressionMinSize="2048" 

maxKeepAliveRequests="1000"

noCompressionUserAgents="gozilla, traviata" 

compressableMimeType="text/html,text/plain,text/css,text/javascript,text/json,application/x-javascript,application/javascript,application/json,application/octet-stream"/>

    <!-- A "Connector" using the shared thread pool-->

    <!--

    <Connector executor="tomcatThreadPool"

               port="80" protocol="HTTP/1.1"

               connectionTimeout="20000"

               redirectPort="8443" URIEncoding="UTF-8"

compression="on" 

compressionMinSize="2048" 

noCompressionUserAgents="gozilla, traviata" 

compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain"

  />

    -->

    <!-- 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">

 

<Context path=""

               docBase="tgy"/>

 

        <!-- 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="%h %l %u %t &quot;%r&quot; %s %b" />

 

      </Host>

    </Engine>

  </Service>

</Server>

 

分享到:
评论

相关推荐

    Tomcat调优及相关汇总设置

    ### Tomcat调优及相关汇总设置 #### 一、Tomcat防止恶意攻击 ##### 1. 管理平台安全设置 - **管理平台**: Tomcat自带的管理平台(manager)是一个web应用,可通过`localhost:8080/manager/html`进行访问。此平台...

    Tomcat 调优及 JVM 参数优化

    这篇文章将深入探讨Tomcat调优与JVM参数优化的各个方面,帮助你提升服务器性能。 首先,我们来了解一下Tomcat调优的基础知识。Tomcat调优主要包括以下几个方面: 1. **线程池配置**:调整`maxThreads`和`...

    Tomcat调优及相关设置汇总-paulen.docx.rar_Tomcat调优及相关设置汇总_flowerd54

    《Tomcat调优及相关设置汇总》是一份详细探讨如何优化Apache Tomcat服务器性能的重要文档,由作者flowerd54编写。Tomcat作为广泛使用的开源Java Servlet容器,其性能调优对于提升Web应用的响应速度和处理能力至关...

    tomcat调优.zip

    【标题】"Tomcat调优.zip"所包含的是一系列关于Tomcat服务器优化的资料,主要探讨了Tomcat的整体架构、线程模型以及类加载机制等核心知识点。 首先,我们来深入理解一下Tomcat的整体架构及其设计精髓。Tomcat作为一...

    jvm虚拟机参数调优,tomcat调优

    接下来,Tomcat调优主要包括以下几个方面: 1. **连接器优化**:`Connector`组件负责处理客户端请求。可以通过调整`maxThreads`(最大线程数)和`minSpareThreads`(最小空闲线程数)来平衡响应速度和资源利用率。 ...

    tomcat调优

    在进行Tomcat调优时,首先需要理解其服务器与JVM的基本信息及其重要性。 **1.1 JVM区域分配** - **PSEdenSpace(新生代)**: 新创建的对象一般会被分配到这里。在垃圾回收过程中,大部分不再使用的对象将在这里被...

    Tomcat调优配置技巧[参考].pdf

    Tomcat调优是提高应用程序性能的关键步骤,尤其对于处理高并发和大数据量的应用来说更为重要。以下是一些关键的Tomcat调优配置技巧: 一、启用Gzip压缩 为了减少网络流量,可以在Tomcat配置中启用Gzip压缩。在`...

    Tomcat调优配置技巧[文].pdf

    《Tomcat调优配置技巧详解》 在软件开发领域,优化服务器性能是至关重要的,尤其对于使用Apache Tomcat作为应用服务器的情况。Tomcat以其轻量级、高效的特点被广泛采用,但随着应用规模的扩大,对其进行调优配置就...

    tomcat调优和java配置.doc

    Tomcat调优和Java配置是优化服务器性能的关键步骤,尤其对于运行大型Web应用程序的企业来说。以下是对这些主题的详细讨论: 首先,配置Java环境变量是基础。在Linux系统中,这通常涉及编辑`/etc/profile`文件。在该...

    Tomcat性能调优方案

    Tomcat性能调优方案,tomcat集群,tomcat配置 三、Apache集成Tomcat Web服务器专门处理HTTP请求,应用服务器是通过很多协议为应用提供商业逻辑。虽然Tomcat也可以作web服务器,但其处理静态html的速度比不上Apache...

    Tomcat调优.doc

    在优化Apache Tomcat服务器以提高性能的过程中,有多个关键配置参数需要调整。这些调整主要集中在JVM内存设置和Tomcat的Connector配置上。下面将详细解释这些参数的含义及其优化方法。 首先,我们关注的是`JAVA_...

    tomcat优化调优文档

    ### Tomcat优化调优知识点详解 #### 一、Tomcat简介及重要性 Tomcat作为一款免费且开源的Web应用服务器软件,在Java开发领域占据着举足轻重的地位。其核心功能是支持运行Java Servlet/JSP,同时也因其轻量级、易用...

    学习juc、nio、netty、tomcat调优、jvm调优-Advanced-JAVA.zip

    本资料主要涵盖了五个核心领域:Java并发(JUC)、非阻塞I/O(NIO)、Netty框架、Tomcat服务器优化以及Java虚拟机(JVM)调优。以下是这些主题的详细说明: 1. **Java并发(JUC - Java Concurrency Utilities)** ...

    tomcat调优监控工具-probe.rar

    它的目的是替换和扩展 Tomcat 管理器,使得管理和监视 Apache Tomcat 的实例更容易。与许多其他服务器监控工具不同, psi-prob e 不需要对现有应用程序进行任何更改。它通过一个 Web 可访问的接口提供它的所有特性,...

    Tomcat服务器性能调优几个方面[定义].pdf

    Tomcat服务器性能调优是提升应用程序运行效率的关键环节,涉及到多个层面的调整。以下将详细阐述从操作系统、Java虚拟机、Apache与Tomcat的集成以及Apache和Tomcat集群等方面的调优策略。 首先,**操作系统调优**是...

Global site tag (gtag.js) - Google Analytics