python-trio / python-trio/trio
Best number of `total_tokens` on the default `CapacityLimiter`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.3k
- Forks
- 431
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 6
Description
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:
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:
I'm creating this issue mainly to see if we can come up with some ideas to have this optimal number there.
Ideas? 😅
References:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading trio/_threads.py around lines 30-32, the linked Gitter discussion, and the Gunicorn 2-4 * NUM_CORES reference. The issue does not define completion; it needs an agreed way to choose the default and an accompanying change or documented conclusion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100