Edgewall Software

Changes between Version 25 and Version 26 of TracPerformance


Ignore:
Timestamp:
Jun 26, 2022, 12:07:39 PM (6 weeks ago)
Author:
figaro
Comment:

Remove dead link, cosmetic updates

Legend:

Unmodified
Added
Removed
Modified
  • TracPerformance

    v25 v26  
    33= Trac and Performance
    44
    5 This page collects Trac performance issues, solutions and troubleshooting.
     5This page collects Trac performance issues, solutions and troubleshooting. It focuses on settings in Trac only, as opposed to settings related to your database or web server.
    66
    77When dealing with performance degradation on a Trac installation there are some potential causes to consider:
     
    1010 - the conditions in which Trac is run (web front-end)
    1111 - the specific configuration settings of Trac
    12  - various bugs that might be triggered by any of the above
     12 - bugs that might be triggered by any of the above
    1313
    1414== Check your installation #Installation
    1515
    16 If 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].
     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, such as [TracStandalone Tracd].
    1717
    1818The second main installation mistake relative to performance would be to serve static resources through Trac.
     
    3535=== `[timeline]` #timeline-section
    3636
    37  - `default_daysback` set to a high value might introduce quite some load, depending on the activity.
    38    Pick an appropriate value for your site.
    39  - the default `max_daysback` can be inappropriate, eg allowing 90 days for a site with lots
    40    of activity might be too much. Don't hesitate to reduce it, especially now that Trac supports paging
    41  - any setting other than `changeset_show_files = 0` can be expensive, depending on the quantity of changesets to process
     37 - `default_daysback` set to a high value might introduce quite some load, depending on the activity. Pick an appropriate value for your site.
     38 - the default `max_daysback` can be inappropriate, eg allowing 90 days for a site with lots of activity might be too much. Don't hesitate to reduce it, especially now that Trac supports paging.
     39 - any setting other than `changeset_show_files = 0` can be expensive, depending on the quantity of changesets to process.
    4240
    4341=== `[ticket]` #ticket-section
     
    6361
    6462Search for the following:
    65  - INFO messages: '''Reloading environment due to configuration change''' [[br]]
    66    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.
    67  - INFO messages: '''rev ![321] != cached rev ![123]''' (other revision numbers for you, of course) [[br]]
    68    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).
    69  - WARNING message: '''Slow mail submission''' [[br]]
    70    A mis-configured or simply slow mail server make Trac appear very slow (#3220).
     63 - INFO messages: '''Reloading environment due to configuration change''': [[br]]
     64   If you find many 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.
     65 - INFO messages: '''rev ![321] != cached rev ![123]''' (other revision numbers for you, of course:) [[br]]
     66   If you find such lines ''and the `cached rev` value doesn't change'', then 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).
     67 - WARNING message: '''Slow mail submission''': [[br]]
     68   A mis-configured or simply slow mail server makes Trac appear very slow (#3220).
    7169 - Excessive permission checks.
    7270 - Enable `[trac] debug_sql` and check DEBUG messages for excessive SQL queries.
    7371
    7472== Templates
    75  - After the adoption of the [genshi:Genshi] template engine in [/milestone/0.11 Trac 0.11] in 2008, some associated performance issues were solved (#6614).
    76  - In Trac 1.3 the Jinja template engine was adopted and performance is improved over Genshi (#12639).
    77   - Many plugins still use Genshi templates, which are supported for compatibility until Trac 1.5.1.
    78   - Plugins that use the `ITemplateStreamFilter` interface prevent the performance improvements gained by using Jinja.
     73
     74In Trac 1.3 the Jinja template engine was adopted and performance has improved over Genshi (#12639).
     75 - Many plugins still use Genshi templates, which are supported for compatibility until Trac 1.5.1.
     76 - Plugins that use the `ITemplateStreamFilter` interface eliminate the performance improvements gained by Jinja.
    7977
    8078== Database
    8179
    82  - Use PostgreSQL or MySQL in an environment with many users to avoid lock contention.
     80 - Use PostgreSQL or MySQL if your environment has many users; this is to avoid lock contention.
    8381 - Otherwise consider using SQLite with connection string `sqlite:db/trac.db?journal_mode=wal&synchronous=off` if tolerable. (#11967)
    8482
    8583== Unsorted
    8684 
    87  - There was a bug up to 0.11.4 which could cause 100% CPU usage once in a while on some platforms. See #7785, which was thought to be fixed in 0.11.5, but re-opened since.
    88  - Some plugins seem to degrade performance, see ["TracDev/Performance/0.11.5#customizationsandplugins"].
     85 - There was a bug up to Trac 0.11.4 which could cause 100% CPU usage once in a while on some platforms. See #7785, which was thought to be fixed in 0.11.5, but re-opened since.
     86 - Some plugins seem to degrade performance, see ["TracDev/Performance/0.11.5#customizationsandplugins"].
     87 - The more plugins, the higher the potentiality for performance degradation in unpredictable ways: install, test and use plugins in a staggered fashion to better understand since when and how performance has degraded.
    8988 - Trac's [query:status=!closed&keywords=~performance tickets regarding performance].
    90 
    91 == Profiling a Trac request
    92 
    93 I've written a blog post on how I do basic profiling for Trac. It includes a simple script that I use to check single requests. [https://www.coderesort.com/u/simon/blog/2011/09/06/trac_profiling Read it @ my blog].
    94 
    95  -- osimons
    9689
    9790----