ufw limit

File name is
/usr/lib/python2.7/dist-packages/ufw/backend_iptables.py
The next lines tell it to release blocked stuff in 10 seconds. I do not understand completely.
 572                 tmp2 = pat_limit.sub(' -m state --state NEW -m recent' + \
 573                                      ' --update --seconds 10 --hitcount 20' + \
This parameter is the stuff that blocks an ip if too many reloads happen. In principle, you must change this 500 to something lower to get timeouts faster. The default for this value --limit was 3/min. For webserver, I have changed to 500/min.
  63         # The default log rate limiting rule
  64         self.ufw_user_limit_log = ['ufw-user-limit', '-m', 'limit', \
  65                                    '--limit', '500/minute', '-j', 'LOG', \
  66                                    '--log-prefix']
  67         self.ufw_user_limit_log_text = "[UFW LIMIT BLOCK]"
After these changes, you need to
ufw reload

ufw disable

ufw enable

ufw status numbered

tail  /var/log/ufw.log  | grep LIMIT | awk '{print $1" "$2" "$3" "$4" "$14 }'