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

Yast Network struggles with large hosts files #1193

Open
gantsevdenis opened this issue Sep 3, 2021 · 7 comments
Open

Yast Network struggles with large hosts files #1193

gantsevdenis opened this issue Sep 3, 2021 · 7 comments
Labels

Comments

@gantsevdenis
Copy link

First of all: is this is correct place where to report bugs? Might look a little quiet for such a big software.

Problem: my hosts file contains around 90000 blocked domain names, and when I open Yest Network, it hangs at 'Reading configuration...", and keeps running with 100% CPU usage.

This totally prevents its usage. I had to create another hosts file with only 20 lines, and then I could open Yast Network

@gantsevdenis gantsevdenis changed the title Yest Network struggles with large hosts files Yast Network struggles with large hosts files Sep 3, 2021
@kobliha
Copy link
Member

kobliha commented Sep 6, 2021

@gantsevdenis We encourage people for reporting at out Bugzilla, but we understand that you need to create account there. On the other hand, there you are easily lead to select the product, component, and it's easier to track (at least for the team). Plus we usually ask for YaST logs to be attached there. See https://en.opensuse.org/openSUSE:Report_a_YaST_bug

We definitely had some performance problems at the past: yast/yast-network#711 and we tried to mitigate the situation. On the other hand, YaST does not seem to be the right tool for editing /etc/hosts, but IIUC, you are saying that just starting YaST Network blocks you for ages?

@teclator @mchf Is this a known thing?

@dgdavid dgdavid added the needinfo More details are needed from the reporter label Sep 6, 2021
@gantsevdenis
Copy link
Author

gantsevdenis commented Sep 6, 2021

@kobliha Exactly, I am not using Yast Network to edit hosts, I just can't use Yast Network at all, if I happen to have a large hosts file.
I actually never succeeded to launch Yast Network before, so I had to ask on forums.opensuse, and I pinned down the problem to my hosts

@mchf
Copy link
Member

mchf commented Sep 6, 2021

Reading /etc/hosts still suffers from using the old code (converted from ycp). It has already bean improved a bit, so yast is at least able to survive big hosts file without crashing.

Next step was rewriting it to use augeas. I have a patch proposal under test. So, I'll add huge /etc/hosts test too to see whether it behaves better than before.

@dgdavid dgdavid added ✨ WIP and removed needinfo More details are needed from the reporter labels Sep 6, 2021
@gantsevdenis
Copy link
Author

Hm I obviously don't know the codebase behind Yast, but when I attached gdb to the running instance, I could see that it hangs (well, runs forever) within augeas already
I can provide the full stacktrace if needed

@kobliha
Copy link
Member

kobliha commented Sep 6, 2021

Thinking about it, if nothing helps, we could try to disable reading /etc/hosts if we find out that it's simply too large for being read in reasonable time. This would be a workaround, but it might at least make the rest of YaST users usable.

@jreidinger
Copy link
Member

@mchf it already uses augeas and it does not help, as simple parsing so huge file takes reasonable amount of time. I already improved it in past to be reasonable fast with 10k entries, but already with 30k it is slow and getting worse.

@mchf
Copy link
Member

mchf commented Sep 6, 2021

@jreidinger: I did too much compression in my expression. What I wanted to say was that we use still the same approach when reading hosts even after rewriting to augeas in context of module startup and data processing. I'm experimenting with kind of lazy load to address similar issues - not to load it on module start, but at time when user needs it. It clearly will not help with speeding up loading but at least can do the module startable. Problem is of course in detection of "when user needs it" due to some connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants