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

Opening Debug Pane freezes Tribler Core and uses 100% of disk for a while #7711

Open
xoriole opened this issue Nov 21, 2023 · 3 comments
Open

Comments

@xoriole
Copy link
Contributor

xoriole commented Nov 21, 2023

Describe the bug
Opening the Debug Pane on Windows freezes the Tribler Core and uses 100% of disk for a while.

Here is a screenshot:
tribler-debug-pane-100-disk

Environment:

  • OS: Windows 10
  • Tribler's version 7.13.0

Additional context
It is the core that is frozen. The GUI is still responsive. After a while, the disk usage reduces and the Debug Pane is populated with data.

@xoriole xoriole added this to the 7.14.0 milestone Nov 21, 2023
@drew2a drew2a self-assigned this Nov 22, 2023
@drew2a
Copy link
Contributor

drew2a commented Nov 22, 2023

It appears that I can't reproduce the bug. When I'm not subscribed to any channels, I don't observe any CPU spikes while opening the 'Debug panel.' However, if I am subscribed to a channel, my CPU usage consistently remains at 100%.

OS: macOS.

@drew2a drew2a removed their assignment Nov 22, 2023
@xoriole xoriole self-assigned this Nov 23, 2023
@xoriole
Copy link
Contributor Author

xoriole commented Nov 28, 2023

One of the reasons for Core freezing is the call to /statistics/tribler endpoint which takes a long time to respond. Here is an HTTP request log using httpie library.
statistics-log

async def get_tribler_stats(self, request):
stats_dict = {}
if self.mds:
db_size = self.mds.get_db_file_size()
stats_dict = {"db_size": db_size,
"num_channels": self.mds.get_num_channels(),
"num_torrents": self.mds.get_num_torrents()}
return RESTResponse({'tribler_statistics': stats_dict})

Mocking the response to the statistics endpoint makes Trible responsive again. So, a solution would be to make this endpoint more efficient by making the underlying queries more performant.

Since channels are removed in the big giga cleanup, I don't think it is worth trying to solve this issue separately. Therefore, I'll close this issue.

@xoriole xoriole closed this as completed Nov 28, 2023
@xoriole
Copy link
Contributor Author

xoriole commented Dec 1, 2023

Re-opening this issue, the original problem persists.
The issue is the count query like the following:

	select count(1) from ChannelNode whre metadata_type==300

large-db-time

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

No branches or pull requests

3 participants