Skip to content

Commit

Permalink
WIZZIE-3450 Set tuning variables as env vars (#37)
Browse files Browse the repository at this point in the history
* Update metrics library to avoid memory leak

* WIZZIE-3450 Set tuning variables as env vars
  • Loading branch information
pablocasares authored and andresgomezfrr committed Jan 28, 2019
1 parent f9b611b commit e3800e7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions bin/enricher-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ do
CLASSPATH=${CLASSPATH}:${file}
done

[ -z "$JVM_OPTIONS" ] && JVM_OPTIONS="-Djdk.nio.maxCachedBufferSize=262144 -Xmx30m -Xms30m -XX:MaxDirectMemorySize=15m -XX:MaxMetaspaceSize=30m -XX:SurvivorRatio=6 -Xss512k -XX:ReservedCodeCacheSize=15m -XX:NewSize=15m"

exec java ${JVM_OPTIONS} -cp ${CLASSPATH} io.wizzie.enricher.Enricher $1
13 changes: 12 additions & 1 deletion docker/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,18 @@ ENV METRIC_ENABLE=true \
BOOTSTRAP_KAFKA_TOPICS=[\"__enricher_bootstrap\"] \
LOG_LEVEL=info \
GENERAL_LOG_LEVEL=info \
JVM_OPTIONS="-Xmx512m -Xms512m"
JVM_OPTIONS="-Djdk.nio.maxCachedBufferSize=262144 -Xmx30m -Xms30m -XX:MaxDirectMemorySize=15m -XX:MaxMetaspaceSize=30m -XX:SurvivorRatio=6 -Xss512k -XX:ReservedCodeCacheSize=15m -XX:NewSize=15m " \
MALLOC_ARENA_MAX=1 \
PRODUCER_BUFFER_MEMORY=102400 \
CONSUMER_FETCH_MAX_BYTES=102400 \
CONSUMER_MAX_POLL_RECORDS=50 \
CONSUMER_FETCH_MAX_WAIT_MS=500 \
CONSUMER_SEND_BUFFER_BYTES=131072 \
CONSUMER_RECEIVE_BUFFER_BYTES=65536 \
PRODUCER_SEND_BUFFER_BYTES=131072 \
PRODUCER_RECEIVE_BUFFER_BYTES=32768 \
BUFFERED_RECORDS_PER_PARTITION=500


CMD exec /bin/enricher-start.sh

Expand Down
11 changes: 10 additions & 1 deletion docker/build/config_env.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,14 @@
"max.output.kafka.topics": ${MAX_OUTPUT_KAFKA_TOPICS},
"bootstrap.kafka.topics": ${BOOTSTRAP_KAFKA_TOPICS},
"global.topics": ${GLOBAL_TOPICS},
"bypass.null.keys": ${BYPASS_NULL_KEYS}
"bypass.null.keys": ${BYPASS_NULL_KEYS},
"producer.buffer.memory": ${PRODUCER_BUFFER_MEMORY},
"consumer.fetch.max.bytes": ${CONSUMER_FETCH_MAX_BYTES},
"consumer.max.poll.records": ${CONSUMER_MAX_POLL_RECORDS},
"consumer.fetch.max.wait.ms": ${CONSUMER_FETCH_MAX_WAIT_MS},
"consumer.send.buffer.bytes": ${CONSUMER_SEND_BUFFER_BYTES},
"consumer.receive.buffer.bytes": ${CONSUMER_RECEIVE_BUFFER_BYTES},
"producer.send.buffer.bytes": ${PRODUCER_SEND_BUFFER_BYTES},
"producer.receive.buffer.bytes": ${PRODUCER_RECEIVE_BUFFER_BYTES},
"buffered.records.per.partition": ${BUFFERED_RECORDS_PER_PARTITION}
}

0 comments on commit e3800e7

Please sign in to comment.