Implementing lock capacity rate limit and tests