38 tomcat lb cluster、memcached和msm、msm及jvm虚拟机性能监控、tcpdump和nc工具的使用

01 tomcat lb cluster

配置环境

node1 192.168.1.131 CentOS 7.2

node4 192.168.1.132 CentOS 7.2

node3 192.168.1.133 CentOS 7.2

1、如何部署多个tomcat实例向用户提供服务

#node4结点配置tomcat

[[email protected] ~]# tar xf apache-tomcat-8.0.38.tar.gz -C /usr/local/

[[email protected] ~]# cd /usr/local/

[[email protected] local]# ln -s apache-tomcat-8.0.38/ tomcat

[[email protected] local]# vim /etc/profile.d/tomcat.sh

export CATALINA_HOME=/usr/local/tomcat

export PATH=$CATALINA_HOME/bin:$PATH

[[email protected] local]# . /etc/profile.d/tomcat.sh

[[email protected] local]# catalina.sh version

[[email protected] local]# mkdir -p /data/webapps/ROOT

[[email protected] local]# cd tomcat/conf/

[[email protected] conf]# cp server.xml{,.bak}

[[email protected] conf]# vim server.xml

修改

<Engine name="Catalina" defaultHost="localhost">

<Engine name="Catalina" defaultHost="node4.magedu.com">

添加Host主机

 <Host name="node4.magedu.com" appBase="/data/webapps" autoDeploy="true">

<Context path="" docBase="ROOT"  />

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="/data/logs"

  prefix="web1_access_log" suffix=".txt"

  pattern="%h %l %u %t &quot;%r&quot; %s %b" />

 </Host>

 

[[email protected] conf]# mkdir /data/logs

[[email protected] conf]# catalina.sh configtest

[[email protected] conf]# mkdir -p /data/webapps/ROOT/{lib,classes,META-INF,WEB-INF}

[[email protected] conf]# vim /data/webapps/ROOT/index.jsp

<%@ page language="java" %>

<%@ page import="java.util.*" %>

<html>

<head>

<title>JSP Test Page on Web1</title>

</head>

<body>

<% out.println("Hello,web1."); %>

</body>

</html>     

[[email protected] conf]# catalina.sh start

[[email protected] conf]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.131   node1   node1.magedu.com

192.168.1.132   node4   node4.magedu.com

192.168.1.133   node3   node3.magedu.com

[[email protected] conf]# curl node4.magedu.com:8080

#node3结点配置tomcat

[[email protected] ~]# scp apache-tomcat-8.0.38.tar.gz node3:/root

[[email protected] ~]# scp -rp /data/ node3:/data

[[email protected] ~]# tar xf apache-tomcat-8.0.38.tar.gz -C /usr/local/

[[email protected] ~]# cd /usr/local/

[[email protected] local]# ln -s apache-tomcat-8.0.38/ tomcat

[[email protected] ~]# cd /usr/local/tomcat/conf/

[[email protected] conf]# scp server.xml node3:/usr/local/tomcat/conf/

[[email protected] local]# cd tomcat/conf/

[[email protected] conf]# vim server.xml 

修改

<Engine name="Catalina" defaultHost="localhost">

<Engine name="Catalina" defaultHost="node3.magedu.com">

修改

node4.magedu.com

node3.magedu.com

[[email protected] conf]# scp /etc/profile.d/tomcat.sh node3:/etc/profile.d/

[[email protected] conf]# . /etc/profile.d/tomcat.sh

[[email protected] conf]# catalina.sh start

[[email protected] ~]# curl node3.magedu.com:8080

[[email protected] conf]# vim /data/webapps/ROOT/index.jsp

<%@ page language="java" %>

<%@ page import="java.util.*" %>

<html>

<head>

<title>JSP Test Page on Web1</title>

</head>

<body>

<% out.println("Hello,web2."); %>

</body>

</html>     

[[email protected] ~]# yum -y install nginx

[[email protected] ~]# cd /etc/nginx/

[[email protected] nginx]# cp nginx.conf{,.bak}

