Chinaunix首页 | 论坛 | 博客
  • 博客访问: 103643920
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: LINUX

2008-04-28 22:02:51

 
文章来源中国实验室收集整理

    #缓存配置

    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

   

    CacheForceCompletion 100

    CacheDefaultExpire 3600

    CacheMaxExpire 86400

    CacheLastModifiedFactor 0.1

   

    CacheEnable disk /

    CacheRoot c:/cacheroot

    CacheSize 327680

    CacheDirLength 4

    CacheDirLevels 5

    CacheGcInterval 4

   

   

    CacheEnable mem /

    MCacheSize 8192

    MCacheMaxObjectCount 10000

    MCacheMinObjectSize 1

    MCacheMaxObjectSize 51200

   

   

    worker. Properties文件

    #

    # workers.properties ,可以参考

   

    # In Unix, we use forward slashes:

    ps=

    # list the workers by name

    worker.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配置:

   

   

    port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

    enableLookups="false" redirectPort="8443" acceptCount="100"

    debug="0" connectionTimeout="20000"

    disableUploadTimeout="true" />

   

   

    maxThreads="500" minSpareThreads="400" maxSpareThreads="450"

    enableLookups="false" redirectPort="8443" debug="0"

    protocol="AJP/1.3" />

   

   

    启动内存配置,开发configure tomcat程序即可配置:

    Initial memory pool: 200 M

    Maxinum memory pool:300M

    Tomcat2配置:

    配置和tomcat1差不多,需要改动的地方如下:

   

   

    启动内存配置,开发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

    数据库连接池的配置:

    我们采用的是spring 框架,配置如下:

   

   

    org.hibernate.dialect.MySQLDialect

    com.mysql.jdbc.Driver

    jdbc:mysql://202.88.1.103/db

    sa

   

    false

    false

    true

    2

    200

    5

    12000

    50

    1

   

   

    其他的没有额外配

阅读(265) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~