让kettle的执行速度飞起来

在前一篇文章xms/xmx/xss在kette中的调优设置中,我对kettle进行了一次优化,此次咱们再一次进行优化,此次效果很是明显,此次优化有两部分:1、修改jvm添加xmn,2、修改日志输出级别java

在Java TM Performance一书中,有这样一段话:数据库

-Xmn is convenient to size both the initial and maximum size of the young generation
space. It is important to note that if-Xms and -Xmx are not set to the same value and
-Xmn is used, a growth or contraction in the Java heap size will not adjust the size of
the young generation space. The size of the young generation space will remain constant with any growth or contraction of the Java heap size. Therefore, -Xmn should
be used only when -Xms and -Xmx are set to the same value.

好了,看看个人修改结果jvm

# ******************************************************************
# ** Set java runtime options                                     **
# ** Change 512m to higher values in case you run out of memory   **
# ** or set the PENTAHO_DI_JAVA_OPTIONS environment variable      **
# ** (JAVAMAXMEM is there for compatibility reasons)              **
# ******************************************************************

if [ -z "$JAVAMAXMEM" ]; then
  JAVAMAXMEM="16384"
fi

if [ -z "$PENTAHO_DI_JAVA_OPTIONS" ]; then
    PENTAHO_DI_JAVA_OPTIONS="-Xms${JAVAMAXMEM}m -Xmx${JAVAMAXMEM}m -Xmn6144m -Xss1024m"
fi

xmx为物理内存的1/4,xmn为xmx为3/8xss

在用kitchen.sh调用*.job文件时,在调用命令后面添加
优化

-level:Error

在默认的状况下,kettle输出的是基本日志,若是访问十几万的数据库,那基本日志的输出也会达到五、6百兆,这样严重影响了执行效率,因此修改kettle的日志级别为error级,只输出错误日志便可。spa

以上优化完成后,遍历十几万数据库进行数据统计,只须要2小时55分钟,爽啊,快吧,若是硬件足够好,那还能够再提升很多呢!.net

相关文章
相关标签/搜索