Skip to content

Best number of total_tokens on the default CapacityLimiter #2364

Open
@Kludex

Description

@Kludex

Hi there 👋

Yesterday, I asked on trio's Gitter channel if there was a reason for the number of total_tokens on the default CapacityLimiter to be 40. @njsmith reply was:

image

And I guess it's a good number, as it's been there for five years. 😅 But... As he mentioned, it would be interesting to find an optimal number there.

The part of the code I'm talking about:

trio/trio/_threads.py

Lines 30 to 32 in f2e2dd2

# I pulled this number out of the air; it isn't based on anything. Probably we
# should make some kind of measurements to pick a good value.
DEFAULT_LIMIT = 40

I'm creating this issue mainly to see if we can come up with some ideas to have this optimal number there.

Ideas? 😅

Gitter conversation This is just for reference.

Link to the Gitter conversation

image image image image

References:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions