Skip to content

Commit

Permalink
Fix performance issue caused by invalid logging configuration (apache…
Browse files Browse the repository at this point in the history
…#8908)

### Motivation

Profiling a 3 node Pulsar cluster running with 2.7.0 version showed allocation hotspots in `log.debug` methods. This indicated that the root logger level was set to debug.

### Modifications

- Configure the root log level in `bin/pulsar` startup script to
  use `info` level by default. This can be done by setting
  the `pulsar.log.root.level` system property.

- since the root log level was debug, all code blocks within
  `log.isDebugEnabled()` got executed.
  This caused a lot of unnecessary memory allocations and wasted CPU cycles.
  • Loading branch information
lhotari authored Dec 11, 2020
1 parent 6a7ec2e commit 18f539e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bin/pulsar
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ PULSAR_ROUTING_APPENDER_DEFAULT=${PULSAR_ROUTING_APPENDER_DEFAULT:-"Console"}
OPTS="$OPTS -Dpulsar.log.appender=$PULSAR_LOG_APPENDER"
OPTS="$OPTS -Dpulsar.log.dir=$PULSAR_LOG_DIR"
OPTS="$OPTS -Dpulsar.log.level=$PULSAR_LOG_LEVEL"
OPTS="$OPTS -Dpulsar.log.root.level=$PULSAR_LOG_ROOT_LEVEL"
OPTS="$OPTS -Dpulsar.routing.appender.default=$PULSAR_ROUTING_APPENDER_DEFAULT"

# Functions related logging
Expand Down

0 comments on commit 18f539e

Please sign in to comment.