hydrus/help/reducing_lag.html

40 lines
6.4 KiB
HTML
Raw Normal View History

2015-12-16 22:41:06 +00:00
<html>
<head>
<title>reducing lag</title>
<link href="hydrus.ico" rel="shortcut icon" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="content">
<h3>hydrus is cpu and hdd hungry</h3>
<p>The hydrus client manages a lot of complicated data and gives you a lot of power over it. To add millions of files and tags to its database, and then to perform difficult searches over that information, it needs to use a lot of CPU time and hard drive time--sometimes in small laggy blips, and occasionally in big 100% CPU chunks. I don't put training wheels or limiters on the software either, so if you search for 300,000 files, the client will try to fetch that many.</p>
<p>In general, the client works best on snappy computers with low-latency hard drives where it does not have to constantly compete with other CPU- or HDD- heavy programs. Running hydrus on your games computer is no problem at all, but you should have it set to not start a big job while your CPU is otherwise busy so your games can run freely. Similarly, if you run two clients on the same computer, you should have them set to work at different times, because if they both try to process 500,000 tags at once on the same hard drive, they will each slow to a crawl.</p>
2020-05-27 21:27:52 +00:00
<p>Keeping your HDDs defragged is very important, and good practice for all your programs anyway. Make sure you know what this is and that you do it. I use PerfectDisk. O&O Defrag is also good.</p>
2015-12-16 22:41:06 +00:00
<h3>maintenance and processing</h3>
<p>I have attempted to offload most of the background maintenance of the client (which typically means repository processing and internal database defragging) to time when you are not using the client. This can either be 'idle time' or 'shutdown time'. The calculations for what these exactly mean are customisable in <i>file->options->maintenance and processing</i>.</p>
<p>If you run a quick computer, you likely don't have to change any of these options. Repositories will synchronise and the database will stay fairly optimal without you even noticing the work that is going on. This is especially true if you leave your client on all the time.</p>
<p>If you have an old, slower computer though, or if your hard drive is high latency for one reason or another (e.g. you use encryption), make sure these options are set for whatever is best for your situation. Turning off idle time completely is often helpful as some older computers are slow to even recognise--mid task--that you want to use the client again, or take too long to abandon a big task half way through. If you set your client to only do work on shutdown, then you can control exactly when that happens.</p>
<p>Keeping the database vacuumed is important, so if you remove it from the normal maintenance schedule, make sure you run it every now and then manually from <i>database->maintenance->vacuum</i>. It takes a few minutes to run, but it is great for cleaning up a database recently fragged by several million new rows of data.</p>
<h3>reducing search and general gui lag</h3>
<p>Searching for tags via the autocomplete dropdown and searching for files in general can sometimes take a very long time. It depends on many things. In general, the more predicates (tags and system:something) you have active for a search, the faster it will be. And the more specific the search domain (e.g. "local files" instead of "all known files" and "my tag repo" instead of "all known tags"), the faster it will be.</p>
<p>You can also look at <i>file->options->speed and memory</i>, again especially if you have a slow computer. Increasing the autocomplete thresholds is very often helpful. You can even force autocompletes to only fetch results when you manually ask for them.</p>
<p>Having lots of thumbnails open can slow many things down. If you get lag with 10,000 files open in your searches, try cutting it down to only 1,000 or so. Split your downloading binges and subscriptions into smaller, rarer chunks, and don't try to watch 1080p webms while five other things are going on.</p>
2017-03-22 22:38:15 +00:00
<h3 id="profiles">finally - profiles</h3>
2015-12-16 22:41:06 +00:00
<p>Lots of my code remains unoptimised for certain situations. My development environment is obviously specific to me and has only a few thousand images and a few million tags. As I write code, I am usually more concerned with getting it to work at all rather than getting it to work fast for every possible scenario. So, if something is running particularly slow for you, but your computer is otherwise working fine, let me know and I can almost always speed it up.</p>
<p>Let me know:</p>
<ul>
<li>The general steps to reproduce the problem (e.g. "Running system:numtags>4 is ridiculously slow on its own on 'all known tags'.")</li>
<li>Your operating system and its version (e.g. "Windows 8.1")</li>
<li>Your computer's general power (e.g. "A couple of years old. It runs most stuff ok.")</li>
<li>The type of hard drive you are running hydrus from. (e.g. "A 2TB 7200rpm drive that is 20% full. I regularly defrag it.")</li>
<li>Any <i>profiles</i> you have collected.</li>
</ul>
2016-09-21 19:54:04 +00:00
<p>A <i>profile</i> is a large block of debug text that lets me know which parts of my code are running slow for you. Currently, hydrus profiles have three sections. A complete one looks like <a href="profile_example.txt">this</a>.</p>
2017-03-22 22:38:15 +00:00
<p>It is very helpful to me to have a profile. You can generate some by going <i>help->debug->db profile mode</i>, which tells the client to generate profile information for every subsequent database request. This will spam your logfile, so don't leave it on for a very long time (you can turn it off by hitting the help menu entry again).</p>
<p>Turn on profile mode, do the thing that runs slow for you (importing a file, fetching some tags, whatever), and then shut the client down and go to the newly created profile logfile, which should be at <i>install_dir/db/client profile - TIMESTAMP.log</i>. This file will be filled with several sets of tables with timing information for one (or likely more) code calls. You can either copy and paste the data labelled for your problem request (e.g. "import_file") or just send me the whole logfile.</p>
2016-09-21 19:54:04 +00:00
<p><i>pubsub profile mode</i> is experimental and very log heavy. Feel free to play with it, but it is really for my own purposes. Almost everything that is slow in the program is due to my inefficient database queries.</p>
2016-05-25 21:54:03 +00:00
<p>There are several ways to <a href="contact.html">contact me</a>.</p>
2015-12-16 22:41:06 +00:00
</div>
</body>
2020-05-27 21:27:52 +00:00
</html>