在前一篇文章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