[[email protected] nginx]# vim nginx.conf

在server段前添加

upstream tcsrvs {

   ip_hash; #对客户端锁定服务器

server node4.magedu.com:8080;

server node3.magedu.com:8080;

}

在server段内添加

location ~* \.(jsp|do)$ {

proxy_pass http://tcsrvs;

}

[[email protected] nginx]# nginx -t

[[email protected] nginx]# systemctl start nginx.service

2、如何使用httpd反代用户请求

(1)方法一

apache:

mod_proxy

mod_proxy_http

mod_proxy_balancer

tomcat:

http connector

[[email protected] nginx]# systemctl stop nginx.service

[[email protected] nginx]# systemctl disable nginx.service

[[email protected] nginx]# yum -y install httpd

[[email protected] ~]# cd /etc/httpd/conf

[[email protected] conf]# vim httpd.conf 

注释掉

#DocumentRoot "/var/www/html"

[[email protected] conf]# cd ../conf.d/

[[email protected] conf.d]# vim vhost.conf

<proxy balancer://lbcluster1>

BalancerMember http://192.168.1.132:8080 loadfactor=10 route=TomcatA

BalancerMember http://192.168.1.133:8080 loadfactor=10 route=TomcatB

</proxy>

<VirtualHost *:80>

ServerName web1.magedu.com

ProxyVia On

ProxyRequests Off 

ProxyPreserveHost On

<Proxy *>

Require all granted

</Proxy>

ProxyPass / balancer://lbcluster1/

ProxyPassReverse / balancer://lbcluster1/

<Location />

Require all granted

</Location>

</VirtualHost>

如果需要会话绑定,可使用下面的内容:

Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e;path=/" env=BALANCER_ROUTE_CHANGED

<proxy balancer://lbcluster1>

BalancerMember http://192.168.1.132:8080 loadfactor=10 route=TomcatA

BalancerMember http://192.168.1.133:8080 loadfactor=10 route=TomcatB

ProxySet stickysession=ROUTEID

</proxy>

<VirtualHost *:80>

ServerName web1.magedu.com

ProxyVia On

ProxyRequests Off

ProxyPreserveHost On

<Proxy *>

Require all granted

</Proxy>

ProxyPass / balancer://lbcluster1/

ProxyPassReverse / balancer://lbcluster1/

<Location />

Require all granted

</Location>

</VirtualHost>

[[email protected] conf.d]# systemctl start httpd.service 

[[email protected] conf]# vim server.xml

修改

<Engine name="Catalina" defaultHost="node4.magedu.com">

<Engine name="Catalina" defaultHost="node4.magedu.com" jvRoute="TomcatA">

[[email protected] conf]# vim server.xml

修改

<Engine name="Catalina" defaultHost="node3.magedu.com">

<Engine name="Catalina" defaultHost="node3.magedu.com" jvRoute="TomcatB">

[[email protected] conf]# catalina.sh stop

[[email protected] conf]# catalina.sh stop

[[email protected] conf]# vim /data/webapps/ROOT/index.jsp 

<%@ page language="java" %>

<html>

 <head><title>TomcatA</title></head>

 <body>

<h1><font color="red">TomcatA.magedu.com</font></h1>

<table align="centre" border="1">

 <tr>

<td>Session ID</td>

<% session.setAttribute("magedu.com","magedu.com"); %>

<td><%= session.getId() %></td>

 </tr>

 <tr>

<td>Created on</td>

<td><%= session.getCreationTime() %></td>

</tr>

</table>

 </body>

</html>

[[email protected] conf]# vim /data/webapps/ROOT/index.jsp 

<%@ page language="java" %>

<html>

 <head><title>TomcatB</title></head>

 <body>

<h1><font color="blue">TomcatB.magedu.com</font></h1>

<table align="centre" border="1">

 <tr>

<td>Session ID</td>

<% session.setAttribute("magedu.com","magedu.com"); %>

<td><%= session.getId() %></td>

 </tr>

 <tr>

<td>Created on</td>

<td><%= session.getCreationTime() %></td>

</tr>

</table>

 </body>

</html>

[[email protected] conf]# catalina.sh start

[[email protected] conf]# catalina.sh start

测试

http://192.168.1.131/index.jsp

结果:成功

(2)方法二

apache:

mod_proxy

mod_proxy_ajp

mod_proxy_balancer

tomcat:

http connector

[[email protected] conf.d]# cp vhost.conf vhost.ajp.conf 

[[email protected] conf.d]# mv vhost.conf vhost.http.conf.bak

[[email protected] conf.d]# vim vhost.ajp.conf 

#Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e;path=/" env=BALANCER_ROUTE_CHANGED

<proxy balancer://lbcluster1>

BalancerMember ajp://192.168.1.132:8009 loadfactor=10 route=TomcatA

BalancerMember ajp://192.168.1.133:8009 loadfactor=10 route=TomcatB

#ProxySet stickysession=ROUTEID

</proxy>

<VirtualHost *:80>

ServerName web1.magedu.com

ProxyVia On

ProxyRequests Off

ProxyPreserveHost On

<Proxy *>

Require all granted

</Proxy>

ProxyPass / balancer://lbcluster1/

ProxyPassReverse / balancer://lbcluster1/

<Location />

Require all granted

</Location>

</VirtualHost>

[[email protected] conf.d]# systemctl restart httpd.service

(3)方法3

apache

mod_jk

tomcat:

ajp connector

[[email protected] ~]# tar xf tomcat-connectors-1.2.42-src.tar.gz 

[[email protected] ~]# cd tomcat-connectors-1.2.42-src/native/

[[email protected] native]# yum -y install httpd-devel gcc glibc-devel

[[email protected] native]# which apxs

/usr/bin/apxs

[[email protected] native]# ./configure --with-apxs=/usr/bin/apxs

[[email protected] native]# make -j 4 && make install

[[email protected] native]# cd /etc/httpd/

02 tomcat lb cluster

1、jk_mod:额外编译安装

(1)反向代理

[[email protected] ~]# cd /etc/httpd/conf.d/

[[email protected] conf.d]# mv vhost.ajp.conf{,.bak}

[[email protected] conf.d]# vim mod_jk.conf

LoadModule jk_module modules/mod_jk.so

JkWorkersFile  /etc/httpd/conf.d/workers.properties

JkLogFile  logs/mod_jk.log

JkLogLevel  debug

