[ 
https://issues.apache.org/jira/browse/AMQ-5876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15157002#comment-15157002
 ] 

Torsten Mielke commented on AMQ-5876:
-------------------------------------

Took me quite a bit of debugging to find out, hence summarising it here. 
With this fix, JAAS LoginModules that load property files such as 
PropertiesLoginModule and TextFileCertificateLoginModule will not reload from 
file system by default (not even when file got modified on disk) unless 
reload=true is explicitly configured. 

An example for the standard conf/login.config:

{code}
activemq {
    org.apache.activemq.jaas.PropertiesLoginModule required
        org.apache.activemq.jaas.properties.user="users.properties"
        org.apache.activemq.jaas.properties.group="groups.properties"
        reload=true;
};
{code}


Again, reload=true needs to be present in the login module configuration, 
otherwise these files will only be read at broker startup time. 
This is a change in behavior from 5.11 and earlier where we would always reload 
these files. 




> improve performance of TextFileCertificateLoginModule when many entries are 
> in the "textfiledn.user " file
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-5876
>                 URL: https://issues.apache.org/jira/browse/AMQ-5876
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: jaas, security
>    Affects Versions: 5.11.1
>            Reporter: Gary Tully
>            Assignee: Gary Tully
>              Labels: jaas
>             Fix For: 5.12.0
>
>
> With a large number of entries ( 200,000 ) in the 
> "org.apache.activemq.jaas.textfiledn.user" file the performance seemed to 
> degrade. 
> To demonstrate the performance difference;
> {code}
> 1) for 100 entries and calling initialize,login(),commit 10 times - Time 
> taken is 73 miliseconds
> 2) for 200,000 entries and calling initialize,login(),commit 10 times - Time 
> taken is  5020 miliseconds
> {code}
> Suggested improvements:
> - avoid loading the  org.apache.activemq.jaas.textfiledn.user file each time 
> - in PropertiesLoginModule.java, the file is only read when it changes, using 
> the file modification time.
> - avoid iterating through the Properties object, using a Map instead to 
> retrieve the userName



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to