Fixing KeePass’ Slow Startup Performance
Friday, 4 April 2014
If you don’t use a Password Manager to store your login information for websites, first go read this: http://www.troyhunt.com/2011/03/only-secure-password-is-one-you-cant.html.
I’ve been using KeePass for my password manager for years, but noticed that their Professional Edition had a pretty brutal startup delay. As in – launch KeePass and wait 80 seconds for the window to open. While password security is important, that kind of delay will make even the most security-conscious person start thinking about using ‘123456’ for their password instead.
Surprisingly, I hadn’t seen many complaints online (and certainly no solutions), so I decided to see what Process Monitor might say. After setting an application filter for ‘keepass.exe’, here was the answer:
At 7:14 and 10 seconds, it starts enumerating the files in the directory where it is installed. And then doing this for every subdirectory. On my machine, that results in processing over 1600 files – as it was a random ‘Tools’ directory with all kinds of junk and support files.
At 7:14 and 55 seconds, it finally completes. And then creates a PluginCache file.
If I were a betting man, I’d say that it was looking at each of those 1600 files trying to figure out if they were some sort of KeePass plugin or not. Which takes a long time. This seems even more likely when you load the program a second time. It doesn’t take nearly as long to start because computers are quicker to read files a second time with the assistance of filesystem and hard drive caches.
Fortunately, this is simple to verify:
After rebooting to clear the caches (there are more elegant ways), our suspicions are confirmed. Only 2 seconds to launch – the highlighted line is when Keepass brought up its UI:
So there are two solutions:
Disable Plugins
If you don’t need plugins, you can just disable them.
Move KeePass
If you need / want plugins, create a subdirectory in your Tools directory for KeePass. For example, c:\Users\Lee\Tools\KeePass. When KeePass launches, it will still scrub through that whole directory and its subdirectories – but there will only be a few files there. Then, put a launcher script in your Tools folder:
:: keepass.cmd
start %~dp0\keepass\keepass %*
No. 1 — June 23rd, 2014 at 3:16 pm
Thanks for this article Lee, disabling the plugins really fixed the slow startup of KeePass for me from over a minute to a few seconds!
No. 2 — October 9th, 2014 at 3:24 am
Thanks for the article. My keepass was slow because it searched for keyfiles on network drives. Disabling the auto-search helped my Keepass to become much faster.
No. 3 — November 7th, 2014 at 10:48 am
Thank you very much. I use keepass every day for years and you may have just saved hours of my life.
No. 4 — July 19th, 2015 at 6:10 am
Thanks. Looks better. Mine wasn’t too slow but it was annoying to wait say 30 secs to load a small database.
No. 5 — October 7th, 2015 at 9:03 am
Great stuff, we publish this app via App-V and so it is buried deep in the file structure which was causing a very slow load time…
No. 6 — April 25th, 2017 at 6:29 am
We had the same problems, we solved this by View disable Show Entries of Subgroups , 2 seconds.
No. 7 — November 16th, 2017 at 8:44 pm
Thanks, this was really annoying. We were in the AppV boat as well.
FYI, these settings are kept under %APPDATA%\KeePass\KeePass.config.xml:
false
No. 8 — February 15th, 2018 at 3:52 pm
Thank you very much!
The first opportunity (Disable Plugins) helped me a lot.
Kind regards