Edgewall Software

Changes between Version 13 and Version 14 of TracPerformance


Ignore:
Timestamp:
Jan 3, 2015, 4:21:24 PM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • TracPerformance

    v13 v14  
    11= Trac and Performance =
    22
    3 In the past, Trac garnered a reputation of being a fast web application.
    4 This was mainly due to its use of the ClearSilver template engine.
    5 Starting with version 0.11, Trac migrated to Genshi, another template engine, much more flexible and powerful in many ways, but also much slower and memory hungry. As the memory usage seems now mostly OK (#6614), there are still many concerns over the performance.
     3With Trac 0.11, the ClearSilver template engine was replaced with the Genshi template engine, but with its increased flexibility, Trac also became slower and memory hungry. As memory usage seems now mostly OK (#6614), there are still many concerns over Trac's performance.
    64
    7 However Genshi is not the only reason for the perceived slowdown, there are several other factors which have to be taken into account when analyzing performance:
     5However, apart from Genshi, there are several other factors to be taken into account when analyzing performance:
    86 - the increased usage of plugins, each of them can add to the load in subtle ways
    97 - the new security model of TracFineGrainedPermissions
    108 - the conditions in which Trac is run (web front-end)
    11  - the specific configuration settings of Trac used
     9 - the specific configuration settings of Trac
    1210 - various bugs that might be triggered by any of the above!
    1311
    14 In this page we'll try to collect all the various pieces of information related to performance, in order to compile a "checklist" that can be followed when trying to troubleshoot a performance problem, or simply when one wants to get a better performance out of his Trac installation.
     12This page collects Trac performance issues, solutions and troubleshooting.
    1513
    1614== Check your installation == #Installation
    1715
    18 If Trac is not installed correctly, performance will suffer.
    19 
    20 The most obvious wrong thing to do here is installing Trac as a CGI script.
    21 Even for testing, there are better alternatives ([TracStandalone tracd]).
     16If Trac is not installed correctly, performance will suffer. The most obvious mistake is installing Trac as a CGI script. Even for testing, there are better alternatives, see [TracStandalone tracd].
    2217
    2318The second main installation mistake relative to performance would be to serve static resources through Trac.
    24 For best performance, they're better served by a web server, see TracCgi#MappingStaticResources
     19For best performance, Trac pages are better served by a web server, see TracCgi#MappingStaticResources.
    2520 ''(Note: we should probably move the ''mapping static resources'' section to another page, e.g. [wiki:TracModWSGI])''
    2621
    2722Other points worth checking:
    28  - if using mod_python, only use latest version (3.3.1); prefer mod_wsgi (>= 2.4) (daemon mode)
    29  - running Trac under QEMU is slow (ticket:7490#comment:42)
     23 - if using mod_python, only use latest version (3.3.1); prefer mod_wsgi (>= 2.4), ie daemon mode
     24 - running Trac under the QEMU virtualizer is slow (ticket:7490#comment:42)
    3025 - in Apache, there's a possible issue when using mod_deflate (#8534, googlegroups:trac-users:ab070d251f5a0d11); on the other hand, some people have good results with mod_deflate and advise using it (["TracDev/Performance/0.11.5#HowItimed"])
    31  - some 3^rd^ party packages, such as Pygments could also be responsible for heavy CPU loads (specifically, Pygments 1.0's scala mode, see [http://noehr.org/2009/10/01/yo-pygments-1-0-im-really-happy-for-you-and-imma-let-you-finish-but-pygments-1-1-has-one-of-the-best-releases-of-all-time/ Jespern's blog entry] about this and of course, the obligatory intertrac link: Pygments:#392)
    32  - Make sure an image has been configured as the trac logo (in the top left).  The default install from Ubuntu 10.04 does not include a default logo, this makes pages very slow to load.
     26 - some 3^rd^ party packages, such as Pygments, could also be responsible for heavy CPU loads; specifically, Pygments 1.0's scala mode, see [http://noehr.org/2009/10/01/yo-pygments-1-0-im-really-happy-for-you-and-imma-let-you-finish-but-pygments-1-1-has-one-of-the-best-releases-of-all-time/ Jespern's blog entry] about this and of course, the obligatory intertrac link: Pygments:#392
     27 - ensure an image has been configured as the trac logo in the top left. The default install from Ubuntu 10.04 for example does not include a default logo and this makes pages slow to load.
    3328
    3429== Check your configuration == #Configuration
    3530
    36 Several settings enhance Trac in one way or the other, but have a performance cost, which in some case can be huge.
     31Several settings enhance Trac in one way or the other, but have a performance cost, which in some cases can be large.
    3732
    3833=== `[timeline]` === #timeline-section
    39  - `default_daysback` set to a high value might induce quite some load, depending on the activity.
     34 - `default_daysback` set to a high value might introduce quite some load, depending on the activity.
    4035   Pick an appropriate value for your site.
    41  - the default `max_daysback` can be inappropriate (e.g. allowing 90 days for a site with lots
    42    of activity might be way too much). Don't hesitate to reduce it, especially now that we have paging
    43  - any setting value than `changeset_show_files = 0` can be really expensive,
     36 - the default `max_daysback` can be inappropriate, eg allowing 90 days for a site with lots
     37   of activity might be too much. Don't hesitate to reduce it, especially now that we have paging
     38 - any setting other than `changeset_show_files = 0` can be really expensive,
    4439   depending on the quantity of changesets to process
    4540
    4641=== `[ticket]` === #ticket-section
    47  - use of `restrict_owner = true` can be (very) slow on some installations (see #4245, #8034, #8212 ...)
     42 - use of `restrict_owner = true` can be slow on some installations (see #4245, #8034, #8212 ...)
    4843
    4944== Check your [TracLogging trac.log] == #Log
     
    5146Search for the following:
    5247 - INFO messages: '''Reloading environment due to configuration change''' [[br]]
    53    If you find lots of such lines, or even worse, if they appear systematically, then chances are that you're using a plugin which does systematic updates to the configuration file ([TracIni trac.ini]), and this will in turn trigger a full environment reload at the next request. That can slow down the performance a lot, to the level of TracCgi. See ticket:7490#comment:102 and follow-up.
     48   If you find lots of such lines, or even worse, if they appear systematically, then chances are that you're using a plugin which does systematic updates to the configuration file [TracIni trac.ini], and this will in turn trigger a full environment reload at the next request. That can slow down the performance a lot, to the level of TracCgi. See ticket:7490#comment:102 and follow-up.
    5449 - INFO messages: '''rev ![321] != cached rev ![123]''' (other revision numbers for you, of course) [[br]]
    55    If you find such lines ''and the `cached rev` value doesn't change'', this corresponds to a repository resync failure which results in a resync attempt for every request (see ticket:7490#comment:36); often due to the "prohibited" MySQL/MyISAM combination (#8067)
     50   If you find such lines ''and the `cached rev` value doesn't change'', this corresponds to a repository resync failure, which results in a resync attempt for every request (see ticket:7490#comment:36); often as a result of the "prohibited" MySQL/MyISAM combination (#8067).
    5651 - WARNING message: '''Slow mail submission''' [[br]]
    57    A mis-configured or simply slow mail server make Trac appear very slow (#3220 and numerous others)
     52   A mis-configured or simply slow mail server make Trac appear very slow (#3220 and numerous others).
    5853
    5954== Unsorted ==
    6055 
    61  - there was a bug up to 0.11.4 which could cause 100% cpu usage once in a while on some platforms (#7785, thought to be fixed in 0.11.5, but re-opened since)
    62  - some plugins seem to have a high impact on the performance (read ["TracDev/Performance/0.11.5#customizationsandplugins"])
     56 - There was a bug up to 0.11.4 which could cause 100% CPU usage once in a while on some platforms (#7785, thought to be fixed in 0.11.5, but re-opened since).
     57 - Some plugins seem to have a high impact on the performance, see ["TracDev/Performance/0.11.5#customizationsandplugins"].
    6358
    6459== Profiling a Trac request ==