exponential backoff isn't really working for the lockfile, so keep it down to 0.1 second pauses while trying to grab the lock. also, flush the caches at shutdown, and pause during cache rebuilding to give normal requests a chance to get the lock. (with threading.Lock, wakeups were automatic, but with the file lock, there's a lot of sleeping going on.)