Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-2536

Performance improvements to VariableExpander in header_rewrite

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: sometime
    • Component/s: Plugins
    • Labels:
      None

      Description

      It seems that VariableExpander gets instantiated and executed on every add-header operator. However, this seems rather suboptimal for a number of reasons:

      1. It might not even be necessary (i.e. there might not be any %<> strings in the "static" string.

      2. Perhaps even more important, we look for these strings on every request, even though if they are there, they would always be in the same position on every request.

      One suggestion would be to incorporate the VariableExpander "state" as part of parsing the configuration on startup / reload. Maybe it gets complicated when there are other expansions, but it still feels we can pre-parse these strings and get some ideas of what needs to be expanded once, and not on every request.

      This is similar to how e.g. the regex_remap plugin works, it recalculates the positions and expansion once only.

      Thoughts?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jaript Jari Alhonen
                Reporter:
                zwoop Leif Hedstrom
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: