• We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Right now the loading a page by space key and page title is the top db query. There are two things we are tackling to improve performance:

      1) Reduce number of queries issued
      2) Improve execution time of the query

            [CONFSERVER-14273] Reduce DB load for loading pages

            Hey Tim,

            to answer your questions:

            • How large is the "increased the size"?

            The default cache size is 10.000 items.

            • Is it admin-configurable/tunable?

            Yes, the cache size is configurable. With 3.0 you can even change the size of the cache at runtime (CONF-12836).

            • For example: In an instance with 250K pages, will they all be cached?

            I wouldn't advise to try to cache all page ids, but instead follow the "Cache tuning example" section in our guides on cache tuning to achieve best performance (you don't need to touch the configuration files in 3.0 anymore).

            • How long will page names live in the cache?
            • Are hooks in place to clear the cache when/if pages are renamed?
            • Is there potential for conflict if a page is named "Meetings", and then renamed to "Archived Meetings" and then a new page is created with the name "Meetings" (but obviously a new ID)?

            The entries in the cache never expire. If the maximum size of the cache is reached, the least recently used entry will get pushed out if a new page id gets cached. Updates to page titles in all variations will update the corresponding entry in the cache.

            Cheers,
            Chris

            Chris Kiehl added a comment - Hey Tim, to answer your questions: How large is the "increased the size"? The default cache size is 10.000 items. Is it admin-configurable/tunable? Yes, the cache size is configurable. With 3.0 you can even change the size of the cache at runtime ( CONF-12836 ). For example: In an instance with 250K pages, will they all be cached? I wouldn't advise to try to cache all page ids, but instead follow the "Cache tuning example" section in our guides on cache tuning to achieve best performance (you don't need to touch the configuration files in 3.0 anymore). How long will page names live in the cache? Are hooks in place to clear the cache when/if pages are renamed? Is there potential for conflict if a page is named "Meetings", and then renamed to "Archived Meetings" and then a new page is created with the name "Meetings" (but obviously a new ID)? The entries in the cache never expire. If the maximum size of the cache is reached, the least recently used entry will get pushed out if a new page id gets cached. Updates to page titles in all variations will update the corresponding entry in the cache. Cheers, Chris

            Tim Colson added a comment -

            This sounds like a great improvement!
            I have a few questions:

            • How large is the "increased the size"?
            • Is it admin-configurable/tunable?
            • For example: In an instance with 250K pages, will they all be cached?
            • How long will page names live in the cache?
            • Are hooks in place to clear the cache when/if pages are renamed?
            • Is there potential for conflict if a page is named "Meetings", and then renamed to "Archived Meetings" and then a new page is created with the name "Meetings" (but obviously a new ID)?

            Thanks!
            -Timo

            Tim Colson added a comment - This sounds like a great improvement! I have a few questions: How large is the "increased the size"? Is it admin-configurable/tunable? For example: In an instance with 250K pages, will they all be cached? How long will page names live in the cache? Are hooks in place to clear the cache when/if pages are renamed? Is there potential for conflict if a page is named "Meetings", and then renamed to "Archived Meetings" and then a new page is created with the name "Meetings" (but obviously a new ID)? Thanks! -Timo

            Matt Ryall added a comment -

            Review updates look fine to me.

            Matt Ryall added a comment - Review updates look fine to me.

            This one looks old, can we get it reviewed and out of the way, please?

            Per Fragemann [Atlassian] added a comment - This one looks old, can we get it reviewed and out of the way, please?

            Things done:

            • Increased the size of the ('spacekey', 'title') -> 'pageid' cache to query by 'pageid' as often as possible. That is way more effective than querying by 'lower(spacekey) and lower(title)' and we use the 2nd level cache more often if the entity with the pageid is already loaded.
            • If we have to query by 'spacekey' and 'title', resolve the space key to a space id first to avoid joining the spaces table. Resolving the space key is very cheap as all spaces are cached in memory anyway.

            Chris Kiehl added a comment - Things done: Increased the size of the ('spacekey', 'title') -> 'pageid' cache to query by 'pageid' as often as possible. That is way more effective than querying by 'lower(spacekey) and lower(title)' and we use the 2nd level cache more often if the entity with the pageid is already loaded. If we have to query by 'spacekey' and 'title', resolve the space key to a space id first to avoid joining the spaces table. Resolving the space key is very cheap as all spaces are cached in memory anyway.

              ckiehl Chris Kiehl
              ckiehl Chris Kiehl
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: