Apache配置:主要配置httpd.conf和新增加的文件workers.properties
Httpd.conf:
#一个连接的最大请求数量
MaxKeepAliveRequests 10000 
#NT环境,只能配置这个参数来提供性能
<IfModule mpm_winnt.c> 
#每个进程的线程数,最大1920。NT只启动父子两个进程,不能设置启动多个进程
ThreadsPerChild 1900 
每个子进程能够处理的最大请求数
MaxRequestsPerChild 10000
</IfModule># 加载mod_jk
#
LoadModule jk_module modules/mod_jk.so
#
# 配置mod_jk
#
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
#请求分发,对jsp文件,.do等动态请求交由tomcat处理
DocumentRoot "C:/Apache/htdocs"
JkMount /*.jsp loadbalancer
JkMount /*.do loadbalancer
JkMount /servlet/* loadbalancer
#关掉主机Lookup,如果为on,很影响性能,可以有10多秒钟的延迟。
HostnameLookups Off
#缓存配置
LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so<IfModule mod_cache.c>
CacheForceCompletion 100
CacheDefaultExpire 3600
CacheMaxExpire 86400
CacheLastModifiedFactor 0.1<IfModule mod_disk_cache.c>
CacheEnable disk /
CacheRoot c:/cacheroot
CacheSize 327680
CacheDirLength 4
CacheDirLevels 5
CacheGcInterval 4
</IfModule>
<IfModule mod_mem_cache.c>
CacheEnable mem /
MCacheSize 8192
MCacheMaxObjectCount 10000
MCacheMinObjectSize 1
MCacheMaxObjectSize 51200
</IfModule>
</IfModule>
worker. Properties文件
#
# workers.properties ,可以参考
http://jakarta.apache.org/tomcat/connectors-doc/config/workers.html 
# In Unix, we use forward slashes:
ps=# list the workers by nameworker.list=tomcat1, tomcat2, loadbalancer# ------------------------
# First tomcat server
# ------------------------
worker.tomcat1.port=8009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13# Specify the size of the open connection cache.
#worker.tomcat1.cachesize#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.tomcat1.lbfactor=900# ------------------------
# Second tomcat server
# ------------------------
worker.tomcat1.port=8009
worker.tomcat1.host=202.88.8.101
worker.tomcat1.type=ajp13# Specify the size of the open connection cache.
#worker.tomcat1.cachesize#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.tomcat1.lbfactor=2000# ------------------------
# Load Balancer worker
# ------------------------#
# The loadbalancer (type lb) worker performs weighted round-robin
# load balancing with sticky sessions.
# Note:
# ----> If a worker dies, the load balancer will check its state
# once in a while. Until then all work is redirected to peer
# worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat1,tomcat2#
# END workers.properties
#Tomcat1配置:
<!--配置server.xml
去掉8080端口,即注释掉如下代码:-->
<Connector 
port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000" 
disableUploadTimeout="true" /><!--配置8009端口如下:-->
<Connector port="8009" 
maxThreads="500" minSpareThreads="400" maxSpareThreads="450"
enableLookups="false" redirectPort="8443" debug="0"
protocol="AJP/1.3" />
<!--配置引擎--> 
<Engine name="Catalina" defaultHost="localhost" debug="0" jvmRoute="tomcat1">启动内存配置,开发configure tomcat程序即可配置:
Initial memory pool: 200 M
Maxinum memory pool:300M
Tomcat2配置:
配置和tomcat1差不多,需要改动的地方如下:
<!--配置引擎--> 
<Engine name="Catalina" defaultHost="localhost" debug="0" jvmRoute="tomcat2">启动内存配置,开发configure tomcat程序即可配置:
Initial memory pool: 512 M
Maxinum memory pool:768M
Mysql配置:
Server类型:Dedicated MySQL Server Machine 
Database usage:Transational Database Only
并发连接数量:Online Transaction Processing(OLTP)
字符集:UTF8
看看对你有没有帮助