We use Tomcat 7 for our web application. We provide an XML-based API so that our customers can communicate with our server in machine-to-machine mode (without the need for a web browser). Requests are processed by the servlet.
We need to prevent users from sending too many requests in a row. Some of the services we provide include polling results, and users can make queries in a loop without any breaks, making dozens of queries per second for nothing.
How can we protect ourselves from flooding with useless requests? Is there an easy way to block requests at the servlet input level when there are too many requests coming from the same IP address? Is there anything built-in Tomcat to solve this problem?
source share