Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Thread leak? #2623

Closed
Closed

Description

@xcir

image
ESI: enabled HTTP/2: enabled
I disabled http/2 after noticing threads increase.(only hitch restart)
But, It seems gradual increase.

image
This is another instance(ESI: enabled + HTTP/2: enabled)

image
ESI: disabled HTTP/2: enabled
This instance is not using ESI.
Thread was not increase.

Your Environment

  • Version used: Varnish 6.0.0 + Hitch 1.4.6
  • Ubuntu 16.04 (4.13.0-19-generic)

Activity

  1. xcir commented on Mar 20, 2018

    @xcir
    ContributorAuthor

    I'm testing other conditions.(ESI + HTTP/1 + varnish restart)
    But, take few days to result comes out.

  2. xcir commented on Mar 23, 2018

    @xcir
    ContributorAuthor

    ESI:enabled + h2:disabled + varnish restart
    ->Not increase.

    ESI:disabled + h2:enabled
    -> After posting thread increased in few instance.
    image
    This graph(ESI:disabled+h2:enabled) is running for 5 days.

    I think this issue seems at http2.

  3. xcir commented on Mar 26, 2018

    @xcir
    ContributorAuthor

    Hitch stopped.
    Only healthcheck request.(HTTP)
    Instance removed from the cluster at 20:30(JST)

    image
    ESI: Enabled h2: Enabled thread_pools: 2 thread_pool_min: 200 MAIN.threads: 527

    image
    ESI: Disabled h2: Enabled thread_pools: 2 thread_pool_min: 150 MAIN.threads: 344

  4. xcir commented on Mar 27, 2018

    @xcir
    ContributorAuthor

    All TZ is UTC+0900(JST)

    image
    I added some counters for check.
    master...1c804ea
    nidle_delta = nidle_incr - nidle_decr (idle threads count)
    nidle_active = MAIN.threads - nidle_delta (active threads count)
    h2_refcnt_delta = h2_refcnt_incr - h2_refcnt_decr (active h2 streams count)

    h2_refcnt_delta and nidle_active increased simultaneously at 10:40-11:00.
    This instance removed (and Hitch restart) from cluster at 17:00-17:30.
    But, h2_refcnt_delta is not so much reduced.

  5. xcir commented on Apr 6, 2018

    @xcir
    ContributorAuthor

    I'm looking for a cause commit...

    Leaked
    0d3044d
    image
    https://github.com/xcir/varnish-cache/tree/tmp/snap/1003-0d3044d

    Not leaked
    3a86dd8
    image
    https://github.com/xcir/varnish-cache/tree/tmp/snap/0817-3a86dd8

    00:50(JST)~ removed instance , set thread_pool_timeout=10 and thread_pool_min=10.

  6. xcir commented on Apr 10, 2018

    @xcir
    ContributorAuthor

    I think thread leak began from 0d3044d

  7. self-assigned this
    on Apr 30, 2018
  8. Francois-v3 commented on May 7, 2018

    @Francois-v3

    I have also a thread leak under unbuntu 16.04 (4.4.0-98-generic) with varnish 6.0.0 and HAProxy 1.8 with h2 enable. The same config with very few h2 trafic show no leak.
    image
    Threads goes down when child restart ...

  9. Francois-v3 commented on May 10, 2018

    @Francois-v3

    In addition, i can observe that by changing communication between HAProxy and varnish from TCP to UDS, threak leak become at least very small:
    image

  10. Francois-v3 commented on May 17, 2018

    @Francois-v3

    Finaly i still have thread leak, but only above 2500/3000 requests per second.
    image

  11. ehocdet commented on May 24, 2018

    @ehocdet
    Contributor

    We have also thread leak since h2 is activated.
    With frequently vcl load/discard we can see a lot of vcl stalled in "discarded cold/busy" state.

    n_vcl grows with h2 enable, and stop to grow without. n_vcl metric on 4 servers:
    image

  12. daghf commented on May 30, 2018

    @daghf
    Member

    Hey

    I've now pushed fixes for two separate potential thread leak situations (a56469c and 4b73c5f).

    The first one relates to failing POST bodies, and the second one is relating to our handling of PRIORITY frames.

    Could I ask you to please give master a spin to see if you still have a thread leak?

  13. xcir commented on May 31, 2018

    @xcir
    ContributorAuthor

    I'm testing at varnish 6.0.0 + bin/varnishd/http2/* changes.
    Please tell me, if you need other commit.
    varnish-6.0.0...xcir:tmp/snap/v600-apply-h2commit

  14. xcir commented on May 31, 2018

    @xcir
    ContributorAuthor

    image
    varnish-6.0.0...xcir:b418fe871acc1798026f86e10904c01807403d8f
    16:45(JST) ~ removed instance , set thread_pool_timeout=10 and thread_pool_min=10.

    Leaked...

  15. 11 remaining items

  16. xcir commented on Jun 19, 2018

    @xcir
    ContributorAuthor

    leaked again...
    image
    23:25(JST) ~ replace varnish ( ed50971 -> 677320e )
    02:15(JST) ~ removed instance , set thread_pool_timeout=10 and thread_pool_min=10.

    backtrace
    https://gist.github.com/xcir/6d0dc200a11ba987f53a770a1f80ff3f

    backtrace(h2=0x7f63194affc0)
    https://gist.github.com/xcir/bbf50720fc2fa14038f009c54c37dd19

  17. reopened this on Jun 20, 2018
  18. added a commit that references this issue on Jun 22, 2018
    0e99f85
  19. xcir commented on Jun 23, 2018

    @xcir
    ContributorAuthor

    image

    again..

    backtrace + VSL
    https://gist.github.com/xcir/336098bb0d2a93552d232ff4516f90a1

    working varnish(tmp/snap/0618-trunk)
    xcir@d2378c9

  20. reopened this on Jun 26, 2018
  21. added 2 commits that reference this issue on Jun 27, 2018
    624b411
    3ab828a
  22. xcir commented on Jul 1, 2018

    @xcir
    ContributorAuthor

    I'm running 812b136 commit for 4days. Not leak!
    I think this issue was fixed.

  23. added 2 commits that reference this issue on Aug 16, 2018
    5fddc69
    a6533c7
  24. added a commit that references this issue on Mar 14, 2019
    14df924
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions