I have a test instance of XWiki and I see a relatively irritating problem with rendering navigation tree. It takes more than 1:30 min to render the navigation tree for imported pages.
These pages were imported through XAR input filter stream but I didn’t use package.xml file to describe the structure. Could it have some impact on this tree rendering macro?
running in Docker container as in XWiki manual on CentOS
host unfortunately running on 1 Core at 2.0 GHz with 8GB RAM
I’m working on getting access to more powerful machine, but even with this specs 1.5 minute of rendering time is really high. Pages are nested to 4-5th level sometimes.
I created some test pages by myself and there is no such problem with rendering. The problem occurs only with imported pages.
To be clear: you’re referring to the Navigation Panel http://extensions.xwiki.org/xwiki/bin/view/Extension/Panels+Application#HNavigationPanel right? The Navigation Panel queries the pages from the database so it doesn’t really matter where those pages come from (created by hand or imported by XAR). Once the pages end up in the database they are all the same. So whether you’ve used {{package.xml}} or not doesn’t have any impact on the Navigation Panel.
But maybe you’re referring to the tree that lists the pages from the XAR before they are actually imported. That’s a different tree than the one from the Navigation Panel though. A screenshot would help clarify things.
The issue seems to be when the “Administracja” node is expanded. Go to the wiki home page, where the tree should load fast, open the browser developer tools (Right Click > Inspect), look for the Network tab, filter the XHR (AJAX) requests, clear the logged requests and then expand the “Administracja” node. You should see the AJAX request made to fetch the child nodes. How long does this request take? Do you know home many pages you have under “Administracja” (included nested pages)?
It took 40.72 s. There are 774 pages below ‘Administracja’ node.
Please find below more details about this request:
Headers:
Request URL: http://xxx.xxx.xxx.x:8080/bin/get/Administracja/WebHome?outputSyntax=plain&sheet=XWiki.DocumentTree&showAttachments=false&showTranslations=false&exclusions=document%3Axwiki%3ASandbox.WebHome&exclusions=document%3Axwiki%3AHelp.WebHome&exclusions=document%3Axwiki%3AXWiki.WebHome&exclusions=document%3Axwiki%3AMenu.WebHome&data=children&id=document%3Axwiki%3AAdministracja.WebHome
Request Method: GET
Status Code: 200
I’m trying to see something in logs, but cannot figure out which module should I set up to DEBUG level. Could you please navigate me towards the right one?
This will give you the time in ms to fetch the children of the Administracja page without doing any rendering. It should be very fast. On my colleague’s laptop we get 4ms for the “Test” top level page (that has 4k nested child pages).
If it’s fast for you too then it means the problem is not at the database level but at the rendering level. And on the rendering side the problem could be the title of the imported pages. In order to display the pages in the tree we need to render their title. If the title contains scripting (Velocity) then this can slow down the tree.
Hi, I moved the wiki instance to much faster machine (16GB RAM, SSD, 4 cores CPU) and installed as war package in Tomcat. Postgres is installed side-by-side on the same machine. Unfortunately the problem still persists. I did perform the velocity test and this is a sample result of the @mflorea script :
[document:xwiki:Administracja.1 Spis treści pełny.WebHome, document:xwiki:Administracja.1 Spis treści skrótowy.WebHome, document:xwiki:Administracja.Administracja serwerem MindTouch.WebHome, document:xwiki:Administracja.Archiwum.WebHome, document:xwiki:Administracja.Statystyki.WebHome, document:xwiki:Administracja.TWiki.WebHome]
1
However, the rendering is still extremely slow and the CPU utilization of java process reaches 200% in top tool.
So it takes 1ms (0.001 of a second) to get the child nodes from the database. This proves that there is no issue with the database queries. The problem must be when rendering / displaying the tree nodes.
Let’s try this: edit the Panels.Navigation page, look for the {{documentTree ... macro call and add the parameter showDocumentTitle="false". Save and check the navigation tree. Is it still slow?
Showing the page name is obviously instant while showing the rendered title can take time. showDocumentTitle="false" tells the navigation tree to show the page name instead of the page title, which is faster but less nice for the end user.
I would check the title of these pages
[document:xwiki:Administracja.1 Spis treści pełny.WebHome, document:xwiki:Administracja.1 Spis treści skrótowy.WebHome, document:xwiki:Administracja.Administracja serwerem MindTouch.WebHome, document:xwiki:Administracja.Archiwum.WebHome, document:xwiki:Administracja.Statystyki.WebHome, document:xwiki:Administracja.TWiki.WebHome]