Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate-limit active go routines #38

Merged
merged 1 commit into from
Mar 3, 2022
Merged

Conversation

saracen
Copy link
Owner

@saracen saracen commented Mar 3, 2022

The filepool's Get()/Put() was designed to rate limit up to a certain concurrency, and whilst the unit of work is rate limited, we launch as many go routines as there are files to be archived first. By moving the Get() call outside of a go routine, we also limit the amount of go routines created at once.

This likely has memory savings, but also allows the -race detector to work when archiving many thousands of files.

The filepool's Get()/Put() was designed to rate limit up to a certain
concurrency, and whilst the unit of work is rate limited, we launch as many go
routines as there are files to be archived first. By moving the Get() call
outside of a go routine, we also limit the amount of go routines created at once.

This likely has memory savings, but also allows the "-race" detector to work
when archiving many thousands of files.
@saracen saracen merged commit c9c62b3 into main Mar 3, 2022
@saracen saracen deleted the rate-limit-active-go-routines branch May 21, 2023 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant