Skip to content

Latest commit

 

History

History
174 lines (136 loc) · 7.01 KB

1.04_wrapper.conf.md

File metadata and controls

174 lines (136 loc) · 7.01 KB

1.4 Wrapper.conf配置概述

在Dble中选择wrapper作为管理dble进程的工具,其大概配置都属于固定的部分,只有其中的JVM参数是用户可以和需要通过修改来达成配置目的的 JVM参数都统一配置在以下的部分配置模块中,additional之后的标号可以根据现实情况进行添

wrapper.java.additional.1=-DDBLE_HOME=.
wrapper.java.additional.2=-server
wrapper.java.additional.3=-XX:+AggressiveOpts
wrapper.java.additional.4=-Dfile.encoding=UTF-8
wrapper.java.additional.5=-Dcom.sun.management.jmxremote
wrapper.java.additional.6=-Dcom.sun.management.jmxremote.port=1984
wrapper.java.additional.7=-Dcom.sun.management.jmxremote.authenticate=false
wrapper.java.additional.8=-Dcom.sun.management.jmxremote.ssl=false
wrapper.java.additional.9=-Dcom.sun.management.jmxremote.host=127.0.0.1
wrapper.java.additional.10=-Xmx4G
wrapper.java.additional.11=-Xms1G
wrapper.java.additional.12=-XX:MaxDirectMemorySize=2G
wrapper.java.additional.13=-XX:+PrintHeapAtGC
wrapper.java.additional.14=-XX:+PrintGCDateStamps
wrapper.java.additional.15=-Xloggc:./logs/gc_%t_%p.log
wrapper.java.additional.16=-XX:+PrintGCTimeStamps
wrapper.java.additional.17=-XX:+PrintGCDetails
wrapper.java.additional.18=-XX:+HeapDumpOnOutOfMemoryError
wrapper.java.additional.19=-XX:HeapDumpPath=./logs/

大部分以上的配置都没有特殊的意义,仅仅是一般的JVM配置,关于JVM调优的部分需要以现实情况进行操作,在此仅介绍几个特殊情况

  1. MaxDirectMemorySize需要根据机器的情况进行提前适配,不然会导致服务无法正常启动 具体的细节为需要大于bufferPoolPageNumber*bufferPoolPageSize,这两个选项在server.xml中配置

    bufferPoolPageNumber 的默认配置是20 × 机器CPU线程数(注意这里I5和I7的CPU可能会返回不同的结果)

    bufferPoolPageSize 的默认配置是 4 × 512 ×1024

    以下为建议值:
    dble总内存=0.6 * 可用物理内存(刨除操作系统,驱动等的占用)
    Xmx = 0.4 * dble总内存
    MaxDirectMemorySize = 0.6 * dble总内存

    另外,在1.3_server.xml中的bufferPoolPageNumber 和bufferPoolPageSize 受MaxDirectMemorySize影响。
    建议 和bufferPoolPageSize设置为2M,bufferPoolPageNumber 设置为 取整(MaxDirectMemorySize * 0.8 /bufferPoolPageSize)

  2. 为了调试方便在debug模式下存在三个可用的XA事务调试JVM参数

    -DPREPARE_DELAY=10

    -DCOMMIT_DELAY=10

    -DROLLBACK_DELAY = 10

    单位分别是秒,当且仅当DEBUG模式下,在XA事务发生三段提交或者回滚之前会发生延迟,单位为秒

    注:大部分情况下这个参数用以进行测试和本地调试

1.4.1 配置实例

#********************************************************************
# Wrapper Properties
#********************************************************************wrapper.java.mainclas
# Java Application
wrapper.java.command=java
wrapper.working.dir=..

# Java Main class.  This class must implement the WrapperListener interface
#  or guarantee that the WrapperManager class is initialized.  Helper
#  classes are provided to do this for you.  See the Integration section
#  of the documentation for details.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
set.default.REPO_DIR=lib
set.APP_BASE=.

# Java Classpath (include wrapper.jar)  Add class path elements as
#  needed starting from 1
wrapper.java.classpath.1=lib/wrapper.jar
wrapper.java.classpath.2=conf
wrapper.java.classpath.3=%REPO_DIR%/*

# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=lib

# Java Additional Parameters
#wrapper.java.additional.1=
wrapper.java.additional.1=-DDBLE_HOME=.
wrapper.java.additional.2=-agentlib:jdwp=transport=dt_socket,server=y,address=8088,suspend=n
wrapper.java.additional.3=-server
wrapper.java.additional.4=-XX:MaxPermSize=64M
wrapper.java.additional.5=-XX:+AggressiveOpts
wrapper.java.additional.6=-Dfile.encoding=UTF-8
wrapper.java.additional.7=-Dcom.sun.management.jmxremote
wrapper.java.additional.8=-Dcom.sun.management.jmxremote.port=1984
wrapper.java.additional.9=-Dcom.sun.management.jmxremote.authenticate=false
wrapper.java.additional.10=-Dcom.sun.management.jmxremote.ssl=false
wrapper.java.additional.11=-Dcom.sun.management.jmxremote.host=127.0.0.1
wrapper.java.additional.12=-Xmx4G
wrapper.java.additional.13=-Xms1G
wrapper.java.additional.14=-XX:MaxDirectMemorySize=2G

# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=3

# Maximum Java Heap Size (in MB)
#wrapper.java.maxmemory=64

# Application parameters.  Add parameters as needed starting from 1
wrapper.app.parameter.1=DbleStartup
wrapper.app.parameter.2=start

#********************************************************************
# Wrapper Logging Properties
#********************************************************************
# Format of output for the console.  (See docs for formats)
wrapper.console.format=PM

# Log Level for console output.  (See docs for log levels)
wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.
wrapper.logfile=logs/wrapper.log

# Format of output for the log file.  (See docs for formats)
wrapper.logfile.format=LPTM

# Log Level for log file output.  (See docs for log levels)
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
#  the log is rolled. Size is specified in bytes.  The default value
#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=0

# Maximum number of rolled log files which will be allowed before old
#  files are deleted.  The default value of 0 implies no limit.
wrapper.logfile.maxfiles=0

# Log Level for sys/event log output.  (See docs for log levels)
wrapper.syslog.loglevel=NONE

#********************************************************************
# Wrapper Windows Properties
#********************************************************************
# Title to use when running as a console
wrapper.console.title=Dble-server

#********************************************************************
# Wrapper Windows NT/2000/XP Service Properties
#********************************************************************
# WARNING - Do not modify any of these properties when an application
#  using this configuration file has been installed as a service.
#  Please uninstall the service before modifying this section.  The
#  service can then be reinstalled.

# Name of the service
wrapper.ntservice.name=dble

# Display name of the service
wrapper.ntservice.displayname=Dble-server

# Description of the service
wrapper.ntservice.description=The project of Dble-server

# Service dependencies.  Add dependencies as needed starting from 1
wrapper.ntservice.dependency.1=

# Mode in which the service is installed.  AUTO_START or DEMAND_START
wrapper.ntservice.starttype=AUTO_START

# Allow the service to interact with the desktop.
wrapper.ntservice.interactive=false

wrapper.ping.timeout=120
configuration.directory.in.classpath.first=conf