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

logback-nacos.xml packagingData=true cause performance issue #12323

Closed
dingjs opened this issue Jul 9, 2024 · 4 comments
Closed

logback-nacos.xml packagingData=true cause performance issue #12323

dingjs opened this issue Jul 9, 2024 · 4 comments
Labels
area/Client Related to Nacos Client SDK kind/bug Category issues or prs related to bug.
Milestone

Comments

@dingjs
Copy link
Contributor

dingjs commented Jul 9, 2024

Describe the bug
logback-nacos.xml packagingData=true 会影响应用本身的logback配置。 packagingData=true有较严重的性能问题,开启的话,会调用loadClass ; 如异常较多,会引发严重的锁竞争,导致系统hung住。
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
at ch.qos.logback.classic.spi.PackagingDataCalculator.loadClass(PackagingDataCalculator.java:204)
at ch.qos.logback.classic.spi.PackagingDataCalculator.bestEffortLoadClass(PackagingDataCalculator.java:228)
at ch.qos.logback.classic.spi.PackagingDataCalculator.computeBySTEP(PackagingDataCalculator.java:135)
at ch.qos.logback.classic.spi.PackagingDataCalculator.populateUncommonFrames(PackagingDataCalculator.java:111)
at ch.qos.logback.classic.spi.PackagingDataCalculator.populateFrames(PackagingDataCalculator.java:104)
at ch.qos.logback.classic.spi.PackagingDataCalculator.calculate(PackagingDataCalculator.java:58)
at ch.qos.logback.classic.spi.ThrowableProxy.calculatePackagingData(ThrowableProxy.java:142)
at ch.qos.logback.classic.spi.LoggingEvent.(LoggingEvent.java:122)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:419)

建议

  1. 配置为false
  2. 引用应用本身自带的logback packagingData配置
@KomachiSion
Copy link
Collaborator

这个是需要在logback的root中设置,还是在appender或logger上设置?

如果是需要在logback的root中设置, 那不应该有nacos来修复, 因为nacos的logback配置只有appender和logger, nacos只会把appender和logger给添加到用户的logback context中,不会独立创建,需要用户在他的logback配置中的打开。

如果是appender或logger上设置, 那么辛苦提交一个pr,进行一下设置。

@dingjs
Copy link
Contributor Author

dingjs commented Jul 15, 2024

这个是需要在logback的root中设置,还是在appender或logger上设置?

如果是需要在logback的root中设置, 那不应该有nacos来修复, 因为nacos的logback配置只有appender和logger, nacos只会把appender和logger给添加到用户的logback context中,不会独立创建,需要用户在他的logback配置中的打开。

如果是appender或logger上设置, 那么辛苦提交一个pr,进行一下设置。

你好,感谢回复,这个需要在 logger-adapter-impl/logback-adapter-12/src/main/resources/nacos-logback12.xml 中修改 <configuration debug="false" scan="false" **packagingData="true"**> , 去掉 **packagingData="true"** 。 目前 packagingData="true" 的配置会”影响“应用系统自己的配置。
我这边明天晚上提交一下PR。

dingjs pushed a commit to dingjs/nacos that referenced this issue Jul 15, 2024
…figuration instead of logback-nacos.xml's packagingData configuration
dingjs added a commit to dingjs/nacos that referenced this issue Jul 16, 2024
… configuration instead of logback-nacos.xml's packagingData configuration
KomachiSion pushed a commit that referenced this issue Jul 18, 2024
…uration instead of logback-nacos.xml's packagingData configuration (#12360)
@KomachiSion KomachiSion added this to the 2.4.0 milestone Jul 18, 2024
@KomachiSion
Copy link
Collaborator

pr中我看没有修改nacos-logback12.xml,是否nacos-logback12.xml中也需要移除?

@dingjs
Copy link
Contributor Author

dingjs commented Jul 18, 2024

pr中我看没有修改nacos-logback12.xml,是否nacos-logback12.xml中也需要移除?

你好,不需要移除了,代码中强制还原为业务方自己的设置了

@KomachiSion KomachiSion added kind/bug Category issues or prs related to bug. area/Client Related to Nacos Client SDK and removed status/need feedback labels Jul 19, 2024
lowezheng added a commit to lowezheng/nacos that referenced this issue Jul 24, 2024
…apexsoft

* commit '197795a854992d3f88824e4cdde34c61d8f56cf4': (225 commits)
  Fix alibaba#12395, use request context replace session depend. (alibaba#12398)
  Revert "Add an id primary key column to both the roles and permissions tables.(mysql-schema.sql) (alibaba#12206)" (alibaba#12396)
  Upgrade to 2.4.0 (alibaba#12384)
  Develop support ram info switch (alibaba#12382)
  Close derby ops api default. (alibaba#12372)
  Upgrade grpc to 1.64.2 (alibaba#12369)
  fix(alibaba#12333): fixed auth Plugin resource parser can't parser v2 config openAPI namespaceId. (alibaba#12336)
  Adjust integration tests for common modules in the core module to comply with checkstyle. (alibaba#12349)
  [IT]Adjust integration tests for cluster,code,smoke modules in the core module to comply with checkstyle. (alibaba#12350)
  fix [ISSUE alibaba#12323] , using the project's logback packagingData configuration instead of logback-nacos.xml's packagingData configuration (alibaba#12360)
  Remove the accessToken from the URL. (alibaba#12353)
  feat(alibaba#12355): Record the cost of ConfigDump in Prometheus. (alibaba#12356)
  [IT]Adjust core module auth integration tests to meet checkstyle requirements. (alibaba#12368)
  [ISSUE alibaba#12282]Fix the issue where monitoring data cannot be found through the IP dimension in the ListeningQuery (alibaba#12315)
  Adjust integration tests for ability, base, and client modules in the core module to comply with checkstyle. (alibaba#12335)
  Develop refactor request context (alibaba#12331)
  fix unexpect exception from NetworkInterface.ifUp (alibaba#12325)
  fix(alibaba#12231): When inserting and updating configurations in the database, the time-related field values need to be set using the time obtained from the database's built-in time function. (alibaba#12244)
  add some UT for default auth plugin (alibaba#12318)
  [ISSUE alibaba#12219] 修复nacos-client中config的ServerListManager解析endpoint失败问题 (alibaba#12220)
  ...

# Conflicts:
#	plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/ExternalPermissionPersistServiceImpl.java
#	pom.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/Client Related to Nacos Client SDK kind/bug Category issues or prs related to bug.
Projects
None yet
Development

No branches or pull requests

2 participants