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

High memory usage on blacklist refresh #470

Closed
bkupidura opened this issue Mar 28, 2022 · 2 comments · Fixed by #515
Closed

High memory usage on blacklist refresh #470

bkupidura opened this issue Mar 28, 2022 · 2 comments · Fixed by #515
Assignees
Labels
🔨 enhancement New feature or request
Milestone

Comments

@bkupidura
Copy link

bkupidura commented Mar 28, 2022

Im using blocky with ~19 blacklists, every refreshPeriod i see high memory usage spike (~50MB -> ~150MB -> ~50MB).

I tries to run all my pods with memory limits, to avoid OOM on HV, and this memory spikes sometimes leads to blocky killed by K8s.

Can we introduce some method to limit how many links will be downloaded in same time?
Afaik currently (

for _, link := range links {
) we are just going thru all lists, and trying to fetch them in same time. With big number of lists/big number of entries in list we can hit this memory spike.
If we would be able to limit how many lists should be downloaded in same time it should help.

EDIT: I see that there are some download options (e.g downloadTimeout), can we just add download
Concurrency? :)

Screenshot 2022-03-28 at 16 09 08

@0xERR0R
Copy link
Owner

0xERR0R commented Mar 28, 2022

Yes, you're right. Blocky downloads all lists per group simultaneously. Each new downloaded list will be processed in-memory and the cache content will be replaced at the end. That means, we need temporarily the double amount of memory (to hold the old version and to process the new one).

It would make sense to introduce a new parameter "downloadConcurrency" or something similar.

You can also try to create multiple groups with less lists, this should also help

@0xERR0R
Copy link
Owner

0xERR0R commented May 12, 2022

I made some memory optimizations in #513 and #515 and introduced new parameter 'processingConcurrency' to limit the worker goroutine number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants