
jjp at pobox
Mar 14, 2010, 1:12 PM
Post #3 of 5
(306 views)
Permalink
|
On Sep 24 2009, 6:38 pm, osimons <oddsim...@gmail.com> wrote: > On Sep 24, 12:49 am, Timm Essigke <Timm.Essi...@uni-bayreuth.de> > wrote: > > Dear Trac users, > > > we are happily using trac for our Intranet since a while. Generally > > performance is fine, but theblogmodule is veryslowand we have the > > feeling it is getting slower over time. > > > I narrowed down the problem by some extra debug lines: > > > > ... snipped... > > > > Here is my system information: > > Trac: 0.11.5 > > Python: 2.5.4 (r254:67916, Feb 18 2009, 03:17:34) [GCC 4.3.3] > > setuptools: 0.6c9 > > SQLite: 3.6.17 > > pysqlite: 2.3.2 > > Genshi: 0.6dev-r999 > > mod_python: 3.3.1 > > jQuery: 1.2.6 > > > Thanks in advance! > > > Timm > > Hard to tell really without knowing the exact request you make, what > data you have, db backend, what other plugins and security policies > may be in place, site.html and whatever else may affect page > generation. The anatomy of a request is generally quite simple: find > the module (blog), have module process the request and collect the > data it needs (part of what you debug), and render the template using > the data provided. Intermixed in this is various calls to check > permissions +++. > > I've got some scripts i use to profile requests, so perhaps you can > ping me on #trac IRC channel (I'm 'osimons') and we can try to debug/ > profile your setup and see if anything interesting shows up? [.Resurrecting this old thread, since it seems to fit our symptoms exactly.] 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?). Regards, Josh Pieper --- ../fullblogplugin.orig-20100314/0.11/tracfullblog/web_ui.py 2010-03-14 15:21:10.000000000 -0400 +++ 0.11/tracfullblog/web_ui.py 2010-03-14 15:42:24.000000000 -0400 @@ -350,10 +350,9 @@ data['context'] = Context.from_request(req, absurls=True) return 'fullblog.rss', data, 'application/rss+xml' data['blog_months'], data['blog_authors'], data['blog_categories'], \ data['blog_total'] = \ - blog_core.get_months_authors_categories( - user=req.authname, perm=req.perm) + blog_core.get_months_authors_categories() if 'BLOG_CREATE' in req.perm('blog'): add_ctxtnav(req, 'New Post', href=req.href.blog('create'), title="Create new Blog Post") -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To post to this group, send email to trac-users [at] googlegroups To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
|