Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default worker childopts: GC logging, IPv4, -server; fixes #492 #632

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion conf/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ supervisor.heartbeat.frequency.secs: 5
supervisor.enable: true

### worker.* configs are for task workers
worker.childopts: "-Xmx768m"
worker.childopts: >-
-Xmx768m
-server -Djava.net.preferIPv4Stack=true
-Xloggc:%STORMHOME%/logs/gc-worker-%ID%.log -verbose:gc
-XX:GCLogFileSize=100k
-XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCTimeStamps -XX:+PrintClassHistogram
-XX:+PrintTenuringDistribution -XX:-PrintGCApplicationStoppedTime
worker.heartbeat.frequency.secs: 1

task.heartbeat.frequency.secs: 3
Expand Down
34 changes: 34 additions & 0 deletions conf/storm.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,37 @@
# parallelism.hint: 1
# argument:
# - endpoint: "metrics-collector.mycompany.org"

#
# Baseline JVM options: enables GC logging to storm.home/logs
#
worker.childopts: >-
-Xmx768m
-server -Djava.net.preferIPv4Stack=true
-Xloggc:%STORMHOME%/logs/gc-worker-%ID%.log -verbose:gc
-XX:GCLogFileSize=100k
-XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCTimeStamps -XX:+PrintClassHistogram
-XX:+PrintTenuringDistribution -XX:-PrintGCApplicationStoppedTime
#
# # Production JVM options: verbose GC logging with rotation, expands heap size
# # to 2.5GB and new-gen to 1GB, uses concurrent-mark-and-sweep for old-gen
#
# worker.childopts: >-
# -server -XX:+AggressiveOpts -XX:+UseCompressedOops -Djava.net.preferIPv4Stack=true
# -Xmx2500m -Xms2500m -Xss256k -XX:MaxPermSize=128m -XX:PermSize=96m
# -XX:NewSize=1000m -XX:MaxNewSize=1000m -XX:MaxTenuringThreshold=1 -XX:SurvivorRatio=6
# -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled
# -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly
# -Xloggc:%STORMHOME%/logs/gc-worker-%ID%.log -verbose:gc
# -XX:GCLogFileSize=1m -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10
# -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCTimeStamps -XX:+PrintClassHistogram
# -XX:+PrintTenuringDistribution -XX:-PrintGCApplicationStoppedTime

## Ports for child worker processes; sets the number of workers on this machine.
## Typically, run one worker for each topology this machine will host
# supervisor.slots.ports:
# - 6700
# - 6701
# - 6702
# - 6703

6 changes: 3 additions & 3 deletions storm-core/src/clj/backtype/storm/daemon/supervisor.clj
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@
stormjar (supervisor-stormjar-path stormroot)
storm-conf (read-supervisor-storm-conf conf storm-id)
classpath (add-to-classpath (current-classpath) [stormjar])
childopts (.replaceAll (str (conf WORKER-CHILDOPTS) " " (storm-conf TOPOLOGY-WORKER-CHILDOPTS))
"%ID%"
(str port))
childopts (.replaceAll (.replaceAll
(str (conf WORKER-CHILDOPTS) " " (storm-conf TOPOLOGY-WORKER-CHILDOPTS))
"%ID%" (str port)) "%STORMHOME%" (str storm-home))
logfilename (str "worker-" port ".log")
command (str "java -server " childopts
" -Djava.library.path=" (conf JAVA-LIBRARY-PATH)
Expand Down
2 changes: 1 addition & 1 deletion storm-core/src/jvm/backtype/storm/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public class Config extends HashMap<String, Object> {

/**
* The jvm opts provided to workers launched by this supervisor. All "%ID%" substrings are replaced
* with an identifier for this worker.
* with an identifier for this worker, and %STORMHOME% with the storm.home property.
*/
public static final String WORKER_CHILDOPTS = "worker.childopts";
public static final Object WORKER_CHILDOPTS_SCHEMA = String.class;
Expand Down