Wiki source code of Find What Makes a Request Slow
Last modified by superadmin on 2026/10/21 14:27
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | XWiki can break a request into its steps and report how long each one took, which is what says whether the answer is a database index, a cache, more heap, or nothing at all: see [[Performance>>doc:documentation.xs.admin.performance.WebHome]] for what each layer can be made to do. | ||
| 2 | |||
| 3 | 1. Open the slow page with ##debug=true## added to its URL.((( | ||
| 4 | {{code language="none"}} | ||
| 5 | https://wiki.example.com/xwiki/bin/view/Space/Page?debug=true | ||
| 6 | {{/code}} | ||
| 7 | ))) | ||
| 8 | 1. Go to the end of the page, below the footer, where the request's elapsed time tree is rendered. | ||
| 9 | 1. Follow the branch that keeps the percentage. Every node shows its own duration and its share of the whole request, and the children of a node account for its time. | ||
| 10 | 1. Identify what the dominant step belongs to. A step named ##Execute Solr query## is the search index, ##Render document## and ##Evaluate content of template## are the rendering of the page, and the steps directly under ##Execute request## are what the servlet does before any content is produced.((( | ||
| 11 | {{image reference="solr-query-step.png" size="large" alt="An Execute Solr query step of the elapsed time tree, with its Prepare, Execute and Filter sub-steps and their durations"/}} | ||
| 12 | ))) | ||
| 13 | 1. The tree now names the layer to act on: one step holds most of the request, with its own duration and its share of the total.((( | ||
| 14 | {{image reference="performance-tree.png" size="large" alt="The elapsed time tree of a page request, with the Execute template step holding 370ms of the 371ms total"/}} | ||
| 15 | ))) |