Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.4
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Now that our main queries have become immutable, I would like to revisit enabling the query cache by default.

      1. LUCENE-6784.patch
        1 kB
        Adrien Grand
      2. LUCENE-6784.patch
        2 kB
        Adrien Grand

        Activity

        Hide
        Adrien Grand added a comment -

        Here is a patch. The default cache has a size of 32MB and I added a heuristic to only enable it if this would represent less than 5% of the total memory that is available to the JVM. If you think this heuristic is too complicated I can remove it...

        Show
        Adrien Grand added a comment - Here is a patch. The default cache has a size of 32MB and I added a heuristic to only enable it if this would represent less than 5% of the total memory that is available to the JVM. If you think this heuristic is too complicated I can remove it...
        Hide
        Robert Muir added a comment -

        I'm a little concerned since tests run with 512MB heap (except when running with clover, in which case its 768MB)

        Show
        Robert Muir added a comment - I'm a little concerned since tests run with 512MB heap (except when running with clover, in which case its 768MB)
        Hide
        Adrien Grand added a comment -

        Test cases can't make use of this default query cache anyway since it would make tests not reproduce, we have LuceneTestCase.overrideTestDefaultQueryCache that resets the default query cache before each test runs. So I don't think this is much of an issue?

        Show
        Adrien Grand added a comment - Test cases can't make use of this default query cache anyway since it would make tests not reproduce, we have LuceneTestCase.overrideTestDefaultQueryCache that resets the default query cache before each test runs. So I don't think this is much of an issue?
        Hide
        Robert Muir added a comment -

        Thats true, I guess there is always the situation of consumers' tests. I'm not sure there is a real issue here: but its good to avoid any traps that would only be caught in production.

        Alternatively the cache could just be sized as min(32MB, 5% heap) or something, so that if you run with a 256MB heap you still get cache, just a 12.8MB one.

        Show
        Robert Muir added a comment - Thats true, I guess there is always the situation of consumers' tests. I'm not sure there is a real issue here: but its good to avoid any traps that would only be caught in production. Alternatively the cache could just be sized as min(32MB, 5% heap) or something, so that if you run with a 256MB heap you still get cache, just a 12.8MB one.
        Hide
        Adrien Grand added a comment -

        I like this alternative. Here is an updated patch.

        Show
        Adrien Grand added a comment - I like this alternative. Here is an updated patch.
        Hide
        ASF subversion and git services added a comment -

        Commit 1701964 from Adrien Grand in branch 'dev/trunk'
        [ https://svn.apache.org/r1701964 ]

        LUCENE-6784: IndexSearcher's query caching is enabled by default.

        Show
        ASF subversion and git services added a comment - Commit 1701964 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1701964 ] LUCENE-6784 : IndexSearcher's query caching is enabled by default.
        Hide
        ASF subversion and git services added a comment -

        Commit 1701967 from Adrien Grand in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1701967 ]

        LUCENE-6784: IndexSearcher's query caching is enabled by default.

        Show
        ASF subversion and git services added a comment - Commit 1701967 from Adrien Grand in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1701967 ] LUCENE-6784 : IndexSearcher's query caching is enabled by default.

          People

          • Assignee:
            Adrien Grand
            Reporter:
            Adrien Grand
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development