suggested connection pooling for JAAS

32 views
Skip to first unread message

Kamesh Sampath

unread,
Oct 22, 2016, 9:51:39 AM10/22/16
to ldaptive
Hi ,

I am using the ldaptive with connection pooling, sample config:

foousers {
    org.ldaptive.jaas.LdapLoginModule REQUIRED
  ldapUrl="ldap://ldap.example.com:389"
  baseDn="ou=foo,ou=dev,dc=example,dc=com"
  userFilter="(uid={user})"
    useStartTLS="false"
  useSSL="false"
  subtreeSearch="true"
    dnResolver="org.ldaptive.auth.PooledSearchDnResolver"
    authenticationHandler="org.ldaptive.auth.PooledBindAuthenticationHandler"
    cacheId="ldaptive-foouser-pool"
  debug="true";
};

barusers {

  org.ldaptive.jaas.LdapLoginModule REQUIRED
  ldapUrl="ldap://ldap.example.com:389"
  baseDn="ou=bar,ou=dev,dc=example,dc=com"
  userFilter="(uid={user})"
  useStartTLS="false"
  useSSL="false"
  subtreeSearch="true"
  dnResolver="org.ldaptive.auth.PooledSearchDnResolver"
  authenticationHandler="org.ldaptive.auth.PooledBindAuthenticationHandler"
  cacheId="ldaptive-barusers-pool"
  debug="true";

};


questions around this config:

1. Does setting different pools for different configs helps in better performance or its recommended to have one config for all ? 
2. adding the pooling properties(http://www.ldaptive.org/docs/guide/connections/pooling.html) nested in these config will have effect on the overall pooling ?
3.  when adding no pooling parameters, does ldaptive try to validate the connections automatically ? if so what is the default interval 30 mins ? 

Daniel Fisher

unread,
Oct 24, 2016, 10:02:24 PM10/24/16
to ldap...@googlegroups.com
On Sat, Oct 22, 2016 at 9:51 AM Kamesh Sampath <ksam...@redhat.com> wrote:
1. Does setting different pools for different configs helps in better performance or its recommended to have one config for all ? 

The cache holds the entire Authenticator, not just the pool. So you must use different cacheIds for each config and consequently maintain separate pools.
 
2. adding the pooling properties(http://www.ldaptive.org/docs/guide/connections/pooling.html) nested in these config will have effect on the overall pooling ?

Correct. Note that pooling properties will be applied to both the PooledSearchDnResolver and PooledBindAuthentictionHandler.

 
3.  when adding no pooling parameters, does ldaptive try to validate the connections automatically ? if so what is the default interval 30 mins ? 

No, connection validation is not performed by default. See the link you referenced for default values. By default, a single reconnect will occur if the library determines that the connection is dead.

--Daniel Fisher
 

Kamesh Sampath

unread,
Oct 25, 2016, 4:59:38 AM10/25/16
to ldaptive
Thanks @dfisher 


On Tuesday, October 25, 2016 at 7:32:24 AM UTC+5:30, dfisher wrote:
On Sat, Oct 22, 2016 at 9:51 AM Kamesh Sampath <ksam...@redhat.com> wrote:
1. Does setting different pools for different configs helps in better performance or its recommended to have one config for all ? 

The cache holds the entire Authenticator, not just the pool. So you must use different cacheIds for each config and consequently maintain separate pools.
    
     when we configure this via spring beans,  does the authenticator will be automatically added to the pool configured with it ?
Reply all
Reply to author
Forward
0 new messages