ablog

不器用で落着きのない技術者のメモ

Presto の JVM の起動オプションは /etc/presto/conf/jvm.config で設定できる

Presto の JVM の起動オプションを指定したい場合は /etc/presto/conf/jvm.config で設定して、Presto を再起動すればよい。

  • /etc/presto/conf/jvm.config を編集する。
$ vi /etc/presto/conf/jvm.config 
-verbose:class
-server
-Xmx214026810294
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+ExplicitGCInvokesConcurrent
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p
-XX:ReservedCodeCacheSize=150M
-Xbootclasspath/p:
-Djava.library.path=/usr/lib/hadoop/lib/native/:/usr/lib/hadoop-lzo/lib/native/:/usr/lib/
-XX:+PrintAdaptiveSizePolicy
-XX:+PrintJNIGCStalls
-XX:+PrintReferenceGC
-XX:+PrintGCCause
-XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails
-XX:+PrintGCApplicationConcurrentTime
-XX:+PrintGCApplicationStoppedTime
-Xloggc:/var/log/presto/garbage-collection.log
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=4
-XX:GCLogFileSize=4M
-XX:+PreserveFramePointer ★追記
  • Presto を再起動する。
$ sudo stop presto-server
presto-server stop/waiting
$ sudo start presto-server
presto-server start/running, process 13583
  • 追記した XX:+PreserveFramePointer が起動オプションについていることを確認する。
$ ps -lef|grep PreserveFramePointer
0 S presto★   13581     1 64  80   0 - 59017507 -   00:08 ?        00:00:29 java -cp /usr/lib/presto/lib/* -verbose:class -server -Xmx214026810294 -XX:+UseG1GC -XX:G1HeapRegionSize=32M -XX:+ExplicitGCInvokesConcurrent -XX:+AggressiveOpts -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError=kill -9 %p -XX:ReservedCodeCacheSize=150M -Xbootclasspath/p: -Djava.library.path=/usr/lib/hadoop/lib/native/:/usr/lib/hadoop-lzo/lib/native/:/usr/lib/ -XX:+PrintAdaptiveSizePolicy -XX:+PrintJNIGCStalls -XX:+PrintReferenceGC -XX:+PrintGCCause -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -Xloggc:/var/log/presto/garbage-collection.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=4 -XX:GCLogFileSize=4M -XX:+PreserveFramePointer★ -Dlog.enable-console=false -Dlog.output-file=/mnt/var/log/presto/server.log -Dcatalog.config-dir=/etc/presto/conf/catalog -Dnode.data-dir=/var/lib/presto/data -Dnode.id=i-0f196ca0a2231b8d0 -Dnode.environment=production -Dlog.levels-file=/etc/presto/conf.dist/log.properties -Dplugin.dir=/usr/lib/presto/plugin -Dconfig=/etc/presto/conf.dist/config.properties com.facebook.presto.server.PrestoServer

参考

JVM Config
The JVM config file, /etc/presto/jvm.config, contains a list of command line options used for launching the Java Virtual Machine. The format of the file is a list of options, one per line. These options are not interpreted by the shell, so options containing spaces or other special characters should not be quoted (as demonstrated by the OnOutOfMemoryError option in the example below).

The following provides a good starting point for creating jvm.config:

-server
-Xmx16G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p

Because an OutOfMemoryError will typically leave the JVM in an inconsistent state, we write a heap dump (for debugging) and forcibly terminate the process when this occurs.

9.1. Configuring Presto — Presto 0.141t Documentation