[jboss-jira] [JBoss JIRA] (WFCORE-1503) Reading the logging subsystem resource can be slow if several log files exist

James Perkins (JIRA) issues at jboss.org
Thu Apr 28 18:55:00 EDT 2016


    [ https://issues.jboss.org/browse/WFCORE-1503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13198756#comment-13198756 ] 

James Perkins edited comment on WFCORE-1503 at 4/28/16 6:54 PM:
----------------------------------------------------------------

In the {{org.jboss.as.logging.LoggingResource}} the {{log-file}} child is a dynamic resource. When reading the resource it looks like {{Resource.getChildren()}} is invoked then {{Resource.getChild()}} for each child. Because the {{log-file}} resource is dynamic it walks the directory tree looking for log files. This happens for every invocation of {{Resource.getChild()}} or {{Resource.requireChild()}}. This is why the performance is slow. The more files present, including rotated files, the more the tree walking occurs.

Locally testing the performance doesn't seem terrible. However JConsole is slow to load MBeans and the web console is a bit slow when loading the logging subsystem configuration.

One option is to not walk the entire tree and just return the path on a match. Not an ideal approach as it still could be rather slow with many file handlers that have several rotated files.

Another option would be to be less dynamic and register resources when file handlers are added. This is not done elsewhere and there would be issues with adding rotated files after the add operation.


was (Author: jamezp):
In the {{org.jboss.as.logging.LoggingResource}} the {{log-file}} child is a dynamic resource. When reading the resource it looks like {{Resource.getChildren()}} is invoked then {{Resource.getChild()}} for each child. Because the {{log-file}} resource is dynamic it walks the directory tree looking for log files. This happens for every invocation of {{Resource.getChild()}} or {{Resource.requireChild()}}. This is why the performance is slow. The more files present, including rotated files, the more the tree walking occurs.

One option is to not walk the entire tree and just return the path on a match. Not an ideal approach as it still could be rather slow with many file handlers that have several rotated files.

Another option would be to be less dynamic and register resources when file handlers are added. This is not done elsewhere and there would be issues with adding rotated files after the add operation.

> Reading the logging subsystem resource can be slow if several log files exist
> -----------------------------------------------------------------------------
>
>                 Key: WFCORE-1503
>                 URL: https://issues.jboss.org/browse/WFCORE-1503
>             Project: WildFly Core
>          Issue Type: Bug
>          Components: Logging
>            Reporter: James Perkins
>            Assignee: James Perkins
>
> The logging subsystem uses a dynamic resource to list log files as resources. These are the files that are allowed to be read or downloaded and are attached to known file handlers.
> When several file handlers are defined the file tree walker is invoked several times per {{read-resource-operation}}. This may be happening for each stage of an operation. Ideally we could either cache the file listing per-operation or only execute at the runtime stage. This may not be an option for dynamic resources however.
> As a result of this poor performance the web console is very slow to load the logging subsystem configuration. This is not an issue with the web console.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list