JkMount  /*  TomcatA

JkMount  /status/  stat1

[[email protected] conf.d]# vim /etc/httpd/conf.d/workers.properties

worker.list=TomcatA,stat1

worker.TomcatA.port=8009

worker.TomcatA.host=192.168.1.132

worker.TomcatA.type=ajp13

worker.TomcatA.lbfactor=1

worker.stat1.type = status

[[email protected] conf.d]# httpd -t

[[email protected] conf.d]# systemctl restart httpd.service

(2)负载均衡

[[email protected] ~]# cd /etc/httpd/conf.d/

[[email protected] conf.d]# vim mod_jk.conf

LoadModule jk_module modules/mod_jk.so

JkWorkersFile  /etc/httpd/conf.d/workers.properties

JkLogFile  logs/mod_jk.log

JkLogLevel  debug

JkMount  /*  lbcluster1

JkMount  /status/  stat1

[[email protected] conf.d]# vim /etc/httpd/conf.d/workers.properties

worker.list = lbcluster1,stat1

worker.TomcatA.type = ajp13

worker.TomcatA.host = 192.168.1.132

worker.TomcatA.port = 8009

worker.TomcatA.lbfactor = 1

worker.TomcatB.type = ajp13

worker.TomcatB.host = 192.168.1.133

worker.TomcatB.port = 8009

worker.TomcatB.lbfactor = 1

worker.lbcluster1.type = lb

worker.lbcluster1.sticky_session = 0

worker.lbcluster1.balance_workers = TomcatA, TomcatB

worker.stat1.type = status

注:如果要实现会话绑定,可以设置worker.lbcluster1.sticky_session = 1

[[email protected] conf.d]# httpd -t

[[email protected] conf.d]# systemctl restart httpd.service

2、Balancer内置管理功能

[[email protected] conf.d]# systemctl stop httpd.service 

[[email protected] conf.d]# mv mod_jk.conf{,.bak}

[[email protected] conf.d]# cp vhost.ajp.conf.bak vhost.ajp.conf

[[email protected] conf.d]# vim vhost.ajp.conf

添加 

<location /balancer-manager>

SetHandler balancer-manager

ProxyPass !

Require all granted

</Location> 

[[email protected] conf.d]# systemctl restart httpd.service 

3、Session Cluster

[[email protected] conf]# catalina.sh stop

[[email protected] ~]# cd /usr/local/tomcat/conf/

[[email protected] conf]# vim server.xml

在Host内部添加

<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"

channelSendOptions="8">

 <Manager className="org.apache.catalina.ha.session.DeltaManager"

  expireSessionsOnShutdown="false"

  notifyListenersOnReplication="true"/>

 <Channel className="org.apache.catalina.tribes.group.GroupChannel">

<Membership className="org.apache.catalina.tribes.membership.McastService"

address="228.0.0.4"

port="45564"

frequency="500"

dropTime="3000"/>

<Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"

 address="192.168.1.132"

 port="4000"

 autoBind="100"

 selectorTimeout="5000"

 maxThreads="6"/>

<Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">

 <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>

</Sender>

<Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>

<Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>

 </Channel>

 <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"

filter=""/>

 <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

 <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"

tempDir="/tmp/war-temp/"

deployDir="/tmp/war-deploy/"

watchDir="/tmp/war-listen/"

watchEnabled="false"/>

 <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>

</Cluster>

[[email protected] conf]# catalina.sh stop

[[email protected] ~]# cd /usr/local/tomcat/conf/

[[email protected] conf]# vim server.xml

在Host内部添加

<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"

channelSendOptions="8">

 <Manager className="org.apache.catalina.ha.session.DeltaManager"

  expireSessionsOnShutdown="false"

  notifyListenersOnReplication="true"/>

 <Channel className="org.apache.catalina.tribes.group.GroupChannel">

<Membership className="org.apache.catalina.tribes.membership.McastService"

address="228.0.0.4"

port="45564"

frequency="500"

dropTime="3000"/>

<Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"

 address="192.168.1.133"

 port="4000"

 autoBind="100"

 selectorTimeout="5000"

 maxThreads="6"/>

<Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">

 <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>

</Sender>

<Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>

<Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>

 </Channel>

 <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"

filter=""/>

 <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

 <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"

tempDir="/tmp/war-temp/"

deployDir="/tmp/war-deploy/"

watchDir="/tmp/war-listen/"

watchEnabled="false"/>

 <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>

</Cluster>

[[email protected] conf]# cp web.xml /data/webapps/ROOT/WEB-INF/

[[email protected] conf]# vim /data/webapps/ROOT/WEB-INF/web.xml 

在web-app段内(</web-app>前)添加

<distributable/>

[[email protected] conf]# scp /data/webapps/ROOT/WEB-INF/web.xml node3:/data/webapps/ROOT/WEB-INF/

[[email protected] conf]# catalina.sh start

[[email protected] conf]# catalina.sh start

[[email protected] conf]# tail /usr/local/tomcat/logs/catalina.out

[[email protected] conf.d]# systemctl stop httpd.service

[[email protected] conf.d]# rm -f vhost.http.conf

[[email protected] conf.d]# cp vhost.ajp.conf.bak vhost.ajp.conf

[[email protected] conf.d]# systemctl start httpd.service 

[[email protected] conf.d]# vim vhost.ajp.conf

[[email protected] conf.d]# systemctl stop httpd.service 

[[email protected] conf.d]# rm -f vhost.ajp.conf

[[email protected] conf.d]# cp mod_jk.conf.bak mod_jk.conf

[[email protected] conf.d]# systemctl start httpd.service

[[email protected] conf.d]# vim workers.properties

[[email protected] conf.d]# systemctl stop httpd.service

[[email protected] conf.d]# cd /etc/nginx/

[[email protected] nginx]# vim nginx.conf

修改location段的内容为:

location / { 

proxy_pass http://tcsrvs;

}   

[[email protected] nginx]# systemctl start nginx.service

03 memcached和msm

[[email protected] ~]# yum -y install memcached

[[email protected] ~]# systemctl start memcached.service 

[[email protected] ~]# yum -y install telnet

[[email protected] ~]# telnet localhost 11211

[[email protected] ~]# systemctl stop memcached.service

#显示memcached详细信息

[[email protected] ~]# memcached -u memcached -vv

[[email protected] ~]# vim /etc/sysconfig/memcached 

修改OPTIONS的值为

OPTIONS="-f 1.2"

[[email protected] ~]# systemctl restart memcached.service 

[[email protected] lib]# yum -y install memcached

[[email protected] lib]# systemctl start memcached.service 

[[email protected] conf]# cd /usr/local/tomcat/lib/

[[email protected] conf]# cd /usr/local/tomcat/lib/

[[email protected] msm]# ls *

memcached-session-manager-1.8.3.jar

memcached-session-manager-tc8-1.8.3.jar

msm-javolution-serializer-1.8.3.jar

spymemcached-2.11.1.jar

[[email protected] msm]# scp * 192.168.1.132:/usr/local/tomcat/lib

[[email protected] msm]# scp * 192.168.1.133:/usr/local/tomcat/lib

[[email protected] lib]# cd ../conf/

[[email protected] conf]# vim server.xml

删除之前配置的Cluster

在Context内部添加

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"

memcachedNodes="n1:192.168.1.131:11211,n3:192.168.1.133:11211"

failoverNodes="n1"

requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"

transcoderFactoryClass="de.javakaffee.web.msm.serializer.javolution.JavolutionTranscoderFactory"

/>

[[email protected] conf]# scp server.xml node3:/usr/local/tomcat/conf/

[[email protected] lib]# catalina.sh start

[[email protected] lib]# catalina.sh start

[[email protected] ~]# cd /etc/nginx/

[[email protected] conf]# rm -f /data/webapps/ROOT/WEB-INF/web.xml 

[[email protected] conf]# rm -f /data/webapps/ROOT/WEB-INF/web.xml 

[[email protected] conf]# catalina.sh stop

[[email protected] conf]# catalina.sh start

[[email protected] conf]# catalina.sh stop

[[email protected] conf]# catalina.sh start

05 tcpdump和nc工具的使用

tcp协议目标端口是80

tcpdump -i eth0 tcp dst port 80

[[email protected] ~]# yum -y install wireshark

[[email protected] ~]# yum -y install wireshark-gnome

[[email protected] ~]# yum -y install nmap

[[email protected] ~]# yum -y install nc

时间: 2024-10-23 11:46:56

38 tomcat lb cluster、memcached和msm、msm及jvm虚拟机性能监控、tcpdump和nc工具的使用的相关文章

Nginx+tomcat session cluster会话保持实验

Nginx+tomcat session cluster会话保持实验 实验要求: 1.nginx+tomcat 负载均衡 2.会话保持 实验拓扑 ip网络规划 Nginxnode2:172.16.76.20 tomcatAnode3:172.16.76.30 tomcatBnode4:172.16.76.40 基础配置 node2: [[email protected]~]# yum install nginx –y    node3:     [[email protected]~]# yum

Session会话保持机制的原理与Tomcat Session Cluster示例

一.Session的定义 在计算机科学中,特别是在网络中,session是两个或更多个通信设备之间或计算机和用户之间的临时和交互式信息交换.session在某个时间点建立,然后在之后的某一时间点拆除.建立的通信session可以在每个方向上涉及多个消息.session通常是有状态的,这意味着至少一个通信部分需要保存关于会话历史的状态信息以便能够进行通信,而在无状态通信中,通信由具有响应的独立请求组成.--Wikipedia Session:在计算机中,尤其是在网络应用中,称为"会话控制"

memcached性能监控

1.安装启动memcached 安装: yum -y install memcached 启动: chkconfig --level 2345 memcached on service memcached start 查看状态: memcached-tool  127.0.0.1:11211 stats 重要指标: cmd_get  查询缓存次数 cmd_set 设置key=>value的次数,没找到就写缓存 get_hits 总命中数get_misses总未命中数 配置文件: /etc/sys

Tomcat(JVM)性能调优

Tomcat架构图 Tomcat与JVM版本优化Tomcat的运行是基于Java的虚拟机.SUN的JVM动态库有client和server两个版本,分别针对桌面应用和服务器应用做了相应的优化,client版本加载速度较快,server版本加载速度较慢但运行起来较快.在命令行输入 java -version 可以看到jvm目前配置的是哪个版本.如果要修改jvm的版本,可更改默认java.exe调用的jvm.dll,这个由jvm.cfg决定.编辑%JAVA_HOME%/jre/lib/i386/jv

Memcached笔记——(一)安装&amp;常规错误&amp;监控

08年的时候接触过Memcached,当时还对它的客户端产品嗤之以鼻,毕竟手工代码没有各种ORM原生XML配置方便.尽管如此,Memcached现在已经成了服务器架构里不可或缺的一部分! 相关链接: Memcached笔记——(一)安装&常规错误&监控Memcached笔记——(二)XMemcached&Spring集成 Memcached笔记——(三)Memcached使用总结 Memcached笔记——(四)应对高并发攻击  一.下载 1.Libevent 简单的说就是一个事件

设置TOMCAT的JVM虚拟机内存大小

你知道如何设置TOMCAT的JVM虚拟机内存大小吗,这里和大家分享一下,JAVA程序启动时JVM都会分配一个初始内存和最大内存给这个应用程序.这个初始内存和最大内存在一定程度都会影响程序的性能. 设置TOMCAT的JVM虚拟机内存大小 Tomcat本身不能直接在计算机上运行,需要依赖于硬件基础之上的操作系统和一个java虚拟机.JAVA程序启动时JVM都会分配一个初始内存 和最大内存给这个应用程序.这个初始内存和最大内存在一定程度都会影响程序的性能.比如说在应用程序用到最大内存的时候,JVM是要

Tomcat 性能监控及调优

1.性能监控 方式1: /usr/local/tomcat7/conf/tomcat-users.xml 添加如下: <role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <role rolename="manager-status"/> &l

云计算高级培训,Tomcat运维JVM 虚拟机常识

云计算高级培训,Tomcat运维JVM 虚拟机常识,作为了解JVM 虚拟机的开始.我们很有必要弄明白以下问题. 所谓虚拟机,就是一台虚拟的计算机.他是一款软件,用来执行一系列虚拟计算机指令.大体上,虚拟机可以分为系统虚拟机和程序虚拟机.大名鼎鼎的VisualBox.VMware就属于系统虚拟机.他们完全是对物理计算机的仿真.提供了一个可以运行完整操作系统的软件平台. 程序虚拟机的典型代表就是Java虚拟机,它专门为执行单个计算机程序而设计,在Java虚拟机中执行的指令我们称为Java字节码指令.

Tomcat调优总结(Tomcat自身优化、Linux内核优化、JVM优化)

Tomcat自身的调优是针对conf/server.xml中的几个参数的调优设置.首先是对这几个参数的含义要有深刻而清楚的理解.以tomcat8.5为例,讲解参数. 同时也得认识到一点,tomcat调优也受制于linux内核.linux内核对tcp连接也有几个参数可以调优. 因此我们可以将tomcat调优分为linux内核优化.java虚拟机调优和tomcat自身的优化. 一.Tomcat自身优化 1. maxThreads :tomcat创建的最大线程数,也就是同时处理的请求最大并发数.默认值