Traffic Server
  1. Traffic Server
  2. TS-880

Major performance problem with second request on same keep-alive connection

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 2.1.4
    • Fix Version/s: 3.1.0, 3.0.4
    • Component/s: HTTP
    • Labels:
      None
    • Environment:

      32-bit TS on linux, using epoll. With proxy.config.http.keep_alive_enabled_out = 1

      Description

      If I load the same URL through TS twice in a row to a server with keep-alives turned on I get really slow performance on the second request.
      E.g. (loading 212M over loopback with uncachable content, but results are similar with cachable content):
      % Total % Received % Xferd Average Speed Time Time Time Current
      Dload Upload Total Spent Left Speed
      100 212M 100 212M 0 0 140M 0 0:00:01 0:00:01 -::- 142M*
      % Total % Received % Xferd Average Speed Time Time Time Current
      Dload Upload Total Spent Left Speed
      100 212M 100 212M 0 0 6397k 0 0:00:34 0:00:34 -::- 6400k*

      If I turn off proxy.config.http.keep_alive_enabled_out the problem goes away, it can also be partially solved by making proxy.config.io.max_buffer_size really big (but it needs to be bigger for larger content, and that supports the comment below, and proves that it isn't the origin server's fault.)

      When I turn on debug messages it looks like the IO loop for the second request only wakes up every 10ms (when an epoll_wait times out) and then it reads and writes, for the first request it goes much faster without those pauses. My theory is that the issue is related to the the fact that the outgoing connection fd gets added to the epoll fd for the thread handling the first request and the first user agent fd is added to the same epoll fd, and it stays on that epoll fd. But the new user agent request is on a different epoll fd which I assume means is tied to a different thread.

      1. performance_2nd_req_another_version.patch
        2 kB
        mohan_zl
      2. performance.try3.diff
        0.5 kB
        weijin
      3. performance_2nd_req_try2.diff
        3 kB
        William Bardwell
      4. performance_2nd_req.diff
        4 kB
        William Bardwell

        Activity

        William Bardwell created issue -
        Leif Hedstrom made changes -
        Field Original Value New Value
        Assignee William Bardwell [ wbardwel ]
        Fix Version/s 3.1.0 [ 12315515 ]
        William Bardwell made changes -
        Attachment performance_2nd_req.diff [ 12489201 ]
        William Bardwell made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Leif Hedstrom made changes -
        Backport to Version 3.0.2 [ 12316469 ]
        William Bardwell made changes -
        Attachment performance_2nd_req_try2.diff [ 12489530 ]
        Leif Hedstrom made changes -
        Fix Version/s 3.1.1 [ 12316496 ]
        Fix Version/s 3.1.0 [ 12315515 ]
        Backport to Version 3.0.2 [ 12316469 ]
        weijin made changes -
        Attachment performance.try3.diff [ 12490616 ]
        mohan_zl made changes -
        Leif Hedstrom made changes -
        Fix Version/s 3.1.0 [ 12315515 ]
        Fix Version/s 3.1.1 [ 12316496 ]
        Leif Hedstrom made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Leif Hedstrom made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Igor Galić made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Assignee William Bardwell [ wbardwel ] Igor Galić [ i.galic ]
        Igor Galić made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Fix Version/s 3.0.4 [ 12320054 ]
        Resolution Fixed [ 1 ]
        Leif Hedstrom made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Igor Galić
            Reporter:
            William Bardwell
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development