`
wx1568905209
  • 浏览: 25113 次
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

tomcat优化

 
阅读更多

jvm参数设置

修改bin/catalina.bat文件设置参数(第一行)

set JAVA_OPTS= -server -Xms1024m -Xmx2048m -XX:NewSize=512m -XX:MaxNewSize=1024m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:MaxTenuringThreshold=10 -XX:NewRatio=2 -XX:+DisableExplicitGC

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 shutdown="SHUTDOWN" port="8005">

<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 pathname="conf/tomcat-users.xml" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" description="User database that can be updated and saved" type="org.apache.catalina.UserDatabase" auth="Container" name="UserDatabase"/>

</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 8080 -->


<Connector port="8080" redirectPort="8443" connectionTimeout="20000" protocol="HTTP/1.1"/>

<!-- 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" redirectPort="8443" protocol="AJP/1.3"/>

<!-- 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" autoDeploy="true" unpackWARs="true" appBase="webapps">

<!-- 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" pattern="%h %l %u %t "%r" %s %b" suffix=".txt" prefix="localhost_access_log." directory="logs"/>

</Host>

</Engine>

</Service>

</Server>

转载于:https://my.oschina.net/u/3076395/blog/821031

分享到:
评论

相关推荐

    Tomcat优化

    Tomcat优化是提升Java Web应用性能的关键步骤,特别是在使用Tomcat 7这个版本时,优化工作显得尤为重要。本文将深入探讨基于Tomcat 7的优化策略,包括配置调整、AJP连接器的禁用以及JVM参数的优化。 一、Tomcat配置...

    TOMCAT优化

    ### TOMCAT优化详解 #### 一、引言 随着互联网技术的发展及企业级应用的不断扩展,服务器性能优化成为提高用户体验、确保业务稳定的关键因素之一。Apache Tomcat作为一款广泛使用的开源Servlet容器,其性能直接...

    Tomcat优化相关问题.pdf

    Tomcat 优化相关问题 Tomcat 优化是指对 Apache Tomcat 服务器进行性能调整和优化,以提高其处理请求的速度和效率。下面是 Tomcat 优化相关问题的详细知识点: 一、JVM 参数调优 在 Tomcat 中,JVM 参数调优是...

    Tomcat性能优化

    【标签】:“Tomcat优化”进一步确认了我们要关注的是Tomcat的整体优化策略,这包括但不限于启动速度、并发能力、内存使用效率等方面。 【文件】:“Tomcat7性能优化调优.docx”可能包含了关于Tomcat7性能优化的...

    tomcat日志切割和tomcat优化

    【标题】:Tomcat日志切割与Tomcat优化 【内容】: Tomcat作为流行的Java Servlet容器,其性能和日志管理是运维人员关注的重点。日志切割是保持日志文件大小合理、便于管理和分析的重要手段,而Tomcat优化则关乎...

    Tomcat优化-Tomcat 的性能调优的原理和方法

    ### Tomcat优化——Tomcat 的性能调优的原理和方法 #### 一、概述 Tomcat作为一款广泛使用的开源Web服务器容器,其性能直接影响到基于它的应用程序的表现。本文旨在介绍Tomcat性能调优的基本原理与具体实施方法,...

    Tomcat\Tomcat优化和监控

    【Tomcat优化与监控】是IT领域中针对服务器性能提升和状态监控的重要环节,尤其是在运行Java应用程序时,Tomcat作为广泛使用的应用服务器,其优化能够显著提升系统性能和稳定性。以下将详细介绍标题和描述中涉及的...

    tomcat优化及安全

    【标题】:Tomcat优化与安全强化指南 【描述】:本文将深入探讨Tomcat服务器的优化策略和安全配置规范,以确保应用高效稳定运行并防止潜在的安全风险。 【标签】:Tomcat优化 服务器安全 【正文】: Tomcat是一...

    windows64位环境tomcat7.0、8.0下载(内含一张tomcat优化代码截图)

    以下是对“windows64位环境tomcat7.0、8.0下载(内含一张tomcat优化代码截图)”这一主题的详细解读。 首先,Apache Tomcat 7.0.70和8.0.5是两个不同版本的Tomcat,每个版本都有其特定的特性和改进。Tomcat 7.0是7.x...

    tomcat优化调优文档

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

    apr库(tomcat优化)

    包含以上是个包,只要应用于LINUX下,用于TOMCAT优化apr连接器使用的 说明下关于TOMCAT调优一种建议 1 Connector介绍  1.1 Connector的种类  Tomcat源码中与connector相关的类位于org.apache.coyote包中,Connector...

    tomcat优化配置1

    Tomcat优化配置是提升Java应用程序性能的关键步骤,尤其是对于运行在Tomcat上的Web应用。本篇文章将详细讲解Tomcat的内存优化和连接器配置优化,帮助你确保服务器稳定且高效地运行。 首先,我们关注Tomcat的内存...

    Tomcat优化相关问题.zip

    《深入探讨Tomcat优化》 在Java Web开发领域,Tomcat作为一款广泛应用的开源Servlet容器,其性能优化是提升系统整体效率的关键环节。面试中,掌握Tomcat的优化技巧不仅能够展现出开发者对服务器管理的深入理解,也...

    【面试资料】-(机构内训资料)Tomcat优化相关问题.zip

    【标题】中的“Tomcat优化相关问题”是一个关键主题,这通常涉及到服务器性能提升、稳定性增强以及资源管理等核心议题。Tomcat是Apache软件基金会的一个开源项目,它是一个小巧且高效的Java Servlet容器,广泛用于...

Global site tag (gtag.js) - Google Analytics