hydrusnetwork / hydrus

A personal booru-style media tagger that can import files and tags from your hard drive and popular websites. Content can be shared with other users via user-run servers.
http://hydrusnetwork.github.io/hydrus/
Other
2.36k stars 157 forks source link

Hydrus GUI slowdown/unresponsive (partially hanged?) when running a subscription download #1612

Open Mpegger opened 1 week ago

Mpegger commented 1 week ago

Hydrus version

592

Qt major version

Qt 6

Operating system

Windows 11

Install method

Extract

Install and OS comments

Hydrus main program and DB is installed on a dedicated NVME drive, seperate from the OS

Bug description and reproduction

Issue: When Hydrus runs a subscription download for beta.sankaku, the GUI will become very slugglish and unresponsive. Menus opening are very delayed, clicking on a image is very delayed till the image actually is highlighted then shown in the preview window. In the worst state, it appears the Hydrus GUI is locked up/frozen, very often exceeding 1 minute while in this state. CPU usage on the core that Hydrus is currently using will also goto 100% usage during this time of unresponsiveness. Hydrus, however, is not actually frozen or locked up. The bottom right corner of the GUI that gives current information on database operations shows db read locked. Hovering the mouse over that information then shows current db job: readserialisable_named.

Normally on other subscription downloads, the db read locked flashes in the corner a bunch of times very quickly while the subscription download is going through its steps, so the sluggish GUI is not noticeable. But during the beta.sankaku subscription download, it appears to me (this is all just what I think is happening in the background) to stop and read the database in search of all entries with the same tag as it is currently going to download. The more entries in the databse with the tag, the longer is takes to read (hence GUI getting sluggish/frozen), and Hydrus does this multiuple times in a single download.

This issue starting happening somewhere around the early 57x versions (possibly 56x version). It did not occur before then.

Log output

No response

hydrusnetwork commented 19 hours ago

Thank you for this report. Please run a 'profile' over the duration of a run of this subscription, as under help->debug->profiling, and then have a skim of the log file created. I don't think it will have private info, so it would be safe to pastebin it here, but if there is anything private then please DM or email it to me. I will check out what is running slow and see what I can do.

The serialisable named stuff is usually related to larger chunky objects, which includes subscriptions. I've noticed that some of our larger subs are taking a bit of time to load, sometimes, but if you are getting 60-second hangs, that suggests a full-on traffic jam.