I have a strange issue with the performance of my xwiki instance.
First of all, I have about 12000 pages I created through the API.
Creating new pages through API or in the wiki with the save & view button seems to take a really long time (over 1 minute to complete). The page is already created, but the time it takes to render it is really long.
If I create the new page by clicking on “Save” or use “Save & View” and browse the page with the URL I manually enter, then I can see the page is already created.
I tried to log slow queries on the postgres instance, and the slowest queries takes a few milliseconds (all under 50).
The VM for xwiki has 4 x E5-2630 v3 @ 2.40GHz + 8GB of Ram.
the xwiki is set to use up to 3GB of ram. The shared buffer of postgres was set to 2GB. About 3GB of ram is free according to free -m.
I find it a bit weird that it is only when using “Save & view”, it takes a really long time to give me a page, while I can actually get a page out if I input the URL manually. I think the API also act like a “Save & View” so it takes ages to create all my pages ( I am importing content from another old trac wiki).
Any Idea on why I experience this weird behaviour?
Thanks for replying, I am not too sure how to get a debug when clicking on the “save & view” button. This is a post button and it does not carry on ?debug=true if set in the url.
I tried to enable debug of the DB calls by adding the suggested lines in the logback.xml file, but it did not output anything in catalina.out, so I logged request slower than 3 ms in postgres, which gave me some result, but nothing over a few milliseconds.
logging HTTP calls also did not produce logs into catalina.out.
I don’t think the viewer is to blame . I can actually do “click & save” then input the address manually on another tab, and it will generate the new page, while the one I did the “click & save” button needs 1.5 minute to finish.
I set the ram to 3GB as there was no indication what a large deployment was, and as I saw I had 12000 pages I did not know if it was beyond a large deployment or not. What I can say is even after restarting the tomcat server, it needs at least 1.5 minute for the “save & view” to fully complete the job.
I noticed the performance got worse when I created each pages in their own space. The first time I created the pages, it was still slow, but faster and I had everything under the space “Main”.
If the problem is the save then it could mean you have some custom Event Listeners doing a bad job. Do you know if you have installed some extensions or developed some custom Event Listener code?
Regarding perf, you need to read this page which contains everything to know on performances:
BTW 12K pages is not really large. When you reach several millions it’ll start to be large!
Just make sure you adjust the doc cache as explained in that doc, depending on how may docs are frequently accessed. Thus you need enough memory to be able to contain all the cached docs. That will be the main way to size the memory you need.
But that’s not going to solve your problem.
I don’t have any more ideas except for Event Listeners.
The view mode is fine.
I am sorry if my description was hard to understand. I will try again:
I create a new page.
Put a title > Create.
put “test” as content.
Case1 :
If I click “Save”. -> The process is very fast.
I Input the link of the new page manually. Page is displayed fast.
Case2 :
If I click “Save & View”. -> There will be a loading icon in the browser for about 1.5 minute.
BUT. While if I input the link of the new page manually. The page is displayed fast too.
After 1.5 Minute, the page where I clicked “save & view” Loads.
In fact, :
-the page creation seems to be instant.
-The view (if URL inputed manually) is also instant. (right after I click on “save” or “save & view”, the page would be displayed right after if I put the URL manually in the browser).
-The API create page and “Save & View” take a long time to complete fully (although I can confirm the page is created, but we need 1.5 minute before anything is displayed after pressing that button).
-The wiki never take a long time to display a page unless I do “Save & View”, so regular view mode is not giving me the problem, and creating is not the problem either.
My guess is the “save & view” action is not just “Save” then redirect to “View” mode, it may be doing something else. Same with the API call?
What template are you choosing when creating the new page? Is it “Blank Page”? Check the Network tab from the browser’s developer tools to see what requests are made when you click on Save & View and if those requests take long.
I am creating the page from a blank page template.
I use xwiki 10.6.1 ( installed from debian packages, xwiki-tomcat8-postgres)
When I click on save and view, the request hanging says:
Waiting TTFB : 1.3 min
I can’t find OpenSPML Toolkit on http://extensions.xwiki.org/ so I assume it’s an extension you built yourself. Does it have any save event listeners that could slow down the save?
I have installed a new xwiki instance with zero extension and it looks like the wiki imported all pages super fast.
This may suggest one extension is causing the problem.
The OpenSPML is a dependency installed when I install the LDAP authenticator.
This is the list of extension I have after installing the LDAP authenticator extension:
OpenSPML Toolkit 0.5
Installed as dependency
An open source client code that supports the Service Provisioning Markup Language (SPML) developed by the OASIS Provisioning Services Technical Committee (PSTC).
Administration Application 10.7
Installed but not valid
by: XWiki Development Team
Application for administrating wiki features like users, groups, rights etc.
LDAP Class Libraries for Java (JLDAP) 4.3
Installed as dependency
The LDAP Class Libraries for Java (JLDAP) enable you to write applications to access, manage, update, and search for information stored in directories accessible using LDAPv3.
LDAP Authenticator 9.2.5
Installed
by: Denis Gervalle, Thomas Mortagne, XWiki Development Team
Authenticate using a LDAP server
Extension Manager Application 10.6.1
Installed
by: XWiki Development Team
I tried to uninstall all extensions from my older xwiki and it did not help. I was also not able to get another instance of xwiki 10.6.1 running so I just ditched everything and went for a clean 10.7 install.
After importing everything, I installed more or less the same extensions and so far, it is still fast.
Could not pinpoint the exact reason why I had poor performance on xwiki previously, but my current setup is working well.