You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2020/12/21 12:48:25 UTC
[pulsar] branch branch-2.7 updated: Fix performance issue caused by
invalid logging configuration (#8908)
This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-2.7 by this push:
new 1a726db Fix performance issue caused by invalid logging configuration (#8908)
1a726db is described below
commit 1a726dbb28fbbf976a07d1f735b659f40cbdfb8d
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Fri Dec 11 20:10:10 2020 +0200
Fix performance issue caused by invalid logging configuration (#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.
(cherry picked from commit 18f539ea91d5c396bf8b7d5ca18ecf8956004892)
---
bin/pulsar | 1 +
1 file changed, 1 insertion(+)
diff --git a/bin/pulsar b/bin/pulsar
index 0c20c8d..28f2f9d 100755
--- a/bin/pulsar
+++ b/bin/pulsar
@@ -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