Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-9235

Too many DB requests to extract the wiki from request URLs

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      The consequence is lowered performances.

      For example we you call http://localhost:8080/xwiki/bin/view/Main/WebHome the folowing calls are made:

      • XWiki.getXWiki()
      • XWiki.getRequestWikiName()
      • XWiki.findWikiServer()
      • Query Manager call on the DB to locate a descriptor page

      The problem is that when no descriptor is found (which happens on a default install), the code does:

      this.virtualWikiMap.set(host, wikiName);
      

      And since wikiName is null, the next time findWikiServer is called the following condition evaluate to true and the cycle repeats:

      DocumentReference wikiName = this.virtualWikiMap.get(host);
      if (wikiName == null) {
      ...
      

      The solution is to save the fact that there's no wiki descriptor for "localhost" and have some EventListener update that cache if a descriptor is added.

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: