调整后的方案:

  操作系统Windows2003server版本

  JDK1.4

  Tomcat5.0.30

  数据库连接池C3P0

  仅采用负载平衡,不采用集群。

  软件的配置:

  Apache配置:主要配置httpd.conf和新增加的文件workers.properties

  Httpd.conf:

  #一个连接的大请求数量

  MaxKeepAliveRequests10000

  #NT环境,只能配置这个参数来提供性能

  <IfModulempm_winnt.c>

  #每个进程的线程数,大1920。NT只启动父子两个进程,不能设置启动多个进程

  ThreadsPerChild1900

  每个子进程能够处理的大请求数

  MaxRequestsPerChild10000

  </IfModule>

#加载mod_jk
#
LoadModulejk_modulemodules/mod_jk.so
#
#配置mod_jk
#
JkWorkersFileconf/workers.properties
JkLogFilelogs/mod_jk.log
JkLogLevelinfo
#请求分发,对jsp文件,.do等动态请求交由tomcat处理
DocumentRoot"C:/Apache/htdocs"
JkMount/*.jsploadbalancer
JkMount/*.doloadbalancer
JkMount/servlet/*loadbalancer
#关掉主机Lookup,如果为on,很影响性能,可以有10多秒钟的延迟。
HostnameLookupsOff
#缓存配置
LoadModulecache_modulemodules/mod_cache.so
LoadModuledisk_cache_modulemodules/mod_disk_cache.so
LoadModulemem_cache_modulemodules/mod_mem_cache.so

<IfModulemod_cache.c>
CacheForceCompletion100
CacheDefaultExpire3600
CacheMaxExpire86400
CacheLastModifiedFactor0.1

<IfModulemod_disk_cache.c>
CacheEnabledisk/
CacheRootc:/cacheroot
CacheSize327680
CacheDirLength4
CacheDirLevels5
CacheGcInterval4
</IfModule>
<IfModulemod_mem_cache.c>
CacheEnablemem/
MCacheSize8192
MCacheMaxObjectCount10000
MCacheMinObjectSize1
MCacheMaxObjectSize51200
</IfModule>
</IfModule>
worker.Properties文件
#
#workers.properties,可以参考
::URL::http://jakarta.apache.org/tomcat/connectors-doc/config/workers.html
#InUnix,weuseforwardslashes:
ps="

#listtheworkersbyname

worker.list=tomcat1,tomcat2,loadbalancer

#------------------------
#Firsttomcatserver
#------------------------
worker.tomcat1.port=8009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13

#Specifythesizeoftheopenconnectioncache.
#worker.tomcat1.cachesize

#
#Specifiestheloadbalancefactorwhenusedwith
#aloadbalancingworker.
#Note:
#---->lbfactormustbe>0
#---->Lowlbfactormeanslessworkdonebytheworker.
worker.tomcat1.lbfactor=900

#------------------------
#Secondtomcatserver
#------------------------
worker.tomcat1.port=8009
worker.tomcat1.host=202.88.8.101
worker.tomcat1.type=ajp13

#Specifythesizeoftheopenconnectioncache.
#worker.tomcat1.cachesize

#
#Specifiestheloadbalancefactorwhenusedwith
#aloadbalancingworker.
#Note:
#---->lbfactormustbe>0
#---->Lowlbfactormeanslessworkdonebytheworker.
worker.tomcat1.lbfactor=2000

#------------------------
#LoadBalancerworker
#------------------------

#
#Theloadbalancer(typelb)workerperformsweightedround-robin
#loadbalancingwithstickysessions.
#Note:
#---->Ifaworkerdies,theloadbalancerwillcheckitsstate
#onceinawhile.Untilthenallworkisredirectedtopeer
#worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat1,tomcat2

#
#ENDworkers.properties
#