[same trac instance, just one more guy trying to look at it ;)]

Enabling the DEBUG logs gets (user names and hex ids obfuscated):

2012-10-07 16:06:38,306 Trac[ticket_policy] DEBUG: Internal: 
action:REPORT_VIEW, user:numo, resource:None, perm: 
<trac.perm.PermissionCache object at 0xb98c5e64>
2012-10-07 16:06:38,307 Trac[api] DEBUG: action controllers for ticket 
workflow: ['ConfigurableTicketWorkflow']
2012-10-07 16:06:38,338 Trac[util] DEBUG: SQL: SELECT lut,data FROM 
ad_cache WHERE id='bac217ffdb10bacb882347c28d687877'
2012-10-07 16:06:38,339 Trac[auth] DEBUG: dbcache hit for (CN=tracUsers)
2012-10-07 16:06:38,369 Trac[util] DEBUG: SQL: SELECT lut,data FROM 
ad_cache WHERE id='9c82c9328d629399a432139dde89ea1f'
2012-10-07 16:06:38,371 Trac[auth] DEBUG: dbcache hit for (CN=Xxx Xxx)
2012-10-07 16:06:38,401 Trac[util] DEBUG: SQL: SELECT lut,data FROM 
ad_cache WHERE id='3347dc523b83747adafc632c432c70c8'
2012-10-07 16:06:38,403 Trac[auth] DEBUG: dbcache hit for (CN=Xxy XXy)
...
2012-10-07 16:06:38,881 Trac[auth] DEBUG: userlist: xxx,xxy,xxz,...
2012-10-07 16:06:38,911 Trac[util] DEBUG: SQL: SELECT lut,data FROM 
ad_cache WHERE id='35f8d63214c2e403cefed6fc4100025e'
2012-10-07 16:06:38,912 Trac[auth] DEBUG: dbcache hit for 
(&(objectClass=person)(sAMAccountName=numo))
...
2012-10-07 16:06:39,133 Trac[auth] DEBUG: numo has groups: 
@xxx,@xxy,@tracadmin,@tracusers,@xxz,@xxw
2012-10-07 16:06:39,163 Trac[util] DEBUG: SQL: SELECT generation FROM cache 
WHERE id=%s
2012-10-07 16:06:39,163 Trac[util] DEBUG: args: (1722364385L,)
2012-10-07 16:06:39,164 Trac[util] DEBUG: SQL: SELECT username, action FROM 
permission


The thing is the enumerating of all the users happens at least 5 times for 
the view tickets report and whopping 20(!) times for the timeline.

Trying to identify the cause I got to the timingandestimationplugin where I 
have found the following in ticket_policy.py:

        # Essentially the default trac PermissionStore ignores user provided
        # groups so we have to look them up manually:

        # changed this to only do this for the default permission
        # store this has been reported as broken/very slow for the
        # LDAP permission store
        ps = PermissionSystem(self.env)
        if isinstance(ps.store, DefaultPermissionStore):
            perms = ps.get_all_permissions()

Well... is there any way to cache the result instead of each time 
traversing half of the LDAP? Or a way to only use LDAP only for the login 
and get groups and permissions in some more efficient way?

Thanks
-- 
                                                            Stano

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/trac-users/-/jXA_3fatQpsJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.

Reply via email to