On Mar 14, 9:12 pm, Josh Pieper <[email protected]> wrote: > We experienced a similar slowdown in the blog plugin, getting > progressively worse as more posts were added. Our site has around > 1,100 posts now, and any of the blog pages was taking upwards of 10s > to load. > > With a little debugging, I discovered that the blog plugin was > checking the permissions of every single post ever for every page load > to display the statistics in the right hand column. While we have > permissions associated with some aspects of our trac instance, namely > wiki pages and subversion directories, we have no permissions at all > set on the blog, so this checking is unnecessary in our case. Looking > through the source, it appeared that if authorization was used at all, > then it was forced to be checked for every entry and there was no way > to configure around it. I hacked around this for our installation > with the following patch (to a possibly ancient r5676 of the blog > plugin). With the patch, loads of blog pages are back to sub second. > > Is there a recommended way to use the blog plugin with large numbers > of posts and permissions (or a more appropriate place to ask the > question?).
2 things spring to mind: 1) Update to latest version of FullBlogPlugin from trac-hacks.org svn repos. I've added some new database indexes since r5676, so I would hope that you should see some improvement even without your patch. Would be nice to know if that worked actually - could you update and report back on general performance? 2) Your patch I cannot use, obviously. The plugin needs to respect whatever permissions exists for any post, even permissions handled through permission policy plugins that are not obviously visible. What you could do, however, is implement your patch as a permission plugin and insert it first into your [trac] permission_policies = ... (list) - that way your plugin gets evaluated first and if it it just contains this one line then the permission-checking round-trip should be really low overhead and would mean you can avoid patching the plugin source:: if action == 'BLOG_VIEW': return True Thanks for your input on performance, and I'd be happy to help adjust what can be reasonably done to handle high volume and activity. Particularly some sort of caching of the sidebar content would be useful. :::simon https://www.coderesort.com http://www.ohloh.net/accounts/osimons -- You received this message because you are subscribed to the Google Groups "Trac Users" group. 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.
